Day 24, April 17, 2008, v1.0Item #30. A sample homework solution for a turing machine (tm) problem.I was going to do this one on the whiteboard today, but in our discussion of other issues I didn’t getthis far. It’s just as well, since carefully documenting this example is worthwhile, since your text §9.3 leavesa lot for you. In class we got this far: To implement the function g(n, m) = n * m, it would be wise first tosolve the “copying a string” problem. You were pretty sure that you could do that, but I’m going to present asolution anyway. Notice that outside sources are documented.Notice that because tm’s have so manyoptions, I had to spell out the options I’m using.Then to do multiplication, I would uses this solution as asubroutine (“building block” as the JFLAP documentation terms it). Unfortunately, as of JFLAP 6.2, I can’tuse ~in input, so I might represent the input pair (n, m) by 1111#11111, for example, separating thearguments by a special character in E, like this octothorpe (#).
This is the end of the preview.
access the rest of the document.