There are 5 digit numbers for the door. Now I am going to find the input numbers to open and close the door. Therefore, it has two sets of numbers.

enter image description here

The answer is 2, 9, 4 to lock the door and 3,6,7 to unlock the door.



closed as unclear what you're asking by Peregrine Rook, Marius, Beastly Gerbil, Alconja, Rand al'Thor Nov 20 '16 at 12:25

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.


This question needs a lot of help, as the way it's written is rather incomprehensible. I believe you're looking for distinct 5 digit sequences that will unlock and lock the door, respectively.

To unlock:

Two strings will work, according to the provided state diagram.
25594 and 31694.

(It should also be noted that 255594, 2555594, and so on for any number of 5s will work. Including zero: 294 also works. Similarly, 311694, 3111694, etc. for any number of 1s, including zero. However, none of these other choices are five digits, which while not strictly required by the state diagram was nonetheless specified, I think, by the problem.)

To lock:

31167 is the only sequence that works here.

(As before, sequences of different length than 5 also are accepted by the state diagram: 311167, 3111167, etc., for any number of 1s including zero.)

You've tagged this and . Unless there is far more to this question than the surface reading suggests, neither tag fits.

  • $\begingroup$ I think if the number is a wrong number (Which number is no in the graph) Example 3,8,6,0,4. The result will still go to unlock? $\endgroup$ – terry Nov 20 '16 at 9:34
  • $\begingroup$ 38604 will not unlock - best case is it would be stuck in S4. 38694 however, might, but I doubt it. The fact that some digits explicitly loop back to the same state mean those digits for sure are accepted without changing state; other digits not thus shown probably cannot be assumed to be ignored with no state change. I would believe rather that they cause the input to be flagged as invalid. But this cannot be answered from the state diagram so we cannot know for sure. $\endgroup$ – Rubio Nov 20 '16 at 14:12
  • $\begingroup$ Ok got it.How about if I draw a new diagram based on this Figure 2 diagram and use the new number "11119" to unlock the door.Is it possible? $\endgroup$ – terry Nov 20 '16 at 15:16

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