Question

In: Computer Science

I have 3 grammars A - S→ a T ∣ S b ∣ ϵ T→ Sb...

I have 3 grammars

A -

S→ a T ∣ S b ∣ ϵ

T→ Sb ∣ b

B -

S→ ϵ ∣ aSb ∣ aSbb

C-

S→T ∣ a S b b

T→ ϵ ∣ a T b

Find me the sublanguage relation

e.g [(A,A) ,(B,B),(C,C), ...... ]

Solutions

Expert Solution

Solutions :

Note : ^ is used as power in expressions .

A) 

S -> aT | Sb | ϵ
T -> sb | b 


The strings  generated by the above grammar  are : 

str={ ϵ, b , b^2,b^3 ,_ _ _ _, __,
      ab , ab^2 , ab^3 < _ _ _ _ ,  _ _ ,
      a^2b^2 , a^3b^3, a^4b^4 , _ _ _ _ ,  
      a^2b^3,a^2b^4, _ _ _ _ , __ } 


we can conclude that 

L(G) = {a^m b^n , n>=m  }   

B) 

 S→ ϵ ∣ aSb ∣ aSbb

Strings genrated by the given grammer can be 

str={ϵ , ab , a^2b^2 , a^3b^3 ,_ _ _ _ _ _ _ _ _ ,a^2b^3 , a^2b^4 , a^3b^4 a^3b^5 ,a^3b^6 , a^4b^5,
     a^4b^6,a4^b^7 _ _ _ _ _ } 


from observation it can concluded that , 

Genrated grammer can be : 

L(G) ={a^m b^n , m<=n<=2*m } 

This grammar  generates all the strings such that n lies between m and 2 * m as shown in above grammer.
C) 

S→T ∣ a S b b
T→ ϵ ∣ a T b


Strings generated by the above grammar as follows : 

str={ϵ , ab , a^2b^2, a^3b^3 , _ _ _ _ _ _ _ , _ _  
      ab^2,a^2b^4 , a^3b^6 ,_ _ _ _ _ _ _ _ , _ _ 
       a^2b^3 , a^3b^4 , a^4b^5,_ _ _ _ __ , _ _ } 

from above set of stirngs we can conclude that 

L(G) = { a^m b^n , m=n or n=2*m or n=m+1 except when m=0 } 



       

Related Solutions

Find T(t), N(t), and B(t) for r(t) = t^2 i + (2/3)t^3 j + t k...
Find T(t), N(t), and B(t) for r(t) = t^2 i + (2/3)t^3 j + t k at the point P ( 1, (2/3) , 1)
Let V = { S, A, B, a, b, λ} and T = { a, b...
Let V = { S, A, B, a, b, λ} and T = { a, b }, Find the languages generated by the grammar G = ( V, T, S, P } when the set of productions consists of: S → AB, A → aba, B → bab. S → AB, S → bA, A → bb, B → aa. S → AB, S → AA, A → Ab, A → a, B → b. S → A, S →...
I have a transfer function T(S)=.023/(.02913S^3+.1543s^2+.1205S). I need to design a PI, PD, or PID controller...
I have a transfer function T(S)=.023/(.02913S^3+.1543s^2+.1205S). I need to design a PI, PD, or PID controller to give this system a peak overshoot PO of 15% and a rising time Tr of 3 seconds. I have equations that relate the characteristic equation to the PO and Tr, but that only works for a second order equation.
Female Tsetse flies heterozygous for 3 recessive mutations, t (tiny body), sq (squint eyes) and sb...
Female Tsetse flies heterozygous for 3 recessive mutations, t (tiny body), sq (squint eyes) and sb (soft bristles) were testcrossed to homozygous t, sq, sb/ t, sq, sb individuals and the following progeny were obtained: Wild-type                               201                          Tiny, squint, soft bristles 234         Soft bristles                          162                           Tiny, squint                                         204 Tiny 24                           Tiny, soft bristles                               1041 Squint 1104                        Squint, soft bristles         30 A) If the 3 genes are on the same chromosome, determine the map distance separating the 2 genes t and...
V = X'(t) = -t^2 + 6 m/s Implies X(t) = -(1/3)*t^3 + 6*t The initial...
V = X'(t) = -t^2 + 6 m/s Implies X(t) = -(1/3)*t^3 + 6*t The initial position is zero in this case. This function will initially increase (this means the object is moving forward), then the negative force will be too strong, so the object will start moving backwards. calculate the maxima and minima. Graph the function X(t). Describe the motion. Every detail.   
s(t)= 5t + 3/t^2  be the position in feet of a particle after t seconds for t...
s(t)= 5t + 3/t^2  be the position in feet of a particle after t seconds for t ≥ 1. (a) Compute the average velocity from t = 1 to t = 3. Include units in your answer (b) Where is the velocity = 0? (c) Show the accelaration for t ≥ 1 is positive. (d) What are the units for the acceleration?
Let L = {x = a r b s c t | r + s =...
Let L = {x = a r b s c t | r + s = t, r, s, t ≥ 0}. Give the simplest proof you can that L is not regular using the pumping lemma.
Bond B and Bond T both have 7% coupon rate, bond B has 3 years to...
Bond B and Bond T both have 7% coupon rate, bond B has 3 years to maturity, bond T has 20 years to maturity. What is the percentage change of in the price of each bond if interest rate goes up by 2%? What is the percentage change if interest rate goes down by 2%? Which bond has higher interest rate risk?
Consider the linear transformation T : P1 → R^3 given by T(ax + b) = [a+b...
Consider the linear transformation T : P1 → R^3 given by T(ax + b) = [a+b a−b 2a] a) find the null space of T and a basis for it (b) Is T one-to-one? Explain (c) Determine if w = [−1 4 −6] is in the range of T (d) Find a basis for the range of T and its dimension (e) Is T onto? Explain
1) Find the Laplace transform of f(t)=−(2u(t−3)+4u(t−5)+u(t−8)) F(s)= 2) Find the Laplace transform of f(t)=−3+u(t−2)⋅(t+6) F(s)=...
1) Find the Laplace transform of f(t)=−(2u(t−3)+4u(t−5)+u(t−8)) F(s)= 2) Find the Laplace transform of f(t)=−3+u(t−2)⋅(t+6) F(s)= 3) Find the Laplace transform of f(t)=u(t−6)⋅t^2 F(s)=
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT