4. (15 points) Give a one-tape Turing machine that, given input x E {a,b,#)’, behaves as follows: . If the input is in the form #w# such that w E {a, b)”, the machine changes each occurrence of a in w with a b and each occurrence of b in w with an a, and enters qacc. . If the input is not in the form #w# such that w E {a,b}*,
OR
OR