What is the language L(G) generated by the context-free grammar G given below?
S -> A | aB | bA | ε
A -> aS | bAA
B ->bS | aBB
The language accepted by given cfg is :
L(G) = {set of all strings where number of a's is greater than or
equal to number of b's}
Explanation:
prodution A generates a's 1 greater than b's//consider we use S as
empty string
production B generates b's 1 greater than a's
now, from S, we can call B only through S->aB, which makes, a's
and b's length equal
now, from S, we can call A using A, bA,
S->bA makes a's and b's length equal
S->A makes a's greater than b's// because, in productions of A,
a's are greater than B
hence overall number of a's is greater than or equal to number of
b's
What is the language L(G) generated by the context-free grammar G given below? S -> A...
indicate what language is generated by the context-free grammar. The alphabet is Σ = {a, b} • S → SaS | bS
Theory of Computation
7. Write down the Chomsky Normal Form for the context-free language de- fined by the productions: S bAļaB. A bAA laSla, and B aBB bS b, where S, A, B are nonterminal symbols and a, b are terminal symbol 8. For the context-free grammar Ģ -(X, T, R, S) with X (A, B. C, a, b), T a, b and productions R: SAB |BC, ABAa, BCClb,C AB la, check by applying the CYK Theorem whether the string...
A grammar is a 4-tuple G, G = (Ν, Σ, Π, Σ, S) where, Ν is a finite set of nonterminal symbols, Σ is a finite set of terminal symbols, Π is a finite set of rules,S is the starting symbol. Let, Ν = {S, T} Σ = {a, b, c} Π = { S -> aTb S -> ab aT -> aaTb aT -> ac } S is the starting symbol. A) Prove that the given grammar G is...
Give a context free grammar for the language L where L = {a"bam I n>:O and there exists k>-o such that m=2"k+n) 3. Give a nondeterministic pushdown automata that recognizes the set of strings in L from question 3 above. Acceptance should be by accept state. 4. 5 Give a context-free grammar for the set (abc il j or j -k) ie, the set of strings of a's followed by b's followed by c's, such that there are either a...
Q1: Given the below language and context free gramma:, a. Show that the grammar is ambiguous using the string ( abc) by using substitutions. b. Then design a push down automata that recognizes the language. C. Then show the tracing of (abc, abbccc) using the push down automata. d. Then Show which two simple languages create the greaterlanguage. Give set builder notation for each language. e. Then produce Chomsky normal form for the grammar. The following context-free language is inherently...
What language is generated by the grammar given S→ XY X → aXbb | ε Y → bXcc | b
Construct a context-free grammar for the language L={ ab^n ab^n a | n> 1}.
Let S = {a,b,c}. Write a context-free grammar for the language: L = {ba" wa" :n > 0, we * and w contains bbc} BIU A- A - IX E ** 11 xX, T T: 12pt You Tube P S-baSaA AaA DACA bbc
) Construct a context-free grammar for the language L={ ab”ab”a | n> > 1}.
Construct a context-free grammar for the language L={ ab”ab”a | n> 1}.