1. The regular expression have all strings of 0′s and 1′s with no two consecutive 0′s is?
a) (0+1)
b) (0+1)*
c) (0+∈) (1+10)*
d) (0+1)* 011
Explanation: From the former bracket we choose 0 or epsilon. Then from the latter part 1 or 10 which can be followed by 1 or 10.
2. The regular expression with all strings of 0′s and 1′s with at least two consecutive 0′s is?
a) 1 + (10)*
b) (0+1)*00(0+1)*
c) (0+1)*011
d) 0*1*2*
Explanation: The expression (0+1)*00(0+1)* is where either it initially takes 0 or 1 or 00 followed by string of combination of 0 and 1.
3. Which of the following is NOT the set of regular expression R = (ab + abb)* bbab?
a) ababbbbab
b) abbbab
c) ababbabbbab
d) abababab
Explanation: abababab doesn’t end with bbab whereas the other 3 options satisfy the given regular expression.
4. String generated by following expression is?
S->aS/bA, A->d/ccA
a) aabccd
b) adabcca
c) abcca
d) abababd
Explanation: S->aS (substitute S->aS)
S->aaS (substitute S->bA)
S->aabA (substitute A->ccA)
S->aabccA (substitute A->d)
S->aabccd.
5. Consider the production of the grammar S->AA A->aa A->bb Describe the language specified by the production grammar.
a) L = {aaaa,aabb,bbaa,bbbb}
b) L = {abab,abaa,aaab,baaa}
c) L = {aaab,baba,bbaa,bbbb}
d) L = {aaaa,abab,bbaa,aaab}
Explanation: S->AA (substitute A->aa)
S->aaaa
S->AA (substitute A->aa )
S->aaA (substitute A->bb)
S->aabb
S->AA (substitute A->bb the A->aa)
S->bbaa
S->AA (substitute A->bb)
S->bbbb.
6. If R is regular language and Q is any language (regular/ non regular), then Pref (Q in R) is _____________
a) Non-regular
b) Equal
c) Infinite
d) Regular
Explanation: So says the definition of Regular Grammar.
7. The production of the form no terminal → Λ is said to be null production.
a) False
b) True
Explanation: Here the non terminal that gives null will said to have a null production.
8. (a,b) what is a?
a) Domain
b) Range
c) Domain & Range
d) None of the mentioned
Explanation: A is called the domain.
9. (a,b) what is b?
a) Domain
b) Range
c) Domain & Range
d) None of the mentioned
Explanation: B is called the Range.
10. R is said to be reflexive if aRa is true for every a in A.
a) True
b) False
Explanation: All the elements of A are related with itself by relation R, hence it is a reflexive relation.