Compilers Questions and Answers – The NFA with epsilon – Moves – 2

This set of Compilers Questions and Answers for Experienced people focuses on “The NFA with Epsilon – Moves – 2”.

1. NFA-εs are defined because certain properties can be more easily proved on them as compared to NFA.
a) True
b) False
View Answer

Answer: a
Explanation: NFA-ε can be transformed into a NFA always, the properties are also true for NFAs.

2. E(q) is known ε-closure of q.
a) True
b) False
View Answer

Answer: a
Explanation: The ε-closure of a set of states Z of an NFA is defined as the set of states reachable from any state in Z following ε-transitions.

3. ε-transitions does not add any extra capacity of recognizing formal.
a) True
b) False
View Answer

Answer: a
Explanation: ε-transitions provides a convenient transition in the systems whose current states are not precisely known.
advertisement
advertisement

4. Which of the following CFG’s can’t be simulated by an FSM?
a) S->Sa/b
b) S->aSb/ab
c) S->abX, X->cY, Y->d/aX
d) None of the mentioned
View Answer

Answer: b
Explanation: generates the set {an bn, n=1,2,3 ….}which is not regular.

5. The transitions which does not take an input symbol are called ___________
a) ε-transitions
b) λ-transitions
c) ε-transitions & λ-transitions
d) none of the mentioned
View Answer

Answer: d
Explanation: The transitions taking an input symbol are called ε-transitions or λ-transitions.
Note: Join free Sanfoundry classes at Telegram or Youtube

6. A nondeterministic finite automation with ε-moves is an extension of nondeterministic finite automation.
a) True
b) False
View Answer

Answer: a
Explanation: Both are equivalent.

7. Is an ordinary NFA and a NFA-ε are equivalent.
a) True
b) False
View Answer

Answer: a
Explanation: Yes ordinary NFA and NFA-ε are the same, in that, given either one, one can construct the other, which recognizes the same language.
advertisement

8. Which of the following is a correct statement?
a) { If an bn | n = 0,1, 2, 3 ..} is regular language
b) Strings with equal number of a’s and b’s denies a regular language
c) L (A* B*)∩ B gives the set A
d) None of the mentioned
View Answer

Answer: c
Explanation: If we include A and B in a set and if we write A* it means except then A i.e. B same as B* means except then B i.e. so if we intersect (A*B*) and B then get A because in any regular language. If we write A-B then A-B=A intersection B’ so if we intersect A and B means A-B So the intersection of (A*B*) and B = (BA). intersection B means (BA)-B’ and B’=A so (BA) intersection(A)=A.

Sanfoundry Global Education & Learning Series – Compilers.

advertisement

To practice all areas of Compilers for Experienced people, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.