See here for basic rules on problem.

Input/Output Problem #1

Problem #2

Make an optimal machine that accepts any letter combination that begins with a consonant and alternates vowel consonant from then on. ("Y" is considered both vowel and consonant)

  • Is mathematics as tag ok? It's more Informatics – Jannis Nov 14 at 14:45
up vote 7 down vote accepted

This is my answer :)
Vowel: A,E,I,O,U,Y
Consonant: B,C,D,F,G,H,J,K,L,M,N,P,Q,R,S,T,V,W,X,Y,Z

enter image description here

Original Edits:

answer

...

answer

  • I thought of that too, but can an input/output diagram have two ends? – Omega Krypton Nov 14 at 11:45
  • @OmegaKrypton I'm not absolutely sure but I rather think you can have 2 ends :) – Jannis Nov 14 at 11:48
  • This diagram fails if the string is a single "Y". Should Y be also listed in the consonants? Thanks – Omega Krypton Nov 14 at 11:48
  • You don't need a point for fail, you just need a Start and any sequence that doesn't end on a red dotted circle fails. Also yes you can have multiple ends. – Ben Franks Nov 14 at 11:48
  • 7
    It also accepts an empty string, but an empty string does not begin with a consonant. – Jaap Scherphuis Nov 14 at 12:09

Can I have:

$\oplus\xrightarrow{consonant}\color{red}\bullet\xrightarrow{\;\;vowel\;\;}\color{red}\bullet$
$\qquad\qquad\quad\,\mid\qquad\qquad\mid$
$\qquad\qquad\quad\,\xleftarrow{\;consonant\;}$

  • Not correct if the sequence ends with a vowel. – Ben Franks Nov 14 at 12:31
  • @BenFranks; oh right, so is this any better? – JonMark Perry Nov 14 at 12:35
  • it is correct now but can be optimised. Remember the start can be an end. – Ben Franks Nov 14 at 12:38
  • like this? I did move the \oplus to the last red, but this accepts an empty string, which I feel is cheating – JonMark Perry Nov 14 at 12:41
  • 1
    this is correct :) – Ben Franks Nov 14 at 12:49

I think it is following since its not specified that if it should end on vowel or consonant.

enter image description here

If the failed state is must,

enter image description here

If it should alternate and end on consonant then:

enter image description here

  • It shall alternate ... this is not correct – Jannis Nov 14 at 11:53
  • @Jannis I have edited my answer please check – Naeem Shaikh Nov 14 at 11:55
  • It shall not end on an consonant ... read the question again – Jannis Nov 14 at 11:55
  • 1
    @Jannis where is that in the question? – Naeem Shaikh Nov 14 at 11:56
  • Nowhere stands sth about how to end the chain ... – Jannis Nov 14 at 11:57

My solution has 5 nodes.
(EDIT: I made it too complicated, and a 3-node solution is possible. I'm leaving this answer as-is, because it works and is interesting.)

enter image description here
Note that the Consonant and Vowel labels in the picture exclude Y, e.g. Vowel means AEIOU only.

It does not accept an empty string.
It accepts a string of Y's.
It accepts a string starting with any even number of Y's only if it is followed by a consonant, but not if it is followed by a vowel.
It accepts a string starting with any odd number of Y's only if it is followed by a vowel, but not if it is followed by a consonant.
The left two nodes of the square deal with any Y prefixes. The right two nodes are used once a non-Y has been seen. I needed the extra starting node in order to disallow an empty string, since the question says the string must begin with a consonant.

I believe that this is one of the possible solutions:

my answer

  • You don't need points for failed sequences to go to, they can just fail so you can optimise this further. If the sequence cannot go further it is rejected and if it ends not on a red dot it is rejected. – Ben Franks Nov 14 at 11:50
  • Also this doesn't allow for strings that end with a consonant so it is incorrect. – Ben Franks Nov 14 at 11:50

Pen-and-paper solution... doop de doo.

enter image description here

  • Your solution would accept a sequence that begins with a vowel which breaks one of the requirements. – Ben Franks Nov 14 at 11:53
  • @BenFranks Rats, you're right... – jafe Nov 14 at 11:54

My attempt:

I don't know if the "But not Y" part is neccessary, but here goes enter image description here

  • MS Paint lives on! – Skaterhaz Nov 14 at 14:12

You can shape it like a triangle. 3 way solution. This assumes what Y is both consonant and vowel, basiclly it cycles between Start and the node O until the rule is broken.

c c ---> ---> Start O Fail <--- ---> a a

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.