find f(x) = x(mod 5). Namely, find the remainder of x after division by 5. Method: Delete 1's keeping count of how many until 5 have been deleted. Repeat this until you run out of 1's. Then from the count you know how many to return to the tape. Final state = {9}. ------------------------------------------------- Count 5 1's. state number tells how many have been counted (01 1r State 0: have counted a multiple of 5 1's (11 2r (21 3r (31 4r (41 0r --------------- Ran out of 1's. Now put back the right amount. (0 5l No 1's to put back. State 5: go back to front of tape. (1 10r (2 11r (3 12r (4 13r four 1's to write back. --------------- Go to front of string.... (5115l (5 9r