Question

Consider the following context-free grammar: S → TT | U T → 0T | T0 |...

Consider the following context-free grammar: S → TT | U T → 0T | T0 | # U → 0U00 | # a. Give a parse tree for the string: 0#0#0 b. Give a leftmost derivation for the string: 00#0000

Homework Answers

Answer #1

Solution:

Given grammar,

S -> TT | U

T -> 0T | T0 | #

U -> 0U00 | #

Explanation:

I have explained each and every part with the help of image attached to the answer above.

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
Construct a DFA from the following context-free grammar: T -> ε T -> (T) Draw the...
Construct a DFA from the following context-free grammar: T -> ε T -> (T) Draw the corresponding LR(0) parse table.
Ex#5: Given the following grammar for a simple assignment statements. <assign> --> <id> = <expr> <id>...
Ex#5: Given the following grammar for a simple assignment statements. <assign> --> <id> = <expr> <id> --> A | B | C <exp> --> <id> + <expr> | <id> * <expr> | (<expr>) | <id> Show a leftmost derivation and a parse tree of the following statement: A = A *(B + (C * A))
Consider the following grammar. Nonterminals are lowercase and terminals are uppercase. s -> c A c...
Consider the following grammar. Nonterminals are lowercase and terminals are uppercase. s -> c A c -> c B | B Which of the following sentences is in the language generated by the grammar? a) BAA b) BBBA c) BBAAAAA d) none of the above
Please show work. Consider a two-period binomial tree with the following parameters: S = 100, u...
Please show work. Consider a two-period binomial tree with the following parameters: S = 100, u = 1:20, d = 0:80, and R = 1:10. Suppose also that a dividend of $5 is expected after one period. Find the tree of prices of a European Put option with a strike of 100 expiring in two periods. Find the tree of prices of an American Put option with a strike of 100 expiring in two periods. Is there a difference between...
Consider the following behavioral equations: (18 marks) C=c0 +c1YD T=t0 +t1 Y YD = Y –...
Consider the following behavioral equations: C=c0 +c1YD T=t0 +t1 Y YD = Y – T G and I are both constant. Assume that t1 is between 0 and 1. (1) Solve for equilibrium output and equilibrium taxes. (2) What is the multiplier? Does the economy respond more to changes in autonomous spending when t1 is 0 or when t1 is positive? Explain. (3) Why is the fiscal policy in this case called an automatic stabilizer? Now suppose that the government...
Problem 4. Convert RE to CFG We saw in class how to construct CFGs for U,...
Problem 4. Convert RE to CFG We saw in class how to construct CFGs for U, *, and o operations for existing CFL's. We also saw how to construct CFG's for regular expressions empty-set, e, and c (where c is some member of S). a) Using these constructions, create CFG for the RE R = x ((yx)* U y). This is an algorithm for converting any RE to a CFG with start variable S0. It works as follows: create an...
Given the following functions F(s), find f(t). Do not enter u(t) as part of your answers,...
Given the following functions F(s), find f(t). Do not enter u(t) as part of your answers, and do not use any truncated decimal approximations to fractions or they will be marked wrong (answers must be exact). E.g., enter (2/3), not 0.666. (a) F(s) = s + 7 /(s(s + 3)(s + 8)) (b) F(s) = (s^2 + s + 6)/( s(s + 1)(s + 8))
Consider the following data for a two-period binomial model. The stock’s price S is $100. After...
Consider the following data for a two-period binomial model. The stock’s price S is $100. After three months, it either goes up and gets multiplied by the factor U = 1.138473, or it goes down and gets multiplied by the factor D = 0.886643. Options mature after T = 0.5 year and have a strike price of K = $110. The continuously compounded risk-free interest rate r is 5 percent per year. Today’s European call price is c and the...
Air at freestream velocity U∞=16 ms, and free steam temperature      T∞=50℃ is flowing over a plate...
Air at freestream velocity U∞=16 ms, and free steam temperature      T∞=50℃ is flowing over a plate surface that is at temperature Ts=100℃. The velocity and thermal boundary layers developing on the surface have been shown in the figure. Also shown are the tangents to the velocity and temperature profiles at the surface y=0. If the density of air is ρ∞=1.1 kgm3, viscosity μ=1.963×10-5kgm∙s, and thermal conductivity k=0.0274Wm∙K then, calculate (a)        the wall shear stress, τw (b)       coefficient of skin friction,...
A projectile motion (i.e. cannon) can be modeled via the following equations: x=u cos⁡θ t y=-0.5...
A projectile motion (i.e. cannon) can be modeled via the following equations: x=u cos⁡θ t y=-0.5 g t^2+u sin⁡θ t Where: x: Position of the cannonball after t seconds in the x-direction (meters) y: Position of the cannonball after t seconds in the y-direction (meters) u: Initial velocity of the cannonball (meters per second) g: Acceleration due to gravity (meters per second squared) t: Time (seconds) In this question, we are trying to see the effects of the angle ϴ...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT