Return to Video

01-47 Fsm Interpretation Solution

  • 0:00 - 0:02
    Well, let's go through one way to do it together.
  • 0:02 - 0:05
    I find it helpful to draw the finite state machine first.
  • 0:05 - 0:07
    So here's my start state. We'll call it 1.
  • 0:07 - 0:12
    And because "q * " accepts the empty string, it also has to be an accepting state,
  • 0:12 - 0:17
    but I can see any number of q's that I like and still accept,
  • 0:17 - 0:22
    so it looks like we've got 1 state, 1 edge, and our state is also an accepting state.
  • 0:22 - 0:26
    So just to show that this program really works, we're going to run it in the interpreter.
  • 0:26 - 0:30
    Over here, I have defined edges, just as we suggested.
  • 0:30 - 0:32
    In state 1 on a 'q', you loop back to state 1.
  • 0:32 - 0:36
    State 1 is our start state, and it's also our accepting state.
  • 0:36 - 0:41
    Let's try out our simulation on a bunch of q's, the empty string, and a bunch of q's
  • 0:41 - 0:42
    with an evil interloper.
  • 0:42 - 0:47
    We've got this 'A' hiding here. This should be true. True. False.
  • 0:47 - 0:48
    Oh, and it is.
  • 0:48 -
    So our finite state machine simulator matches our intuition exactly.
タイトル:
01-47 Fsm Interpretation Solution
概説:

more » « less
Video Language:
English
Team:
Udacity
プロジェクト:
CS262 - Programming Languages
Duration:
0:53
Amara Bot added a translation

English subtitles

改訂