English subtitles

← Disjunction In Fsms Solution - Programming Languages

Get Embed Code
5 Languages

Showing Revision 3 created 05/24/2016 by Udacity Robot.

  1. Well, it turns out that this finite state machine accepts [a - z]+ or [0 - 9]+,
  2. but we don't need to know that to answer the question.
  3. We can just start at the start state.
  4. We see an 'a'. We end up in state 2, and state 2 is an accepting state, so we accept.
  5. The empty string--we come in here in state 1, and we don't go anywhere
  6. because we're out of input.
  7. State 1 is not an accepting state, so, no.
  8. 'Havel 1936' starts with an uppercase H.
  9. We actually don't have any outgoing edges on uppercase H,
  10. so we fall off immediately and do not accept.
  11. Lowercase 'havel 2011'--that's just looking good.
  12. h-a-v-e-l, and we're still in state 2, and then we see the 2,
  13. and now we fall off because this accepts either words or numbers, but not combinations.
  14. Then finally '1993'--1-9-9-3. Yes!
  15. Vaclav Havel was a Czech writer/intellectual and the first president of the Czech Republic
  16. in 1993.