Construct a pda accepting

Assignment Help Theory of Computation
Reference no: EM131306379

1. Let S->aB|bA,A->aS|bAA|a,B->bS|aBB|b. Derive the string aaabbabbba as left most derivation.

2. Construct a PDA accepting {anb2n; n>=1} by final state.

3. Construct PDA for the grammar
S->aB|bA,A->a|aS|bAA
B->b|bS|aBB
B->b|bS|aBB
Check for the validation of string ab.

4. Give the parse tree construction of 1001 ad +*-xyxy for the given grammars.
1)S->A|B
A->0A|^
B->0B|1B|^
Parse tree for 1001

5. Construct aPDA for the given grammar and check for the validation of abcba and acb.
S->aSa|bSb|c
6. Show that the grammar S->a|Sa|bSS|SSb|SbS is ambiguous

7. Construct a PDA for the given grammar and check for the validation of aa*a0 and (a0+a).
E->I|E+E|E*E|(E),I->a|Ia|0|I0

7 Find a derivation tree of a*b+a*b given that a*b+a*b is in L(G) where g is given by
S->S+S|S*S, S->a/b

8) Show that the grammar S->a/abSb/aAb, A->bS/aAAb is ambiguous . (6marks)

9) Consider the following productions
S->aB|bA
A->aS|bAA|a
B->bS|aBB|b
for the string aaabbabbba find a leftmost derivation.

10) Construct a PDA accepting by empty stack the language {ambncn/m,n>=1}

11)Convert the PDA P=({p,q},{0,1},{x,z0}, δ,q,z0) where:

1. δ(q,1,z0)={(q,xz0)}
2. δ(q,ε,z0)={(q,ε)}
3. δ(q,1,x)={(q,xX)}
4. δ(q,0,x)={(p,x)}
5. δ(q,ε,x)=(q,ε)
6. δ(p,1,x)=(p,ε)
7. δ(p,0,z0¬)=(q,z0)
12) Convert the PDA P=({p,q},{0,1},{x,z0}, δ,q,z0) where:
1. δ[q 0 z0]={(q,x,z0)}
2. δ[q 0 x]={(q,x,x)}
3. δ[q 1 x]={(q,x)}
4. δ[q ε z0]={(q,ε)}
5. δ[p ε x]={(p,ε)}
6. δ[p 1 x]={(p,x,x)}
7. δ[p 1 z0]={(p,ε)}
Soln:
1. δ[q 0 z0]={(q,x,z0)}
At q: [q z0 q]->0[q x q][q z0q]
[q z0 q]->0[p x p][p z0q]
At p: [q z0 p]->0[q x q][q z0 p]
[q z0 p]->0[q x p][p z0 p]
2. δ[q 0 x]={(q,x,x)}
At q: [q x q]->0[q x q][q x q]
[q x q]->0[q x p][p x q]
At p: [q x p]->0[q x q][q x p]
[q x p]->0[q x p][p x p]
3. δ[q 1 x]={(q,x)}
At q:[q x q]->1[q x q]
At p:[q x p]->1[q x p]
4. δ[q ε z0]={(q,ε)}
[q x q]->ε
5. δ[p ε x]={(p,ε)}
[p x p]->ε
6. δ[p 1 x]={(p,x,x)}
At q: [p x q]->1[p x q][q xq]
[p x q]->1[p x p][p xq]
At p: [p x p]->1[p x q][q xp]
[p x p]->1[p x p][p xp]
7. [p 1 z0]={(p,ε)}
[p z0 p]->1

Reference no: EM131306379

Questions Cloud

Draw the budget constraint : PAF 3102 - Economic Analysis of Public Policy Problem Set. Draw the budget constraint if the family is given a TANF grant of $1200 a month and prices and other income are the same as in part A. There is no restriction on how TANF grants may be spen..
What are two possible hedge ratios at end of first period : Consider a two-period, two-state world. Let the current stock price be 45 and the risk-free rate be 5 percent. Each period the stock price can go either up by 10 percent or down by 10 percent. A call option expiring at the end of the second period ha..
Difference between a debit card and a credit card : List and describe some of the banking services offered by financial institutions.- What is the difference between a debit card and a credit card?
After reviewing the types of investments companies : After reviewing the types of investments companies can make in Marketplace, what types of activities can teams do in Marketplace to continue to learn and innovate in ways to create and maintain competitive advantages over other teams?
Construct a pda accepting : Let S->aB|bA,A->aS|bAA|a,B->bS|aBB|b. Derive the string aaabbabbba as left most derivation. Construct a PDA accepting {anb2n; n>=1} by final state.
Decided to save some money at the end of every year : You have decided to save some money at the end of every year for the next three years. Your plan is to save $1,500, $2,500, and $3,500 at the end of each of the next three years, respectively. You will invest these funds into an account that is expec..
What factors should steve consider : Steve just received his first paycheck and wants to open a checking account. There are five banks in his hometown. What factors should Steve consider when choosing a bank?
What is the difference between arbitration and litigation : What is the difference between arbitration and litigation? What steps in the litigation process are missing in arbitration? Discuss the steps that the parties would have to take in order to go to trial.
What is a risk premium and who might take advantage of it : What is a risk-free rate? Give an example of an investment with a risk-free rate. Why is there no risk?- What is a risk premium? Who might take advantage of it?

Reviews

Write a Review

Theory of Computation Questions & Answers

  Construct a dfa that recognizes languages

Construct a DFA that recognizes each of the following languages. Unless otherwise noted we are assuming that ω ∈ {0,1}*. (A drawing of a state diagram is sufficient.)

  Verify that a number in base b3 can be converted to base b

Verify that a number in base b can be converted to base b3 by partitioning the digits of the base b number into groups of three consecutive digits starting at the radix point and proceeding both left and right and converting each group into a base..

  Solve DFA to get final regular expression

Design a DFA for a language L which is given by the expression and Solve DFA to get Final regular Expression?

  A turing machine for f(x)=2x

Construct a turing machine to compute the product x*y of any two positive integers x and y.

  Show that the grammar is unambiguous

What does it compute? Prove it, showing how you derive the loop invariant - Show that the grammar is unambiguous

  Define the predicate successor

Define the predicate Successor (Year) giving the solution as the first successor to the crown for the year specified. To do this, use the predicates born(X, Year), died(X, Year), male(X).

  Prove the problem by contradiction

Let n > 1 be an integer. Prove by contradiction that if n is a perfect square, and then n + 3 cannot be a perfect square.

  Interpreting the regular expressions as languages

Show that the following identities hold for regular expressions over any alphabet: epsilon + R*R = R*. These should be done by interpreting the regular expressions as languages.

  Formulate the corresponding coffee-machine decision problem

meeting rooms on university campuses may or may not contain coffee machines. we would like to ensure that every meeting

  Design mealy fsm with the input a and output z

Design a Mealy FSM with the input A and an output Z. If 10101 shows up on A, then in same cycle 1 must show up on Z, else Z is 0.

  Write an unambiguous grammar

Write an unambiguous grammar for the given languages- You have to prepare unambiguous grammar for the above languages. Please help! I am stuck on this question

  Design turing machine having at least four nontrivial states

Design Turing machine (using Sipser notation) having at least 4 nontrivial (i.e., nonrejecting) states and at least six nontrivial (i.e., not to the rejecting state) transitions.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd