Question

create a deterministic turing machine which takes two words w1, w2 ∈ {a, b, c, d}*...

create a deterministic turing machine which takes two words w1, w2 ∈ {a, b, c, d}* , separated by a # symbol in the form Bw1#w2B and determines whether string w2 is a substring of w1

Homework Answers

Answer #1

To explain this we have taken a string composed of only a,b and rest alphabets are not appear as it is given any combination of the alphabet will be accepted by the Turing machine. The figure below shows the example.

In the figure dotted lines means all the unused alphabets from { a,b,c,d}* are sent to the reject state. As we can see that w2 must be a substring of w1 , otherwise the letter # will not be paired and finally the string will be rejected. In other words,the length of w2 must be less than the length of w1.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Assume that we have training data for texts with two words, w1 and w2, with two...
Assume that we have training data for texts with two words, w1 and w2, with two classes C1 and C2. From the training data we have estimated: P(w1|C1) = a1, P(w2|C1) = b1, P(C1) = c1 P(w1|C2) = a2, P(w2|C2) = b2, and P(C2) = c2 Given a document D with words {w1,w2,w1}, what is the formula giving the log-odds-ratio of the probability that document is classed as C1 to the probability that document is classed as C2 using the...
Write a Turing-machine style of algorithm to decide the language L1 given below. Use specific, precise,...
Write a Turing-machine style of algorithm to decide the language L1 given below. Use specific, precise, step-by-step English. So, describe how to test whether or not an input string is in the language L1 in finite time. No need to write a state diagram. L1 = {w : every ‘a’ within w is to the left of every ‘b’ within w} over the following alphabet Σ = {a, b, c}. In other words, you’re not allowed to have any ‘b’...
1.Write a function which takes a string that contains two words separated by any amount of...
1.Write a function which takes a string that contains two words separated by any amount of whitespace, and returns a string in which the words are swapped around and the whitespace is preserved. Hint: use regular expressions where \s detects the whitespaces in a string. Example: given "Hello     World", return "World         Hello" 2.Pandas exercises: Write a python program using Pandas to create and display a one-dimensional array-like object containing an array of data. Write a python program using Pandas to...
1. A wire W1 of some resistance is connected to a batter with potential V, and...
1. A wire W1 of some resistance is connected to a batter with potential V, and dissipates a power P1. A second wire W2, twice as long as W1, is connected to the same battery, and dissipates a power P2 = 2P1. From this we can conclude: a) The wires must be made of the same material. b) The wires must have the same cross-sectional area. c) The resistance of W1 must be less than that of W2. 2. Two...
CREATE USING A STATE DIAGRAM Design a Candy Machine which takes Quarters, Dimes and Nickels for...
CREATE USING A STATE DIAGRAM Design a Candy Machine which takes Quarters, Dimes and Nickels for releasing a Candy which costs 40 cents and returns change. • Input: Q(Quarter), D(Dime),N(Nickel) • Output: Candy released Candy should be coming out of the machine after receiving an amount greater than or equal to 40 cents.
3. Create a program which allows the user to swap individual words in an input string....
3. Create a program which allows the user to swap individual words in an input string. Given a string of input, your program should count and store the number of words in a 2D array. The user can then select the index of the words they want to swap. Your program should swap those two words and then print the entire string to ouput. • Use string prompt "> ". • Use indices prompt "Enter two indices: ". • Remove...
A company is looking to purchase a machine based on two options Machine A Machine B...
A company is looking to purchase a machine based on two options Machine A Machine B Initial cost AED 60,000 90,000 Annual cost/year AED 10,000 4,000 Salvage Value AED 4,000 0 Useful life in years 3 3 Using an interest rate of 12%, answer the below questions.       -       A.       B.       C.       D.       E.       F.       G.       H.       I.       J....
A machine follow Carnot which is working between the temperatures TL = 45.9 0 C and...
A machine follow Carnot which is working between the temperatures TL = 45.9 0 C and TH = 698.7 0 C. The engine performs 1423 J of work each cycle which takes 0.32 sec. a. What is the efficiency of this machine? b. What is the average power of this machine? c. How much heat is extracted from the high-T reservoir each cycle? d. Explain the loss of power and how to optimize it?
A machine follow Carnot which is working between the temperatures TL = 45.9 0 C and...
A machine follow Carnot which is working between the temperatures TL = 45.9 0 C and TH = 698.7 0 C. The engine performs 1423 J of work each cycle which takes 0.32 sec. a. What is the efficiency of this machine? b. What is the average power of this machine? c. How much heat is extracted from the high-T reservoir each cycle? d. Explain the loss of power and how to optimize it?
Consider mini-alphabet made of just letters {a, b, c, d, e}. How many “words” (i.e., strings...
Consider mini-alphabet made of just letters {a, b, c, d, e}. How many “words” (i.e., strings of letters from that alphabet, whether they correspond to meaningful words or not) are there of length n, for n≥1 ? Use mathematical induction to prove your answer.