Question: Consider the following function which returns the number of a s in the input string modulo 4 : f ( x ) = n _
Consider the following function which returns the number of as in the input string modulo :
fxna x mod
For example, the following is the result for some possible inputs:
fababaabbbbna ababaabbbb mod mod
fbabababna bababab mod mod
Assume that we are using a unary numbering system, where is represented by a blank.
Problem: Show that the function fx for x in ab is Turing computable.
Hint: You can build this Turing machine in a modular approach, by building a machine that will take an input from the domain with as and bs and count how many as exist. The next machine will take this output as input and calculate the modulo of this integer number. You link the two machines by making the first machines TM final state the second machines TM initial state. This is basically how modular programming works, by breaking down a long program into functions that use each others output successively.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
