{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Day24 - Day 24 v1.0 Item#30 A sample homework solution for...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Day 24, April 17, 2008, v1.0 Item #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 get this far. It’s just as well, since carefully documenting this example is worthwhile, since your text §9.3 leaves a lot for you. In class we got this far: To implement the function g(n, m) = n * m, it would be wise first to solve the “copying a string” problem. You were pretty sure that you could do that, but I’m going to present a solution anyway. Notice that outside sources are documented. Notice that because tm’s have so many options, I had to spell out the options I’m using. Then to do multiplication, I would uses this solution as a subroutine (“building block” as the JFLAP documentation terms it). Unfortunately, as of JFLAP 6.2, I can’t use ~ in input, so I might represent the input pair (n, m) by 1111#11111, for example, separating the arguments by a special character in E , like this octothorpe (#).
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Ask a homework question - tutors are online