Question

In: Computer Science

Assume set of input alphabets = {a, b} If last digit = 0, 1, 2 OR...

Assume set of input alphabets = {a, b} If last digit = 0, 1, 2 OR 3 Solve the following Design and Turing Machine that Accepts only odd length palindromes and rejects all the remaining strings If last digit = 4, 5 OR 6 Solve the following Design and Turing Machine that Accepts only even length palindromes and rejects all the remaining strings If last digit = 7, 8 OR 9 Solve the following Design and Turing Machine that Accepts palindromes (both even and odd length) and rejects all the remaining strings

Solutions

Expert Solution

Construct a TM machinefor checking thepalindrome of the string ofodd length. Solution: Firstly we read the first symbol from left and then we compare it with the first symbol from right to check whether it is the same. Again we compare the second symbol from left withthe second symbol from right.

Firstly we read the first symbol from left and then we compare it with the first symbol from right to check whether it is the same.

Again we compare the second symbol from left with the second symbol from right. We repeat this process for all the symbols. If we found any symbol not matching, we lead the machine to HALT state.

Suppose the string is 00100Δ. The simulation for 00100Δ can be shown as follows:

Now, we will see how this Turing machine will work for 00100Δ. Initially, state is q0 and head points to 0 as:


Related Solutions

Program P1 1) integer A, B; 2) input (A); 3) while (A > 0) 4) {...
Program P1 1) integer A, B; 2) input (A); 3) while (A > 0) 4) { 5) B = 1; 6) if (A < 10) 7) B = 0; 8) if (A < 20 or A > 25) 9) B = A * B; 10) else 11) B = A + B; 12) output (A, B); 13) input (A); 14) } 15) output (“Program ends.”); 16) end; T = {t1=<1>, t2=<33>, t3=<‐1>} or T = {t1=, t2=, t3=} 1. What...
4. The check digit for ISBNs is one of the numbers 0, 1, 2, . ....
4. The check digit for ISBNs is one of the numbers 0, 1, 2, . . . , 9, or the letter X. One of the your fellow students comments ”Gee, it sure is a pain to have to use that X all time. Why don’t they just compute the check digit sum modulo 10 instead of modulo 11, so that we can get rid of the X?” Would this plan work? Prove your answer. Assume that all ISBNs are...
We will denote the last digit of your ASU ID as L (if L = 0,...
We will denote the last digit of your ASU ID as L (if L = 0, then use L = 4) Consider three processes of the form CPU P1: [CPU burst of length L;  I/O burst of length 4*L; CPU burst of length L] P2: [CPU of  2*L; I/O of 4*L; CPU of L; I/O of 2*L; CPU of 3*L] P3: [CPU of  L; I/O of L; CPU of 2*L; I/O of L; CPU of L] 1.) What is the average CPU utilization...
Matrix: Ax b [2 1 0 0 0 | 100] [1 1 -1 0 -1 |...
Matrix: Ax b [2 1 0 0 0 | 100] [1 1 -1 0 -1 | 0] [-1 0 1 0 1 | 50] [0 -1 0 1 1 | 120] [0 1 1 -1 1 | 0] Problem 5 Compute the solution to the original system of equations by transforming y into x, i.e., compute x = inv(U)y. Solution: %code I have not Idea how to do this. Please HELP!
Convolve the following two signals using the INPUT side algorithm. x[n]= 1, 0, 2, 0, 0,...
Convolve the following two signals using the INPUT side algorithm. x[n]= 1, 0, 2, 0, 0, 0, 2, 1, 0, 1 h[n]= 3, 2, 1 y[n]=?
Consider the set of integer numbers from 0 to 9, that is {0, 1, 2, 3,...
Consider the set of integer numbers from 0 to 9, that is {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}. Bob wishes to use these numbers to create a 7-digit password to secure his new laptop. Note that each number can appear in any position (for example, 0 can be the first number in the password). (a) Find the number of 7-digit passwords that are possible. (b) Find the number of 7-digit passwords with distinct digits. (c) Find...
(2) Let Z/nZ be the set of n elements {0, 1, 2, . . . ,...
(2) Let Z/nZ be the set of n elements {0, 1, 2, . . . , n ? 1} with addition and multiplication modulo n. (a) Which element of Z/5Z is the additive identity? Which element is the multiplicative identity? For each nonzero element of Z/5Z, write out its multiplicative inverse. (b) Prove that Z/nZ is a field if and only if n is a prime number. [Hint: first work out why it’s not a field when n isn’t prime....
What's the P value for this data set? Digit   Probability   Frequency 1   0.301   42 2   0.176  ...
What's the P value for this data set? Digit   Probability   Frequency 1   0.301   42 2   0.176   25 3   0.125   28 4   0.097   26 5   0.079   23 6   0.067   36 7   0.058   15 8   0.051   17 9   0.046   9
Consider four-digit numbers that consist of 0, 1, 2, 5, 6, and 9. a) How many...
Consider four-digit numbers that consist of 0, 1, 2, 5, 6, and 9. a) How many four-digit numbers can be formed from the digits 0, 1, 2, 5, 6, and 9 if each digit can be used only once? (the four-digit numbers can't start with 0). b) How many of those four-digit numbers are even? c) How many are greater than 2200?
for square matrices A and B show that [A,B]=0 then [A^2,B]=0
for square matrices A and B show that [A,B]=0 then [A^2,B]=0
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT