1- Design the following Turing Machines
A) Consider a scenario where the machine begins on a tape containing a sequence of alternating symbols, represented by (as and (bs. The machine initiates on the leftmost end of this sequence. The task for the Turing machine is to reverse the sequence without altering the individual (as and (bs. For instance, when the input sequence is "abababba", the output should reflect "babbabab". Provide a step-by-step description of the Turing machine's actions to accomplish this task.
B) Assume the machine starts on a tape with a series of binary digits (0s and 1s) and begins at the leftmost end of this sequence. The machine's objective is to count the number of 1s in the sequence and replace each 1 with the total count of 1s in binary representation, while leaving the 0s unchanged. For example, if the input sequence is "11011011", the tape should be altered to read "10101010". Provide a detailed description of the actions and states of the Turing machine to accomplish this task.
C) Assume the machine starts on a tape with a series of symbols, consisting of alphabetic characters 'X' and 'Y'. The machine is initiated at the leftmost end of this sequence. The task for the Turing machine is to count the total occurrences of the symbol 'X' and mark the count at the end of the sequence using the symbol 'Z'. For example, if the input sequence is "XYXYXXY", the output should display "XYXYXXYZZZ". Provide a detailed description of the Turing machine's states and transitions to accomplish this counting task.
2- Design Pushdown Automata (PDA) that recognizes the following languages. Provide both a visual representation and a 6-tuple specification for each PDA. Show your step-by-step construction.
A) L={w{0,1}*|w contains an even number of 0s or an odd number of 1s}
B) L={0^m1^n| m not-equal n and m,n>0}