Home /
Expert Answers /
Computer Science /
question-4-53-15-points-note-that-the-questions-below-have-a-sequence-so-working-through-the-pa427
(Solved): Question 4 (53=15 points ) Note that the questions below have a sequence, so working through the ...
Question 4 (5?3=15 points ) Note that the questions below have a sequence, so working through them in increasing order helps you firm up your concepts better. G is a grammar of the form S?>D?S?S?S+S where D represents mathematical digits. 1. Derive 6?3?4 using leftmost derivation if it is possible. 2. Draw all possible parse trees for the above string. 3. Derive 9?1 - using rightmost derivation if it is possible. 4. Derive 8+6+3?5 using a derivation that is not leftmost or rightmost (Note - we DO NOT want to see parse trees) 5. How many left most and right most derivations do we have for the above string? Why? Question 5 The following is based on Question 4 1. How many parse trees can we construct for the string in Q4.4 ? 2. Is the number of derivations for the string in Q 4.4 the same as the number of parse trees? Why/ why not? 3. Is this grammar ambiguous? Why/why not? 4. If the grammar is ambiguous (it need not be), try to design a new grammar to remove its ambiguity. 5. For the above question is it possible to do it in multiple ways, and if yes, in each such method, is there some 'meaning' to + and ?, or their order?