Search for question
Question

1. (extra credit points for the minimal correct solution. Submit your

solution as a .jff file) The input to TM M is n1$n2, where n1 and n2 are strings of

1's and O's. If either n 1 or n2 starts with a 0, the output is n12n2; if n1 = n2, the

output is n1=n2; when n1 and n2 are interpreted as the binary numbers m1 and m2

respectively, the output is n1n2 if m1 > m2. A correct

implementation of M will have the transducer results below for the inputs in

test cases.txt, included with the test materials.

Input

1$1

10110$10110

1$10

1$11

10$11

101$110

10$1

11$1

101$100

1$01111

100$0

0001111$1

0$100

Output

1=1

10110=10110

1<10

1<11

10<11

101<110

10>1

11>1

101>100

1701111

100?0

0001111?1

0?100

Result

Accept

Accept

Accept

Accept

Accept

Accept

Accept

Accept

Accept

Accept

Accept

Accept

Accept

The file final.jff, also included with the test materials, encodes a partial

implementation of M. It handles n1 = n2 correctly, as well as some, but not all, of

the cases where m1 < m2, or m1 > m2. It does not handle cases where n1 or n2

starts with a 0.

Enhance final.jff to implement M. To run the test cases in transducer mode, select

Multiple Run (Transducer) from the Input menu, and then select Load Inputs from

the buttons at the bottom of the right panel.

Fig: 1