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 4:
f(x)=n_a (x) mod 3
For example, the following is the result for some possible inputs:
f(ababaabbbb)=n_a (ababaabbbb) mod 3=4 mod 3=1
f(bababab)=n_a (bababab) mod 3=3 mod 3=0
Assume that we are using a unary numbering system, where 0 is represented by a blank.
Problem: Show that the function f(x) for x in {a,b}^+ 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 (TM1) final state the second machines (TM2) 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!