3
$\begingroup$

See here for basic rules on problem.

Input/Output Problem #1

Problem #6

Make an optimal machine that accepts sequences of integer digits 1-4 such that all 1s are at the beginning and all 4s are at the end. Also there has to be exactly one of either the 2 or the 3 with any number of the other in each sequence. There doesn't have to be any 1s or 4s.

You do not need a route for failed sequences.

$\endgroup$
2
$\begingroup$

My answer uses 6 nodes.

enter image description here
I forgot to mark the left-most node as the start node, but that should be obvious.
One branch produces one 2 with any number of 3s on either side. The other branch does the same for one 3 with any number of 2s either side.

$\endgroup$
  • $\begingroup$ Scherphius +1 nice answer I believe this is optimal. $\endgroup$ – Ben Franks Nov 14 '18 at 14:24
3
$\begingroup$

Answer

This should be the optimized version. I added some colored boxes which don't belong to the machine to subdivide its parts

Input/Output

Previous Answers

pre edit: "Also there has to be exactly one of either the 2 or the 3."

Input/Output

post edit: "Also there has to be exactly one of either the 2 or the 3 with any number of the other in each sequence."

non-optimized:

Input/Output_2

not using empty paths

Input/Output

$\endgroup$
  • $\begingroup$ This solution doesn't accept answers with zero 2 or 3s or more than one 2 or 3s. $\endgroup$ – Ben Franks Nov 14 '18 at 13:04
  • 2
    $\begingroup$ @BenFranks "Also there has to be exactly one of either the 2 or the 3." But that's the point of the machine? $\endgroup$ – beemaad Nov 14 '18 at 13:05
  • 1
    $\begingroup$ I think he means there either has to be exactly one 2 with any number of 3s around it, or exactly one 3 with any number of 2s around it. $\endgroup$ – Jaap Scherphuis Nov 14 '18 at 13:13
  • $\begingroup$ @JaapScherphuis That is what I was trying to say. I will reword the puzzle to reflect this clearer. $\endgroup$ – Ben Franks Nov 14 '18 at 13:36
  • 1
    $\begingroup$ Your new solution has two arrows marked 2 and two arrows marked 3 leaving the start node. How do I know which one I should take? $\endgroup$ – Jaap Scherphuis Nov 14 '18 at 13:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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