See here for basic rules on problem.
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)
See here for basic rules on problem.
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)
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
Original Edits:
...
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\;}$
I think it is following since its not specified that if it should end on vowel or consonant.
If the failed state is must,
If it should alternate and end on consonant then:
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.)
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.
Pen-and-paper solution... doop de doo.
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