Input/Output Problem #1












12














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.










share|improve this question




















  • 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 '18 at 11:38
















12














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.










share|improve this question




















  • 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 '18 at 11:38














12












12








12







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.










share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 14 '18 at 11:58

























asked Nov 14 '18 at 10:58









Ben Franks

50214




50214








  • 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 '18 at 11:38














  • 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 '18 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 '18 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 '18 at 11:38










3 Answers
3






active

oldest

votes


















9














Would this work?




Left part is "odd", right part is "even".

enter image description here







share|improve this answer





















  • Correct well done, stay tuned for some more (and harder) ones.
    – Ben Franks
    Nov 14 '18 at 11:36



















6














This works:




enter image description here

Here odd means 1,3,5,7,9 / and even means 0,2,4,6,8







share|improve this answer





















  • Correct solution +1. But jafe did answer first so I have given him the solution point.
    – Ben Franks
    Nov 14 '18 at 11:35



















5














I believe this solution should work:




enter image description here Where even means "even digit" and odd means "odd digit". Left node is START.







share|improve this answer























  • You can shrink this by one state.
    – Gareth McCaughan
    Nov 14 '18 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 '18 at 11:18












  • Solution works but can be optimised to use less points.
    – Ben Franks
    Nov 14 '18 at 11:36











Your Answer





StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "559"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















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

























3 Answers
3






active

oldest

votes








3 Answers
3






active

oldest

votes









active

oldest

votes






active

oldest

votes









9














Would this work?




Left part is "odd", right part is "even".

enter image description here







share|improve this answer





















  • Correct well done, stay tuned for some more (and harder) ones.
    – Ben Franks
    Nov 14 '18 at 11:36
















9














Would this work?




Left part is "odd", right part is "even".

enter image description here







share|improve this answer





















  • Correct well done, stay tuned for some more (and harder) ones.
    – Ben Franks
    Nov 14 '18 at 11:36














9












9








9






Would this work?




Left part is "odd", right part is "even".

enter image description here







share|improve this answer












Would this work?




Left part is "odd", right part is "even".

enter image description here








share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 14 '18 at 11:17









jafe

17.1k244171




17.1k244171












  • Correct well done, stay tuned for some more (and harder) ones.
    – Ben Franks
    Nov 14 '18 at 11:36


















  • Correct well done, stay tuned for some more (and harder) ones.
    – Ben Franks
    Nov 14 '18 at 11:36
















Correct well done, stay tuned for some more (and harder) ones.
– Ben Franks
Nov 14 '18 at 11:36




Correct well done, stay tuned for some more (and harder) ones.
– Ben Franks
Nov 14 '18 at 11:36











6














This works:




enter image description here

Here odd means 1,3,5,7,9 / and even means 0,2,4,6,8







share|improve this answer





















  • Correct solution +1. But jafe did answer first so I have given him the solution point.
    – Ben Franks
    Nov 14 '18 at 11:35
















6














This works:




enter image description here

Here odd means 1,3,5,7,9 / and even means 0,2,4,6,8







share|improve this answer





















  • Correct solution +1. But jafe did answer first so I have given him the solution point.
    – Ben Franks
    Nov 14 '18 at 11:35














6












6








6






This works:




enter image description here

Here odd means 1,3,5,7,9 / and even means 0,2,4,6,8







share|improve this answer












This works:




enter image description here

Here odd means 1,3,5,7,9 / and even means 0,2,4,6,8








share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 14 '18 at 11:18









u_ndefined

2,638436




2,638436












  • Correct solution +1. But jafe did answer first so I have given him the solution point.
    – Ben Franks
    Nov 14 '18 at 11:35


















  • Correct solution +1. But jafe did answer first so I have given him the solution point.
    – Ben Franks
    Nov 14 '18 at 11:35
















Correct solution +1. But jafe did answer first so I have given him the solution point.
– Ben Franks
Nov 14 '18 at 11:35




Correct solution +1. But jafe did answer first so I have given him the solution point.
– Ben Franks
Nov 14 '18 at 11:35











5














I believe this solution should work:




enter image description here Where even means "even digit" and odd means "odd digit". Left node is START.







share|improve this answer























  • You can shrink this by one state.
    – Gareth McCaughan
    Nov 14 '18 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 '18 at 11:18












  • Solution works but can be optimised to use less points.
    – Ben Franks
    Nov 14 '18 at 11:36
















5














I believe this solution should work:




enter image description here Where even means "even digit" and odd means "odd digit". Left node is START.







share|improve this answer























  • You can shrink this by one state.
    – Gareth McCaughan
    Nov 14 '18 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 '18 at 11:18












  • Solution works but can be optimised to use less points.
    – Ben Franks
    Nov 14 '18 at 11:36














5












5








5






I believe this solution should work:




enter image description here Where even means "even digit" and odd means "odd digit". Left node is START.







share|improve this answer














I believe this solution should work:




enter image description here Where even means "even digit" and odd means "odd digit". Left node is START.








share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 14 '18 at 11:17

























answered Nov 14 '18 at 11:16









NudgeNudge

1,801727




1,801727












  • You can shrink this by one state.
    – Gareth McCaughan
    Nov 14 '18 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 '18 at 11:18












  • Solution works but can be optimised to use less points.
    – Ben Franks
    Nov 14 '18 at 11:36


















  • You can shrink this by one state.
    – Gareth McCaughan
    Nov 14 '18 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 '18 at 11:18












  • Solution works but can be optimised to use less points.
    – Ben Franks
    Nov 14 '18 at 11:36
















You can shrink this by one state.
– Gareth McCaughan
Nov 14 '18 at 11:17




You can shrink this by one state.
– Gareth McCaughan
Nov 14 '18 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 '18 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 '18 at 11:18














Solution works but can be optimised to use less points.
– Ben Franks
Nov 14 '18 at 11:36




Solution works but can be optimised to use less points.
– Ben Franks
Nov 14 '18 at 11:36


















draft saved

draft discarded




















































Thanks for contributing an answer to Puzzling Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














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





















































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







Popular posts from this blog

鏡平學校

ꓛꓣだゔៀៅຸ໢ທຮ໕໒ ,ໂ'໥໓າ໼ឨឲ៵៭ៈゎゔit''䖳𥁄卿' ☨₤₨こゎもょの;ꜹꟚꞖꞵꟅꞛေၦေɯ,ɨɡ𛃵𛁹ޝ޳ޠ޾,ޤޒޯ޾𫝒𫠁သ𛅤チョ'サノބޘދ𛁐ᶿᶇᶀᶋᶠ㨑㽹⻮ꧬ꧹؍۩وَؠ㇕㇃㇪ ㇦㇋㇋ṜẰᵡᴠ 軌ᵕ搜۳ٰޗޮ޷ސޯ𫖾𫅀ल, ꙭ꙰ꚅꙁꚊꞻꝔ꟠Ꝭㄤﺟޱސꧨꧼ꧴ꧯꧽ꧲ꧯ'⽹⽭⾁⿞⼳⽋២៩ញណើꩯꩤ꩸ꩮᶻᶺᶧᶂ𫳲𫪭𬸄𫵰𬖩𬫣𬊉ၲ𛅬㕦䬺𫝌𫝼,,𫟖𫞽ហៅ஫㆔ాఆఅꙒꚞꙍ,Ꙟ꙱エ ,ポテ,フࢰࢯ𫟠𫞶 𫝤𫟠ﺕﹱﻜﻣ𪵕𪭸𪻆𪾩𫔷ġ,ŧآꞪ꟥,ꞔꝻ♚☹⛵𛀌ꬷꭞȄƁƪƬșƦǙǗdžƝǯǧⱦⱰꓕꓢႋ神 ဴ၀க௭எ௫ឫោ ' េㇷㇴㇼ神ㇸㇲㇽㇴㇼㇻㇸ'ㇸㇿㇸㇹㇰㆣꓚꓤ₡₧ ㄨㄟ㄂ㄖㄎ໗ツڒذ₶।ऩछएोञयूटक़कयँृी,冬'𛅢𛅥ㇱㇵㇶ𥄥𦒽𠣧𠊓𧢖𥞘𩔋цѰㄠſtʯʭɿʆʗʍʩɷɛ,əʏダヵㄐㄘR{gỚṖḺờṠṫảḙḭᴮᵏᴘᵀᵷᵕᴜᴏᵾq﮲ﲿﴽﭙ軌ﰬﶚﶧ﫲Ҝжюїкӈㇴffצּ﬘﭅﬈軌'ffistfflſtffतभफɳɰʊɲʎ𛁱𛁖𛁮𛀉 𛂯𛀞నఋŀŲ 𫟲𫠖𫞺ຆຆ ໹້໕໗ๆทԊꧢꧠ꧰ꓱ⿝⼑ŎḬẃẖỐẅ ,ờỰỈỗﮊDžȩꭏꭎꬻ꭮ꬿꭖꭥꭅ㇭神 ⾈ꓵꓑ⺄㄄ㄪㄙㄅㄇstA۵䞽ॶ𫞑𫝄㇉㇇゜軌𩜛𩳠Jﻺ‚Üမ႕ႌႊၐၸဓၞၞၡ៸wyvtᶎᶪᶹစဎ꣡꣰꣢꣤ٗ؋لㇳㇾㇻㇱ㆐㆔,,㆟Ⱶヤマފ޼ޝަݿݞݠݷݐ',ݘ,ݪݙݵ𬝉𬜁𫝨𫞘くせぉて¼óû×ó£…𛅑הㄙくԗԀ5606神45,神796'𪤻𫞧ꓐ㄁ㄘɥɺꓵꓲ3''7034׉ⱦⱠˆ“𫝋ȍ,ꩲ軌꩷ꩶꩧꩫఞ۔فڱێظペサ神ナᴦᵑ47 9238їﻂ䐊䔉㠸﬎ffiﬣ,לּᴷᴦᵛᵽ,ᴨᵤ ᵸᵥᴗᵈꚏꚉꚟ⻆rtǟƴ𬎎

Why https connections are so slow when debugging (stepping over) in Java?