Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Theory QUESTION 1: [3 POINTS Consider the following grammar then answer the questions below: G=P:ABC({S,A,B},{0,1},S,P)O1AOA1ABC001 A. Is the above grammar linear? Why? B. Is the
Theory
QUESTION 1: [3 POINTS Consider the following grammar then answer the questions below: G=P:ABC({S,A,B},{0,1},S,P)O1AOA1ABC001 A. Is the above grammar linear? Why? B. Is the above grammar regular? Why? C. What is the language generated by the grammar G? You can use regular expressions. QUESTION 2: [2 POINTS] Convert the following right linear grammar into an equivalent NFA. S01AOA0A1ABB001C110C XYXYY0OY101 A. [ 1 point] Give a right-most derivation for the terminal string: 010101 . B. [ 1 point] Give a left-most derivation for the terminal string: 010101. C. [ 1 point] Show that the grammar is ambiguous by exhibiting two distinct derivation trees for some terminal string (hint: use 00111) Question 4: [2 POINTS] A) I 1 point] Give a context free grammar for the following language: L1={aibi+n+kak:n,k0,i>0} B) [1 point] Give a regular grammar for the following language: L2={02nI3m+1:n,m0} Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started