Input/Output Problem #1
up vote
12
down vote
favorite
The basis for this problem is that you did to make an optimal pattern so that all inputted sequences will be "accepted" if they fit the rules of the problem and "rejected" if they break any of them.
.
Above are some examples of functions that can be performed. (A) shows a machine that will only accept the sequences that repeat 12 as you must begin at start and end on a red dot.
In (B) the "*" means you can pass along that route without an input there. So (B) accepts 1111122222, 22222, 1122 etc but doesn't accept any sequence in which there is a 1 after the 2.
In (C) you can move along either route to reach an end. So 12222 and 1333 are both accepted sequences.
All routes have to be either single digit or single letter. Obviously shorthand like "odd", "even" can be used in answers rather than drawing loads of arrows.
Problem #1
Make an optimal machine using digits 0-9 that only accepts sequences where the digits sum are even and rejects if they are odd.
mathematics
New contributor
add a comment |
up vote
12
down vote
favorite
The basis for this problem is that you did to make an optimal pattern so that all inputted sequences will be "accepted" if they fit the rules of the problem and "rejected" if they break any of them.
.
Above are some examples of functions that can be performed. (A) shows a machine that will only accept the sequences that repeat 12 as you must begin at start and end on a red dot.
In (B) the "*" means you can pass along that route without an input there. So (B) accepts 1111122222, 22222, 1122 etc but doesn't accept any sequence in which there is a 1 after the 2.
In (C) you can move along either route to reach an end. So 12222 and 1333 are both accepted sequences.
All routes have to be either single digit or single letter. Obviously shorthand like "odd", "even" can be used in answers rather than drawing loads of arrows.
Problem #1
Make an optimal machine using digits 0-9 that only accepts sequences where the digits sum are even and rejects if they are odd.
mathematics
New contributor
7
These things are called Finite State Machines, and requiring the simplest FSM makes a great puzzle, so I guess this puzzle type is one of the rare cases that would be on topic both here and on PCG. Nicely done!
– Bass
Nov 14 at 11:38
add a comment |
up vote
12
down vote
favorite
up vote
12
down vote
favorite
The basis for this problem is that you did to make an optimal pattern so that all inputted sequences will be "accepted" if they fit the rules of the problem and "rejected" if they break any of them.
.
Above are some examples of functions that can be performed. (A) shows a machine that will only accept the sequences that repeat 12 as you must begin at start and end on a red dot.
In (B) the "*" means you can pass along that route without an input there. So (B) accepts 1111122222, 22222, 1122 etc but doesn't accept any sequence in which there is a 1 after the 2.
In (C) you can move along either route to reach an end. So 12222 and 1333 are both accepted sequences.
All routes have to be either single digit or single letter. Obviously shorthand like "odd", "even" can be used in answers rather than drawing loads of arrows.
Problem #1
Make an optimal machine using digits 0-9 that only accepts sequences where the digits sum are even and rejects if they are odd.
mathematics
New contributor
The basis for this problem is that you did to make an optimal pattern so that all inputted sequences will be "accepted" if they fit the rules of the problem and "rejected" if they break any of them.
.
Above are some examples of functions that can be performed. (A) shows a machine that will only accept the sequences that repeat 12 as you must begin at start and end on a red dot.
In (B) the "*" means you can pass along that route without an input there. So (B) accepts 1111122222, 22222, 1122 etc but doesn't accept any sequence in which there is a 1 after the 2.
In (C) you can move along either route to reach an end. So 12222 and 1333 are both accepted sequences.
All routes have to be either single digit or single letter. Obviously shorthand like "odd", "even" can be used in answers rather than drawing loads of arrows.
Problem #1
Make an optimal machine using digits 0-9 that only accepts sequences where the digits sum are even and rejects if they are odd.
mathematics
mathematics
New contributor
New contributor
edited Nov 14 at 11:58
New contributor
asked Nov 14 at 10:58
Ben Franks
30212
30212
New contributor
New contributor
7
These things are called Finite State Machines, and requiring the simplest FSM makes a great puzzle, so I guess this puzzle type is one of the rare cases that would be on topic both here and on PCG. Nicely done!
– Bass
Nov 14 at 11:38
add a comment |
7
These things are called Finite State Machines, and requiring the simplest FSM makes a great puzzle, so I guess this puzzle type is one of the rare cases that would be on topic both here and on PCG. Nicely done!
– Bass
Nov 14 at 11:38
7
7
These things are called Finite State Machines, and requiring the simplest FSM makes a great puzzle, so I guess this puzzle type is one of the rare cases that would be on topic both here and on PCG. Nicely done!
– Bass
Nov 14 at 11:38
These things are called Finite State Machines, and requiring the simplest FSM makes a great puzzle, so I guess this puzzle type is one of the rare cases that would be on topic both here and on PCG. Nicely done!
– Bass
Nov 14 at 11:38
add a comment |
3 Answers
3
active
oldest
votes
up vote
9
down vote
accepted
Would this work?
Left part is "odd", right part is "even".
Correct well done, stay tuned for some more (and harder) ones.
– Ben Franks
Nov 14 at 11:36
add a comment |
up vote
6
down vote
This works:
Here odd means 1,3,5,7,9 / and even means 0,2,4,6,8
Correct solution +1. But jafe did answer first so I have given him the solution point.
– Ben Franks
Nov 14 at 11:35
add a comment |
up vote
5
down vote
I believe this solution should work:
Where even means "even digit" and odd means "odd digit". Left node is START.
You can shrink this by one state.
– Gareth McCaughan♦
Nov 14 at 11:17
I'm not sure you can, I'll give it a little thought. The other solutions have one fewer node but I'm not sure you can use the same node as start and end (because then an empty string would be a correct one?)
– NudgeNudge
Nov 14 at 11:18
Solution works but can be optimised to use less points.
– Ben Franks
Nov 14 at 11:36
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
9
down vote
accepted
Would this work?
Left part is "odd", right part is "even".
Correct well done, stay tuned for some more (and harder) ones.
– Ben Franks
Nov 14 at 11:36
add a comment |
up vote
9
down vote
accepted
Would this work?
Left part is "odd", right part is "even".
Correct well done, stay tuned for some more (and harder) ones.
– Ben Franks
Nov 14 at 11:36
add a comment |
up vote
9
down vote
accepted
up vote
9
down vote
accepted
Would this work?
Left part is "odd", right part is "even".
Would this work?
Left part is "odd", right part is "even".
answered Nov 14 at 11:17
jafe
12.8k29133
12.8k29133
Correct well done, stay tuned for some more (and harder) ones.
– Ben Franks
Nov 14 at 11:36
add a comment |
Correct well done, stay tuned for some more (and harder) ones.
– Ben Franks
Nov 14 at 11:36
Correct well done, stay tuned for some more (and harder) ones.
– Ben Franks
Nov 14 at 11:36
Correct well done, stay tuned for some more (and harder) ones.
– Ben Franks
Nov 14 at 11:36
add a comment |
up vote
6
down vote
This works:
Here odd means 1,3,5,7,9 / and even means 0,2,4,6,8
Correct solution +1. But jafe did answer first so I have given him the solution point.
– Ben Franks
Nov 14 at 11:35
add a comment |
up vote
6
down vote
This works:
Here odd means 1,3,5,7,9 / and even means 0,2,4,6,8
Correct solution +1. But jafe did answer first so I have given him the solution point.
– Ben Franks
Nov 14 at 11:35
add a comment |
up vote
6
down vote
up vote
6
down vote
This works:
Here odd means 1,3,5,7,9 / and even means 0,2,4,6,8
This works:
Here odd means 1,3,5,7,9 / and even means 0,2,4,6,8
answered Nov 14 at 11:18
u_ndefined
2,593436
2,593436
Correct solution +1. But jafe did answer first so I have given him the solution point.
– Ben Franks
Nov 14 at 11:35
add a comment |
Correct solution +1. But jafe did answer first so I have given him the solution point.
– Ben Franks
Nov 14 at 11:35
Correct solution +1. But jafe did answer first so I have given him the solution point.
– Ben Franks
Nov 14 at 11:35
Correct solution +1. But jafe did answer first so I have given him the solution point.
– Ben Franks
Nov 14 at 11:35
add a comment |
up vote
5
down vote
I believe this solution should work:
Where even means "even digit" and odd means "odd digit". Left node is START.
You can shrink this by one state.
– Gareth McCaughan♦
Nov 14 at 11:17
I'm not sure you can, I'll give it a little thought. The other solutions have one fewer node but I'm not sure you can use the same node as start and end (because then an empty string would be a correct one?)
– NudgeNudge
Nov 14 at 11:18
Solution works but can be optimised to use less points.
– Ben Franks
Nov 14 at 11:36
add a comment |
up vote
5
down vote
I believe this solution should work:
Where even means "even digit" and odd means "odd digit". Left node is START.
You can shrink this by one state.
– Gareth McCaughan♦
Nov 14 at 11:17
I'm not sure you can, I'll give it a little thought. The other solutions have one fewer node but I'm not sure you can use the same node as start and end (because then an empty string would be a correct one?)
– NudgeNudge
Nov 14 at 11:18
Solution works but can be optimised to use less points.
– Ben Franks
Nov 14 at 11:36
add a comment |
up vote
5
down vote
up vote
5
down vote
I believe this solution should work:
Where even means "even digit" and odd means "odd digit". Left node is START.
I believe this solution should work:
Where even means "even digit" and odd means "odd digit". Left node is START.
edited Nov 14 at 11:17
answered Nov 14 at 11:16
NudgeNudge
1,069621
1,069621
You can shrink this by one state.
– Gareth McCaughan♦
Nov 14 at 11:17
I'm not sure you can, I'll give it a little thought. The other solutions have one fewer node but I'm not sure you can use the same node as start and end (because then an empty string would be a correct one?)
– NudgeNudge
Nov 14 at 11:18
Solution works but can be optimised to use less points.
– Ben Franks
Nov 14 at 11:36
add a comment |
You can shrink this by one state.
– Gareth McCaughan♦
Nov 14 at 11:17
I'm not sure you can, I'll give it a little thought. The other solutions have one fewer node but I'm not sure you can use the same node as start and end (because then an empty string would be a correct one?)
– NudgeNudge
Nov 14 at 11:18
Solution works but can be optimised to use less points.
– Ben Franks
Nov 14 at 11:36
You can shrink this by one state.
– Gareth McCaughan♦
Nov 14 at 11:17
You can shrink this by one state.
– Gareth McCaughan♦
Nov 14 at 11:17
I'm not sure you can, I'll give it a little thought. The other solutions have one fewer node but I'm not sure you can use the same node as start and end (because then an empty string would be a correct one?)
– NudgeNudge
Nov 14 at 11:18
I'm not sure you can, I'll give it a little thought. The other solutions have one fewer node but I'm not sure you can use the same node as start and end (because then an empty string would be a correct one?)
– NudgeNudge
Nov 14 at 11:18
Solution works but can be optimised to use less points.
– Ben Franks
Nov 14 at 11:36
Solution works but can be optimised to use less points.
– Ben Franks
Nov 14 at 11:36
add a comment |
Ben Franks is a new contributor. Be nice, and check out our Code of Conduct.
Ben Franks is a new contributor. Be nice, and check out our Code of Conduct.
Ben Franks is a new contributor. Be nice, and check out our Code of Conduct.
Ben Franks is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fpuzzling.stackexchange.com%2fquestions%2f75176%2finput-output-problem-1%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
7
These things are called Finite State Machines, and requiring the simplest FSM makes a great puzzle, so I guess this puzzle type is one of the rare cases that would be on topic both here and on PCG. Nicely done!
– Bass
Nov 14 at 11:38