00:02
So in this case, the first question here, we need to explain when the machine gives candy.
00:09
And in this case, the machine here, so in this case, so use the diagram, this machine gives candy if the last two coins were dimes before you press the button.
00:22
Because if you put one dime or you start with a nickel, you just keep going, you stay in the start.
00:29
If you put the first one as a dime, you go to state 1, but then if you change and put a nickel, you go back to the start.
00:37
So you have to have two consecutive dimes and then press the button.
00:42
And that's okay.
00:43
Then you can put dimes as much as you can and you're going to stay in the state in which you're going to get candy.
00:52
Then for item b, we're gonna see here that in this venn diagram, we don't need to use all the states because if you consider that if we start with a dime, you stay in the start state, then yes, one, if you put like a nickel, they start, you go to s1, then if you put a dime, you're gonna basically be in this state in which you can have a candy by pressing in the uh by button but if then in this case you put like in that state a nickel you go you go to this as uh state two and then if you put a nickel again you go to state one so you don't need to have this second state which means that we can redraw this as you're gonna have here the start start then you're gonna have the if you put a dime then if you put a nickel you go to the state two oh state one sorry and then if you put another nickel you stay in the state but if you put a dime now you go you're gonna go to the state in which you can get a candy if you press the button right and then after that if you keep putting dimes you're gonna be in the state in which you can get candy if you decide to put a nickel then you go back to the state one so in this case so in this case this machine will give candy if the buyer has entered this one nickel followed by at least one dime and then if the the buyer press like the buy button will get a candy then for the other items we need to represent what is happening using the diagram so in this case, let's start with the state start here.
02:45
So if you put a dime, we have here the state 2.
02:51
If you put a nickel, you're going to go to the state 1.
02:56
Then if you are in the state 1, let's say that you start by putting a nickel.
03:00
If you put a nickel again, you're going to go to state 2.
03:04
And then in state 2, if you put a dime, you're going to go to the state in which you can get a candy.
03:10
If you press the buy button here.
03:14
Then if you put like a dime here in the state before pressing, you're going to go back to state 2.
03:23
But if you put a nickel, you go back to the state 1.
03:28
If you're in the state 2, if you didn't put like a dime, you're going to go to another state, s3.
03:35
So in this case, you put a nickel...