1 / 38

Turing Machine accepting { zz | z ∈ {a, b}∗}

Turing Machine accepting { zz | z ∈ {a, b}∗} . Tracing strings aabb & bb by Brian Morales. let’s trace this TM on the string aabb to show rejection. Begin from the initial configuration:. q 0 ∆ aabb. ∆/∆, R  input symbol is ∆ / replace it with ∆ and move the state to the right.

sook
Download Presentation

Turing Machine accepting { zz | z ∈ {a, b}∗}

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Turing Machine accepting{zz | z ∈ {a, b}∗} Tracing strings aabb & bb by Brian Morales

  2. let’s trace this TM on the string aabbto show rejection. Begin from the initial configuration: q0∆aabb

  3. ∆/∆, R  input symbol is ∆ / replace it with ∆ and move the state to the right q0∆aabb Ⱶ ∆q1aabb

  4. a/A, R  input symbol is a / replace it with A and move the state to the right q0∆aabb Ⱶ ∆q1aabb Ⱶ ∆Aq2abb

  5. a/a, R  input symbol is a / replace it with aand move the state to the right q0∆aabb Ⱶ ∆q1aabb Ⱶ ∆Aq2abb Ⱶ ∆Aaq2bb

  6. b/b, R  input symbol is b / replace it with b and move the state to the right q0∆aabb Ⱶ ∆q1aabb Ⱶ ∆Aq2abb Ⱶ ∆Aaq2bb Ⱶ ∆Aabq2b

  7. b/b, R  input symbol is b / replace it with b and move the state to the right q0∆aabb Ⱶ ∆q1aabb Ⱶ ∆Aq2abb Ⱶ ∆Aaq2bb Ⱶ ∆Aabq2b Ⱶ ∆Aabbq2∆

  8. ∆/∆, L input symbol is ∆ / replace it with ∆ and move the state to the left q0∆aabb Ⱶ ∆q1aabb Ⱶ ∆Aq2abb Ⱶ ∆Aaq2bb Ⱶ ∆Aabq2b Ⱶ ∆Aabbq2∆ Ⱶ ∆Aabq3b

  9. b/B, L input symbol is b / replace it with Band move the state to the left q0∆aabb Ⱶ ∆q1aabb Ⱶ ∆Aq2abb Ⱶ ∆Aaq2bb Ⱶ ∆Aabq2b Ⱶ ∆Aabbq2∆ Ⱶ ∆Aabq3b Ⱶ ∆Aaq4bB

  10. b/b, L input symbol is b / replace it with b and move the state to the left q0∆aabb Ⱶ ∆q1aabb Ⱶ ∆Aq2abb Ⱶ ∆Aaq2bb Ⱶ ∆Aabq2b Ⱶ ∆Aabbq2∆ Ⱶ ∆Aabq3b Ⱶ ∆Aaq4bB Ⱶ ∆Aq4abB

  11. a/a, L input symbol is a / replace it with aand move the state to the left q0∆aabb Ⱶ ∆q1aabb Ⱶ ∆Aq2abb Ⱶ ∆Aaq2bb Ⱶ ∆Aabq2b Ⱶ ∆Aabbq2∆ Ⱶ ∆Aabq3b Ⱶ ∆Aaq4bB Ⱶ ∆Aq4abB Ⱶ ∆q4AabB

  12. A/A, R  input symbol is A / replace it with A and move the state to the right q0∆aabb Ⱶ ∆q1aabb Ⱶ ∆Aq2abb Ⱶ ∆Aaq2bb Ⱶ ∆Aabq2b Ⱶ ∆Aabbq2∆ Ⱶ ∆Aabq3b Ⱶ ∆Aaq4bB Ⱶ ∆Aq4abB Ⱶ ∆q4AabB Ⱶ ∆Aq1abB

  13. a/A, R  input symbol is a / replace it with A and move the state to the right q0∆aabb Ⱶ ∆q1aabb Ⱶ ∆Aq2abb Ⱶ ∆Aaq2bb Ⱶ ∆Aabq2b Ⱶ ∆Aabbq2∆ Ⱶ ∆Aabq3b Ⱶ ∆Aaq4bB Ⱶ ∆Aq4abB Ⱶ ∆q4AabB Ⱶ ∆Aq1abB Ⱶ ∆AAq2bB

  14. b/b, R  input symbol is b / replace it with b and move the state to the right q0∆aabb Ⱶ ∆q1aabb Ⱶ ∆Aq2abb Ⱶ ∆Aaq2bb Ⱶ ∆Aabq2b Ⱶ ∆Aabbq2∆ Ⱶ ∆Aabq3b Ⱶ ∆Aaq4bB Ⱶ ∆Aq4abB Ⱶ ∆q4AabB Ⱶ ∆Aq1abB Ⱶ ∆AAq2bB Ⱶ ∆AAbq2B

  15. B/B, L  input symbol is B / replace it with B and move the state to the left q0∆aabb Ⱶ ∆q1aabb Ⱶ ∆Aq2abb Ⱶ ∆Aaq2bb Ⱶ ∆Aabq2b Ⱶ ∆Aabbq2∆ Ⱶ ∆Aabq3b Ⱶ ∆Aaq4bB Ⱶ ∆Aq4abB Ⱶ ∆q4AabB Ⱶ ∆Aq1abB Ⱶ ∆AAq2bB Ⱶ ∆AAbq2B Ⱶ ∆AAq3bB

  16. b/B, L  input symbol is b / replace it with B and move the state to the left q0∆aabb Ⱶ ∆q1aabb Ⱶ ∆Aq2abb Ⱶ ∆Aaq2bb Ⱶ ∆Aabq2b Ⱶ ∆Aabbq2∆ Ⱶ ∆Aabq3b Ⱶ ∆Aaq4bB Ⱶ ∆Aq4abB Ⱶ ∆q4AabB Ⱶ ∆Aq1abB Ⱶ ∆AAq2bB Ⱶ ∆AAbq2B Ⱶ ∆AAq3bB Ⱶ ∆Aq4ABB

  17. A/A, R  input symbol is A / replace it with A and move the state to the right q0∆aabb Ⱶ ∆q1aabb Ⱶ ∆Aq2abb Ⱶ ∆Aaq2bb Ⱶ ∆Aabq2b Ⱶ ∆Aabbq2∆ Ⱶ ∆Aabq3b Ⱶ ∆Aaq4bB Ⱶ ∆Aq4abB Ⱶ ∆q4AabB Ⱶ ∆Aq1abB Ⱶ ∆AAq2bB Ⱶ ∆AAbq2B Ⱶ ∆AAq3bB Ⱶ ∆Aq4ABB Ⱶ ∆AAq1BB

  18. B/B, L input symbol is B / replace it with Band move the state to the left q0∆aabb Ⱶ ∆q1aabb Ⱶ ∆Aq2abb Ⱶ ∆Aaq2bb Ⱶ ∆Aabq2b Ⱶ ∆Aabbq2∆ Ⱶ ∆Aabq3b Ⱶ ∆Aaq4bB Ⱶ ∆Aq4abB Ⱶ ∆q4AabB Ⱶ ∆Aq1abB Ⱶ ∆AAq2bB Ⱶ ∆AAbq2B Ⱶ ∆AAq3bB Ⱶ ∆Aq4ABB Ⱶ ∆AAq1BB Ⱶ ∆Aq5ABB

  19. A/a, L input symbol is A / replace it with a and move the state to the left q0∆aabb Ⱶ ∆q1aabb Ⱶ ∆Aq2abb Ⱶ ∆Aaq2bb Ⱶ ∆Aabq2b Ⱶ ∆Aabbq2∆ Ⱶ ∆Aabq3b Ⱶ ∆Aaq4bB Ⱶ ∆Aq4abB Ⱶ ∆q4AabB Ⱶ ∆Aq1abB Ⱶ ∆AAq2bB Ⱶ ∆AAbq2B Ⱶ ∆AAq3bB Ⱶ ∆Aq4ABB Ⱶ ∆AAq1BB Ⱶ ∆Aq5ABB Ⱶ ∆q5AaBB

  20. A/a, L input symbol is A / replace it with a and move the state to the left q0∆aabb Ⱶ ∆q1aabb Ⱶ ∆Aq2abb Ⱶ ∆Aaq2bb Ⱶ ∆Aabq2b Ⱶ ∆Aabbq2∆ Ⱶ ∆Aabq3b Ⱶ ∆Aaq4bB Ⱶ ∆Aq4abB Ⱶ ∆q4AabB Ⱶ ∆Aq1abB Ⱶ ∆AAq2bB Ⱶ ∆AAbq2B Ⱶ ∆AAq3bB Ⱶ ∆Aq4ABB Ⱶ ∆AAq1BB Ⱶ ∆Aq5ABB Ⱶ ∆q5AaBB Ⱶ q5∆aaBB

  21. ∆/∆, R  input symbol is ∆ / replace it with ∆ and move the state to the right q0∆aabb Ⱶ ∆q1aabb Ⱶ ∆Aq2abb Ⱶ ∆Aaq2bb Ⱶ ∆Aabq2b Ⱶ ∆Aabbq2∆ Ⱶ ∆Aabq3b Ⱶ ∆Aaq4bB Ⱶ ∆Aq4abB Ⱶ ∆q4AabB Ⱶ ∆Aq1abB Ⱶ ∆AAq2bB Ⱶ ∆AAbq2B Ⱶ ∆AAq3bB Ⱶ ∆Aq4ABB Ⱶ ∆AAq1BB Ⱶ ∆Aq5ABB Ⱶ ∆q5AaBB Ⱶ q5∆aaBB Ⱶ ∆q6aaBB

  22. a/A, R  input symbol is a / replace it with A and move the state to the right q0∆aabb Ⱶ ∆q1aabb Ⱶ ∆Aq2abb Ⱶ ∆Aaq2bb Ⱶ ∆Aabq2b Ⱶ ∆Aabbq2∆ Ⱶ ∆Aabq3b Ⱶ ∆Aaq4bB Ⱶ ∆Aq4abB Ⱶ ∆q4AabB Ⱶ ∆Aq1abB Ⱶ ∆AAq2bB Ⱶ ∆AAbq2B Ⱶ ∆AAq3bB Ⱶ ∆Aq4ABB Ⱶ ∆AAq1BB Ⱶ ∆Aq5ABB Ⱶ ∆q5AaBB Ⱶ q5∆aaBB Ⱶ ∆q6aaBB Ⱶ ∆Aq8aBB

  23. a/a, R  input symbol is a / replace it with aand move the state to the right q0∆aabb Ⱶ ∆q1aabb Ⱶ ∆Aq2abb Ⱶ ∆Aaq2bb Ⱶ ∆Aabq2b Ⱶ ∆Aabbq2∆ Ⱶ ∆Aabq3b Ⱶ ∆Aaq4bB Ⱶ ∆Aq4abB Ⱶ ∆q4AabB Ⱶ ∆Aq1abB Ⱶ ∆AAq2bB Ⱶ ∆AAbq2B Ⱶ ∆AAq3bB Ⱶ ∆Aq4ABB Ⱶ ∆AAq1BB Ⱶ ∆Aq5ABB Ⱶ ∆q5AaBB Ⱶ q5∆aaBB Ⱶ ∆q6aaBB Ⱶ ∆Aq8aBB Ⱶ ∆Aaq8BB

  24. There is nowhere to go from q8 with input B, therefore the string aabb is rejected by this TM q0∆aabb Ⱶ ∆q1aabb Ⱶ ∆Aq2abb Ⱶ ∆Aaq2bb Ⱶ ∆Aabq2b Ⱶ ∆Aabbq2∆ Ⱶ ∆Aabq3b Ⱶ ∆Aaq4bB Ⱶ ∆Aq4abB Ⱶ ∆q4AabB Ⱶ ∆Aq1abB Ⱶ ∆AAq2bB Ⱶ ∆AAbq2B Ⱶ ∆AAq3bB Ⱶ ∆Aq4ABB Ⱶ ∆AAq1BB Ⱶ ∆Aq5ABB Ⱶ ∆q5AaBB Ⱶ q5∆aaBB Ⱶ ∆q6aaBB Ⱶ ∆Aq8aBB Ⱶ ∆Aaq8BB Ⱶ ∆AahrBB(reject) Accept only if state ha is reached!

  25. let’s trace this TM on the string bb to show acceptance. Begin from the initial configuration: q0∆bb

  26. ∆/∆, R  input symbol is ∆ / replace it with ∆ and move the state to the right q0∆bb Ⱶ ∆q1bb

  27. b/B, R  input symbol is b / replace it with B and move the state to the right q0∆bb Ⱶ ∆q1bb Ⱶ ∆Bq2b

  28. b/b, R  input symbol is b / replace it with b and move the state to the right q0∆bb Ⱶ ∆q1bb Ⱶ ∆Bq2b Ⱶ ∆Bbq2∆

  29. ∆ / ∆, L  input symbol is ∆ / replace it with ∆ and move the state to the left q0∆bb Ⱶ ∆q1bb Ⱶ ∆Bq2b Ⱶ ∆Bbq2∆ Ⱶ ∆Bq3b

  30. b / B, L  input symbol is b / replace it with B and move the state to the left q0∆bb Ⱶ ∆q1bb Ⱶ ∆Bq2b Ⱶ ∆Bbq2∆ Ⱶ ∆Bq3b Ⱶ ∆q4BB

  31. B / B, R  input symbol is B / replace it with B and move the state to the right q0∆bb Ⱶ ∆q1bb Ⱶ ∆Bq2b Ⱶ ∆Bbq2∆ Ⱶ ∆Bq3b Ⱶ ∆q4BB Ⱶ ∆Bq1B

  32. B / B, L  input symbol is B / replace it with B and move the state to the left q0∆bb Ⱶ ∆q1bb Ⱶ ∆Bq2b Ⱶ ∆Bbq2∆ Ⱶ ∆Bq3b Ⱶ ∆q4BB Ⱶ ∆Bq1B Ⱶ ∆q5BB

  33. B / b, L  input symbol is B / replace it with b and move the state to the left q0∆bb Ⱶ ∆q1bb Ⱶ ∆Bq2b Ⱶ ∆Bbq2∆ Ⱶ ∆Bq3b Ⱶ ∆q4BB Ⱶ ∆Bq1B Ⱶ ∆q5BB Ⱶ q5∆bB

  34. ∆ / ∆, R  input symbol is ∆ / replace it with∆and move the state to the right q0∆bb Ⱶ ∆q1bb Ⱶ ∆Bq2b Ⱶ ∆Bbq2∆ Ⱶ ∆Bq3b Ⱶ ∆q4BB Ⱶ ∆Bq1B Ⱶ ∆q5BB Ⱶ q5∆bB Ⱶ ∆q6bB

  35. b / B, R  input symbol is b / replace it withBand move the state to the right q0∆bb Ⱶ ∆q1bb Ⱶ ∆Bq2b Ⱶ ∆Bbq2∆ Ⱶ ∆Bq3b Ⱶ ∆q4BB Ⱶ ∆Bq1B Ⱶ ∆q5BB Ⱶ q5∆bB Ⱶ ∆q6bB Ⱶ ∆Bq7B

  36. B / ∆, L  input symbol is B / replace it with∆and move the state to the left q0∆bb Ⱶ ∆q1bb Ⱶ ∆Bq2b Ⱶ ∆Bbq2∆ Ⱶ ∆Bq3b Ⱶ ∆q4BB Ⱶ ∆Bq1B Ⱶ ∆q5BB Ⱶ q5∆bB Ⱶ ∆q6bB Ⱶ ∆Bq7B Ⱶ ∆q9B

  37. B / B, R  input symbol is B / replace it withBand move the state to the right q0∆bb Ⱶ ∆q1bb Ⱶ ∆Bq2b Ⱶ ∆Bbq2∆ Ⱶ ∆Bq3b Ⱶ ∆q4BB Ⱶ ∆Bq1B Ⱶ ∆q5BB Ⱶ q5∆bB Ⱶ ∆q6bB Ⱶ ∆Bq7B Ⱶ ∆q9B Ⱶ ∆Bq6∆

  38. ∆ / ∆, S  input symbol is ∆ / replace it with∆and halt. String bb is accepted by this TM q0∆bb Ⱶ ∆q1bb Ⱶ ∆Bq2b Ⱶ ∆Bbq2∆ Ⱶ ∆Bq3b Ⱶ ∆q4BB Ⱶ ∆Bq1B Ⱶ ∆q5BB Ⱶ q5∆bB Ⱶ ∆q6bB Ⱶ ∆Bq7B Ⱶ ∆q9B Ⱶ ∆Bq6∆ Ⱶ ∆Bha∆ (accept)

More Related