5
$\begingroup$

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)

$\endgroup$
1
  • $\begingroup$ Is mathematics as tag ok? It's more Informatics $\endgroup$
    – user52327
    Commented Nov 14, 2018 at 14:45

7 Answers 7

7
$\begingroup$

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

$\endgroup$
13
  • $\begingroup$ I thought of that too, but can an input/output diagram have two ends? $\endgroup$ Commented Nov 14, 2018 at 11:45
  • $\begingroup$ @OmegaKrypton I'm not absolutely sure but I rather think you can have 2 ends :) $\endgroup$
    – user52327
    Commented Nov 14, 2018 at 11:48
  • $\begingroup$ This diagram fails if the string is a single "Y". Should Y be also listed in the consonants? Thanks $\endgroup$ Commented Nov 14, 2018 at 11:48
  • $\begingroup$ 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. $\endgroup$
    – Ben Franks
    Commented Nov 14, 2018 at 11:48
  • 7
    $\begingroup$ It also accepts an empty string, but an empty string does not begin with a consonant. $\endgroup$ Commented Nov 14, 2018 at 12:09
5
$\begingroup$

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\;}$

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

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

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

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.

$\endgroup$
0
$\begingroup$

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

enter image description here

$\endgroup$
2
  • $\begingroup$ Your solution would accept a sequence that begins with a vowel which breaks one of the requirements. $\endgroup$
    – Ben Franks
    Commented Nov 14, 2018 at 11:53
  • $\begingroup$ @BenFranks Rats, you're right... $\endgroup$
    – Jafe
    Commented Nov 14, 2018 at 11:54
0
$\begingroup$

My attempt:

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

$\endgroup$
1
  • $\begingroup$ MS Paint lives on! $\endgroup$
    – Skaterhaz
    Commented Nov 14, 2018 at 14:12
0
$\begingroup$

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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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