Grammar and its application to Fractals Let G=(N,T,P,∑) where ∑ is the start symbol, N = {D}, T = {d, r, l}, and P = {∑→D, D→DrDllDrD, D → d} 1. Give the most specific type of grammar G. 2. Show the...







Grammar and its application to Fractals
Let G=(N,T,P,∑) where ∑ is the start symbol, N = {D}, T = {d, r, l}, and
P = {∑→D, D→DrDllDrD, D → d}


1. Give the most specific type of grammar G.
2. Show the leftmost derivation sequence of the string drdlldrd, (i.e. When deriving a new sentential form, always replace one Nonterminal at a time and always replace the leftmost Nonterminal)
3. Suppose d is an abstraction of a command to draw a straight line of fixed length in the current direction, r is an abstraction of a command to turn right by 60 degrees, and l is an abstraction of a command to turn left by 60 degrees. Assuming that you are to start from a point and that the starting direction is to proceed horizontally to the right, show the figure represented by the generated string drdlldrd.
4. The string drdlldrdrdrdlldrdlldrdlldrdrdrdlldrd can also be generated. Assuming that you are to start from a point and that the starting direction is to proceed horizontally to the right, show the figure represented by the string drdlldrdrdrdlldrdlldrdlldrdrdrdlldrd.








Jun 02, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here