English subtitles

← RE to FSM - Programming Languages

Get Embed Code
3 Languages

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

  1. Let’s analyze them one by one. This requires at
  2. least 1C and then you can have zero or more As.
  3. This is CA star and we’re suppose to match
  4. optional CA star, so this isn’t quite right. A string
  5. that’s accepted up here A or even the empty string
  6. is not accepted down here. Down here this finite
  7. state machine would allow you to do
  8. A, C, A, C, A, C, to alternate between them
  9. because there is only one state. The regular
  10. expression up top does not. Over here this is
  11. looking relatively promising; if we have no C's we
  12. can have a star that’s pretty good and we can also
  13. have an optional C. But here is a string accepted
  14. by this first regular expression C, AA that is not
  15. accepted by this machine. C and then we would
  16. fall off. So this is not a good bat, so either I’m
  17. super evil or this last one is the winner and it turns
  18. out that the last one is the winner. And essentially
  19. up here we have A star and down here we have
  20. CA star. When I put these two paths together, I
  21. get optional C followed by A star.