Question
Draw state machine for a combination lock. The combination is 1-4-2. If you get any digit wrong, you should go back to the initial state.
Draw state machine for a combination lock. The combination is 1-4-2. If you get any digit wrong, you should go back to the initial state. (6 points) (Assume there are only numbers 1-5 on your lock)
Sol83:
Here is the state machine diagram for the combination lock:
+--1--+
| |
[Initial]--[1]--[2]--[3]--[4]--[Success]
| |
+---------[Reset]----+
The states are represented by the circles, and the transitions are represented by the arrows. The numbers next to the arrows represent the digits of the combination. The [Initial] state is the starting point, and the [Success] state is the end point when the correct combination has been entered.
If the correct digit is entered, the state machine moves to the next digit. If an incorrect digit is entered, the state machine goes back to the [Initial] state. If the [Reset] transition is taken, the state machine also goes back to the [Initial] state.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started