Finite Automata and Regular Languages

Cd9b247e4507fed75312e9a42070125d?s=47 Tom Stuart
January 27, 2014

Finite Automata and Regular Languages

Cd9b247e4507fed75312e9a42070125d?s=128

Tom Stuart

January 27, 2014
Tweet

Transcript

  1. 1.

    F I N I T E & R E G

    U L A R A U T O M A T A L A N G U A G E S @tomstuart / London JS / 2014-01-27
  2. 5.
  3. 7.
  4. 10.

    1 2 3 a b b , a a b

    a b bb aa 1
  5. 11.

    2 3 a b b , a a b a

    b bb aa 2 1
  6. 12.

    1 2 3 a b b , a a b

    a b bb aa 2
  7. 13.

    1 3 a b b , a a b a

    b bb aa 3 2
  8. 14.

    1 2 3 a b b , a a b

    a b bb aa 3
  9. 15.

    1 2 3 a b b , a a b

    a b bb aa 3
  10. 16.

    1 3 a b b , a a b a

    b bb aa 3 2
  11. 19.

    1 2 3 a b b , a a b

    a b bb aa 1
  12. 20.

    2 3 a b b , a a b a

    b bb aa 2 1
  13. 21.

    1 2 3 a b b , a a b

    a b bb aa 2
  14. 22.

    1 3 a b b , a a b a

    b bb aa 3 2
  15. 23.

    1 2 3 a b b , a a b

    a b bb aa 3
  16. 24.

    1 2 3 a b b , a a b

    a b bb aa 3
  17. 25.

    1 3 a b b , a a b a

    b bb aa 3 2
  18. 27.

    1 3 a b b , a a b a

    b bb aa 3 2 ✔
  19. 29.

    a a 1 2 3 a b b , a

    a b b b bb 1
  20. 30.

    a a 1 2 3 1 a b , a

    a b b b bb b
  21. 31.

    a a 1 2 3 1 a b , a

    a b b b bb b
  22. 32.

    a a 1 2 3 1 a b , a

    a b b b bb b
  23. 33.

    a a 1 2 3 a b b , a

    a b b b bb 2
  24. 34.

    a a 1 2 3 a b b , a

    a b b b bb 2
  25. 35.

    a a 1 2 3 a b b , a

    a b b b bb 2
  26. 36.

    a a 1 2 3 a b b , a

    a b b b bb ✘ 2
  27. 37.

    bbbbaa baabba ✔ ✘ ab baba aaaab a baaaa b

    bbbbbb abbbb bbbbab bba ✔ ✔ ✔ ✔ ✔ ✘ ✘ ✘ ✘ ✘
  28. 41.

    1 2 3 a b b , a a b

    accepts strings containing "ab"
  29. 48.
  30. 55.

    1 1,2,4 1,3,4 1,3 b a a 1,2 1,4 1,2,3,4

    1,2,3 b a b a b b a b a b a b a
  31. 58.

    bbbbaa baabba ✔ ✘ ab baba aaaab a baaaa b

    bbbbbb abbbb bbbbab bba ✔ ✔ ✔ ✔ ✔ ✘ ✘ ✘ ✘ ✘
  32. 59.

    baabba ab baba aaaab abbbb bbbbab this is part of

    the language that the machine recognises
  33. 62.

    some regular languages: • the strings "one", "two" and "three"

    • all strings that contain "ab" • all strings whose third character is "b" • all strings whose third-from-last character is "b" • all strings that start and end with "a"
  34. 63.

    some non-regular languages: • all strings that are palindromes •

    all strings that contain equal numbers of "a" and "b" characters • all strings of brackets that are balanced • all strings that are valid JSON • all strings that contain equal numbers of "a", "b" and "c" characters • all strings whose length is prime • all strings that contain a halting JavaScript program
  35. 64.

    ( () ✔ ✘ (()) (()(())) ()()()()() (( (() )

    (((())))) ((((())))) (()((()))) (()))() ✔ ✔ ✔ ✔ ✔ ✘ ✘ ✘ ✘ ✘
  36. 68.

    /a/

  37. 69.

    a

  38. 70.
  39. 72.

    a b

  40. 73.

    a b

  41. 74.
  42. 75.
  43. 76.
  44. 77.
  45. 78.
  46. 81.
  47. 82.
  48. 83.
  49. 85.
  50. 86.
  51. 87.
  52. 88.
  53. 89.

    a b

  54. 90.
  55. 91.
  56. 92.
  57. 93.
  58. 94.
  59. 95.

    a b

  60. 96.
  61. 97.
  62. 98.
  63. 99.
  64. 100.
  65. 101.

    or

  66. 102.
  67. 103.
  68. 105.

    a

  69. 107.
  70. 110.
  71. 111.

    b c

  72. 114.
  73. 117.
  74. 141.
  75. 142.