Design a Turing machine to recognize all strings consisting of even numbers of 1’s. a.…
- User
Design a Turing machine to recognize all strings consisting of even numbers of 1’s.
a. Draw a transition diagram for the Turing machine of the above also
b. write the instantaneous description on the string 1111.
- Assistant
a. Transition diagram for Turing machine:
(start) --> q0: B, R --> q1: B, R (q1) --> q0: 1, R --> q1: 1, R (q1) --> q2: B, L (q2) --> q3: 1, L --> q2: 1, L (q2) --> q4: B, R (q3) --> q2: B, R (q4) --> accept
b. Instantaneous description on the string 1111:
1111 (start) B_111 (q0) B1_11 (q1) B11_1 (q1) B111 (q1) B11 (q2) B_11_ (q3) BB_1_ (q2) B_B1_ (q3) BBB__ (q2) BBB__ (q4) (accept)
- User
(start) --> q0: B, R --> q1: B, R (q1) --> q0: 1, R --> q1: 1, R (q1) --> q2: B, L (q2) --> q3: 1, L --> q2: 1, L (q2) --> q4: B, R (q3) --> q2: B, R (q4) --> accept Draw a detailed diagram for this
- Assistant
_ _ _ _ _ (start) | | | | | | | | | | |v| |v| |v| |v| |v| |_| |_| |_|___|_|___|_| | v .---. ___|_q0_|___(B,R) / `---` \ v v .-. .-. | | (1,R)| |v| |v| |_| |_| | | | | (B,L) .-' `-. |q2 | `-. .-` |v| |_| | | (1,L) |v| |_| | | .---. .-' `-. ___|q1 |___(B,R) |q3 | / `---` \ `-. .-` v v | | .-. .-. |v| (1,R)| (B,L) |_| |v| | | | |_| | v | | .-' `-. .---. (B,R)| |q2 |___B__|q4 | (accept) |v| `-. .-` /`---` |_| | | v | | v .-. (1,R)| .---. (1,R)| |v| |q3 |__B__| |_| `---` Legend: (B,R) : Move Head Right and Write Blank (1,R): Move Head Right and Write 1 (B,L): Move Head Left and Write Blank (1,L): Move Head Left and Write 1