Consider the following grammar (S, A, B, and C are nonterminal symbols; S is the start symbol; 0 and 1 are terminal symbols): S → AA A → BCB B → B0 | B1 | 0 | 1 C → 00 | 11
Which of the following sentences are in the language generated by the grammar? Show derivations for the sentences that can be generated. If a sentence cannot be generated by the grammar, explain why.
a) 10010001
b) 01101101
c) 11100110
d) 00110100
We need at least 10 more requests to produce the answer.
0 / 10 have requested this problem solution
The more requests, the faster the answer.
Consider the following grammar (S, A, B, and C are nonterminal symbols; S is the start...
1.) Consider the following grammar in which S, A, and B are nonterminal symbols and S is the start symbol. S → 1A | 0B A → A0 | 1B B → 10A| 1 Show that the grammar is ambiguous by showing two parse trees for the sentence 1110110 using leftmost derivation.
Consider the following grammar G, whose productions rules are the following (an upper case letters represents a nonterminal symbol, a lower case letter represents a terminal symbol). Untitled Note Eile Edit Format View Help S -asCB A b A -aA C B d A Which of the following sentences are in the language generated by the grammar G? |Untitled - Notepad X Eile Edit Format View Help А. асcbd B. abcd c. acccbcc D. acd Е. ассс F. CCC G....
Consider the following grammar: <S> → <A> a <B> b <A> → <A> b | b <B> → a <B> | a Is the following sentence in the language generated by this grammar? baab Consider the following grammar: <S> → a <S> c <B> | <A> | b <A> → c <A> | c <B> → d | <A> Is the following sentence in the language generated by this grammar? acccbcc SHOW WORK
4. Consider two grammars Gi and G2 over the alphabet (a, b], with respective start symbols E and I and specified by the respective sets of production rules below: EFab (a) Do the two grammars generate the same language? If they do, briefly argue why. If they do not, provide a counter-example, that is, a word generated by one, but not by the other (b) The grammar G2 is unnecessarily complicated. Write a grammar that generates the same language generated...
Automata: solve a - e 2. (10+10+10+10+10-50 points) Agrammar is a 4-tuple G, G-ON,E,11,L$) where N 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 N- (S, T s-{a, b, c} s-> ab aT >aaTb aT-ac S is the starting symbol. (a 10 points) Prove that the given grammar G is a context sensitive grammar. (b-10 points) What is the language L-...
determine the terminal symbols and non-terminal symbols and the start symbols from the following grammar: <program> ==> <stmts> <stmts> ==> <stmt> | <stmt> ; <stmts> <var> ==> a | b | c | d <expr> ==> <term>+<term>|<term>-<trerm> <term> == > <var>|const
Consider the following context-free grammar with terminals {a, b, c, d} and start symbol S. S → W | X | Y | Z W → AW D | X | Y | Z X → BXD | Z Y → AY C | Z Z → BZC | ε A → a B → b C → c D → d (a) Give a derivation tree with input string: aaaabccddd (b) What language does this CFG recognize? Give a...
Given the following grammar with start symbol : ?: ? → b? | a? ? → a? | ε a) Give two strings derived from this grammar and their corresponding derivations. (Please mention the derivation as well).
4. Consider the following context-free grammar S SSSS a (a) Show how the string aa+a* can be generated by this grammar (b) What language does this grammar generate? Explain
Construct a regular grammar G (a" b) c (aa bb)? VT, S, P) that generates the language generated by Construct a regular grammar G (a" b) c (aa bb)? VT, S, P) that generates the language generated by