Menu

Context Free Grammars Questions

MCQ
21.
Which of following statement(s) is/are not correct? (I) Languages generated by the grammar S?aSa ? aa is not regular. (II) Languages generated by the grammar S?aSb ? aa is not regular. (III) Languages generated by the grammar S?S1|S3, S1?aS1c |S2|?, S2?aS2b|?, S3?aS3b|S4| ?, S4?bS4c|? is {a^nb^mc^k | k = |n - m|, n?0, m?0, k?0}. (IV) Languages generated by the grammar S?S1S3, S1?aS1c |S2|?, S2?aS2b|?, S3?aS3b|S4| ?, S4?bS4c|? is {a^nb^mc^k | k = |n - m|, n?0, m?0, k?0}.
forum Discussion
MCQ
22.
Consider the following grammars G1 and G2 respectively. Grammar - G1:

A1 ? A2A3
A2 ? A3A1 | b
A3 ? A1A1 | a
Grammar - G2:

S ? AA | 0
A ? SS | 1
Consider the following statements regarding above grammars: (I): This grammar is not left recursive and equivalent to grammar - G1:

A1 ? A2A3
A2 ?  A3A1 | b
A3 ? a | bA3A1 | aK | bA3A1K 
k ? A1A3A1 | A1A3A1K
(II): This grammar is not left recursive and equivalent to grammar - G2:

S ? A A | 0
A ? 0S | 1 | 0SK | 1K
K ? AS | ASK
forum Discussion
MCQ
23.
Let G = (V, T, S, P) be a context-free grammar such that every one of its productions is of the form A ? ?, with |?| = k > 1. The derivation tree for any string W ? L (G) has a height such that
forum Discussion
MCQ
24.
CFG (Context Free Grammar) is not closed under
forum Discussion
MCQ
25.
A CFG(Context Free Grammar) is said to be in Chomsky Normal Form (CNF), if all the productions are of the form A -> BC or A -> a. Let G be a CFG in CNF. To derive a string of terminals of length x, the number of products to be used is
forum Discussion
MCQ
26.
The entity which generate Language is termed as:
forum Discussion
MCQ
27.
Production Rule: aAb->agb belongs to which of the following category?
forum Discussion
MCQ
28.
Which of the following statement is false?
forum Discussion
MCQ
29.
The Grammar can be defined as: G=(V, ?, p, S)
In the given definition, what does S represents?
forum Discussion
MCQ
30.
Which among the following cannot be accepted by a regular grammar?
forum Discussion