0% found this document useful (0 votes)
24 views4 pages

Unit 4 MCQ

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views4 pages

Unit 4 MCQ

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Theory of Computation

Class- TY-BTech CSE Semester-I


Multiple Choice Questions
MCQ’s (Options in bold are the answers for respective MCQ)
UNIT-IV
1. The entity which generate Language is termed as:
a) Automata
b) Tokens
c) Grammar
d) Data

2. The Grammar can be defined as: G=(V, ∑, p, S)


In the given definition, what does S represents?
a) Accepting State
b) Starting Variable
c) Sensitive Grammar
d) None of these

3. For S->0S1|e for ∑={0,1}*, which of the following is wrong for the language produced?
a) Non regular language
b) 0n1n | n>=0
c) 0n1n | n>=1
d) None of the mentioned

4. The minimum number of productions required to produce a language consisting of


palindrome strings over ∑={a,b} is
a) 3
b) 7
c) 5
d) 6

5. Which of the following statement is correct?


a) All Regular grammar are context free but not vice versa
b) All context free grammar are regular grammar but not vice versa
c) Regular grammar and context free grammar are the same entity
d) None of the mentioned

6. Are ambiguous grammar context free?


a) Yes
b) No

7. Every grammar in Chomsky Normal Form is:


a) regular
b) context sensitive
c) context free
d) all of the mentioned
8. Which of the production rule can be accepted by Chomsky grammar?
a) A->BC
b) A->a
c) S->e
d) All of the mentioned

9. Which of the following grammars are in Chomsky Normal Form:


a) S->AB|BC|CD, A->0, B->1, C->2, D->3
b) S->AB, S->BCA|0|1|2|3
c) S->ABa, A->aab, B->Ac
d) All of the mentioned

10. Let G be a grammar: S->AB|e, A->a, B->b


Is the given grammar in CNF?
a) Yes
b) No
11. Suppose A->xBz and B->y, then the simplified grammar would be:
a) A->xyz
b) A->xBz|xyz
c) A->xBz|B|y
d) none of the mentioned

12. Given Grammar: S->A, A->aA, A->e, B->bA


Which among the following productions are Useless productions?
a) S->A
b) A->aA
c) A->e
d) B->bA

13. Given:
S->aSb
S->e
S-> A
A->aA
B->C
C->D
The ratio of number of useless variables to number of useless production is:
a) 1
b) 3/4
c) 2/3
d) 0

14. Given grammar G:


S->aS|A|C
A->a
B->aa
C->aCb
Find the set of variables thet can produce strings only with the set of terminals.
a) {C}
b) {A,B}
c) {A,B,S}
d) None of the mentioned

15. Given grammar:


S->aS|A
A->a
B->aa
Find the number of variables reachable from the Starting Variable?
a) 0
b) 1
c) 2
d) None of the mentioned

16. Inorder to simplify a context free grammar, we can skip the following operation:
a) Removal of null production
b) Removal of useless symbols
c) Removal of unit productions
d) None of the mentioned

17. Given a Grammar G:


S->aA
A->a
A->B
B->A
B->bb
Which among the following will be the simplified grammar?
a) S->aA|aB, A->a, B->bb
b) S->aA|aB, A->B, B->bb
c) S->aA|aB, A->a, B->A
d) None of the mentioned

18. Simplify the given grammar:

A-> a| aaA| abBc

B-> abba| b

a) A-> a| aaA| ababbAc| abbc

b) A-> a| aaA| ababbAc| abbc, B-> abba|b

c) A-> a| aaA| abbc, B->abba

d) None of the mentioned

19. In context to the process of removing useless symbols, which of the following is correct?
a) We remove the Nullable variables
b) We eliminate the unit productions
c) We eliminate products which yield no terminals
d) All of the mentioned
20. A CFG is ambiguous if
a) It has more than one rightmost derivations
b) It has more than one leftmost derivations
c) No parse tree can be generated for the CFG
d) None of the mentioned

21. Which of the following are always unambiguous?


a) Deterministic Context free grammars
b) Non-Deterministic Regular grammars
c) Context sensitive grammar
d) None of the mentioned

22. State true or false:


Statement: R->R|T T->ε is an ambiguous grammar
a) true
b) false
23. The context free grammar S → SS | 0S1 | 1S0 | ɛ generates
a) Equal number of 0’s and 1’s
b) Unequal number of 0’s and 1’s
c) Any number of 0’s followed by any number of 1’s
d) None of these

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy