Question

In: Computer Science

Devise a Turing machine to check the correct nesting of brackets (parentheses). So, your machine should...

Devise a Turing machine to check the correct nesting of brackets (parentheses). So, your machine should start with a tape with something like (()()(())) on it and halt with T printed on the tape, and it should start with something like (()()(() on the tape and halt with F. That is, correctly nested strings of brackets should give T, and wrongly nested strings of brackets should give the answer F. This example is important since it shows that Turing machines can do more than finite-state machines (they can’t check for bracket balancing of arbitrary depth), and also that they are not only good for arithmetic (binary manipulation) but they can do symbolic computations too.

a) Why can a Turing Machine do the bracket checking but a Finite State Machine cannot?

Solutions

Expert Solution

Why can a Turing Machine do the bracket checking but a Finite State Machine cannot?

A finite-state machine is a restricted Turing machine where the head can only perform "read" operations, and always moves from left to right. Because finite states machines are limited in the sense that they have no memory, a FSM that accepts L can't be constructed. Finite state machines describe a small class of languages where no memory is needed. Turing Machines are the mathematical description of a computer and accept a much larger class of languages than FSMs do. Turing Machines have has more computational power than FSM. There are tasks which no FSM can do, but which Turing Machines can do.

First of all, a (deterministic) finite state machine MM is a 5-tuple (Q,Σ,δ,q0,F)(Q,Σ,δ,q0,F).

QQ is a set of states

ΣΣ is the input alphabet

δδ is the transition function, δ:Q×Σ→Qδ:Q×Σ→Q. This is what tells you what new state you go to when you are in particular state and see a particular symbol.

q0∈Qq0∈Q is the start state.

F⊆QF⊆Q is the set of accepting states.

Now, the basic way this works is you read the input string left to right in one pass. When you see a symbol, you move to a new state based on the transition function. If when you finish reading the string, you’re in an accepting state, you accept the string, otherwise, you reject it. The set of languages that finite state machines accept is the set of regular languages.

A (deterministic) Turing machine M is a 6-tuple (Q,Σ,δ,q0,qaccept,qreject)(Q,Σ,δ,q0,qaccept,qreject) where

QQ is the set of states

ΣΣ is the tape alphabet. This includes the input symbols, symbols you can write on the tape, and the blank symbol.

δ:Q×Σ→Q×Σ×{left,right}δ:Q×Σ→Q×Σ×{left,right} is the transition function. This means that when you’re in a state and see a symbol, you go to another state, write something on the tape, and go to the left or right on the tape.

q0,qaccept,qreject∈Qq0,qaccept,qreject∈Qare the start state, the accepting state and the rejecting state respectively.

The way a Turing machine works is you have an infinitely long tape. When you start the machine, it has its input written on a portion of the tape with trailing blanks. The machine can read a symbol and write a new symbol and go back and forth on the tape as often as it wants. We believe that any computable language can be decided by a Turing machine.


Related Solutions

State Machines Your state machine should decode the following serial bit patterns in the correct order,...
State Machines Your state machine should decode the following serial bit patterns in the correct order, with one bit per clock cycle. State Machine: 110110 Please do a.    A state diagram b.    An explanation of your design process. Be sure to include a reset or idle state c.    The state machine description d.    Your state assignments e.    Your next state table
YOU GUYS PROVIDE ME THE WRONG ANSWER SO I NEED THE CORRECT ANS Check my work...
YOU GUYS PROVIDE ME THE WRONG ANSWER SO I NEED THE CORRECT ANS Check my work Check My Work button is now enabledItem 4 Item 4 30 points A private not-for-profit entity is working to create a cure for a deadly disease. The charity starts the year with cash of $775,000. Of this amount, unrestricted net assets total $425,000, temporarily restricted net assets total $225,000, and permanently restricted net assets total $125,000. Within the temporarily restricted net assets, the entity...
a. Calculate the electron density (your unit should be correct) for a CNT at T =...
a. Calculate the electron density (your unit should be correct) for a CNT at T = 0K. Assume that the Fermi level is at Ef = 1eV and the bottom of the conduction band is at Ec = 0.8eV. Use 1D density of states (DOS). Electron effective mass = 0.5m0 b. Will your result change if the Fermi level is at Ef = 0.8eV and the bottom of the conduction band is at Ec = 0.6eV.
True or False: -Before performing Regression, you should check that your data is normally distributed. -If...
True or False: -Before performing Regression, you should check that your data is normally distributed. -If the data (and the residuals) are normally distributed, the residuals scatterplot will show the majority of residuals at the center of the plot for each value of the predicted score, with some residuals trailing off symmetrically from the center. -You can test for linearity between an Independent Variable and the Dependent Variable by looking at a bivariate scatterplot. -You can check homoscedasticity by looking...
You should assume this is a fairly permanent job, so do your best to imagine your...
You should assume this is a fairly permanent job, so do your best to imagine your real decision-making process. On the horizontal axis is (for this question, use “quantity of hours per week” from zero to 100) and on the vertical axis, each wage (for this question, use “annual salary” from zero to $200,000 in increments of $10,000) . Estimate your actual labor supply curve for each salary point from $10,000 to $200,000 in increments of $10,000. Explain three events...
Determine if the finite correction factor should be used. If​ so, use it in your calculations...
Determine if the finite correction factor should be used. If​ so, use it in your calculations when you find the probability. In a sample of 700 gas​ stations, the mean price for regular gasoline at the pump was $ 2.818 per gallon and the standard deviation was ​$0.008 per gallon. A random sample of size 60 is drawn from this population. What is the probability that the mean price per gallon is less than ​$2.816​? The probability that the mean...
Determine if the finite correction factor should be used. If​ so, use it in your calculations...
Determine if the finite correction factor should be used. If​ so, use it in your calculations when you find the probability. In a sample of 900 gas​ stations, the mean price for regular gasoline at the pump was $ 2.873 per gallon and the standard deviation was ​$0.009 per gallon. A random sample of size 50 is drawn from this population. What is the probability that the mean price per gallon is less than ​$2.869​? The probability that the mean...
Choose the correct response. What should be your response to 737 respondents to a USA Today...
Choose the correct response. What should be your response to 737 respondents to a USA Today poll question on its Web site in which 92% said they do not open unfamiliar e-mail or instant message links?  Use a 0.01 significance level to test the claim that more than75% of us do not open unfamiliar messages.   Since the test statistic (zcal) of 10.65 is greater than the critical value of 2.33 we would reject the null hypothesis and fully support the claim...
What is your opinion regarding our antitrust laws? should they even exist?If so,what should the threshold...
What is your opinion regarding our antitrust laws? should they even exist?If so,what should the threshold be?Size/structure alone?Or is a rule of reason more appropriate?
Should Governments always intervene to correct market failures? Justify and explain your answer, with reference to...
Should Governments always intervene to correct market failures? Justify and explain your answer, with reference to two types of market failure. (500 words minimum)
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT