{w in (a|b|c)* | no of a's > no of b's} please write a TM. Give 2 strings one that satisfies and another string that rejects the turing machine
ANSWER:
NOTE: Please refer to the attached image for the answer.
NOTE:
1. | qo is the initial state and qf is the final state. |
2. | R, L denotes movement to the right side and left side respectively in input tape. |
3. | denotes auxiliary symbol which denotes the processed symbol in the input string. |
4. | B denotes the blank symbol in the infinite input tape. |
SAMPLE I/O:
String | Result | Explanation | |
1. | aaabbaabbb | Not accepted | Number of a's and b's are equal in the given string |
2. | ababababbbaaa | Accepted | Number of a's is greater than number of b's in the given string |
Get Answers For Free
Most questions answered within 1 hours.