Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Netautomata1
1. Finite Automata
1.(Q35)Consider the regular expression (a+b)(a+b)…(a+b) (n-times). The minimum
number of states in finite automation that recognizes the language represented by this
regular expression contains: [June 2012-Paper-III]
(A)n states (B) n+1 states (C) n+2 states (D) 2n
states
Solution
a,b a,b a,b a,b a,b
……….
2.(Q44)Let L be a set accepted by a non deterministic finite automation. The number of
States in non-deterministic finite automation is |Q|. The maximum The number of
States in equivalent finite automation that accepts L is: [Dec’ 2012-Paper-II]
(A) |Q| (B)2 |Q| (C) 2|Q|
-1 (D) 2|Q|
3.(Q47) The minimum number of states of the non-deterministic finite automation which
accepts the language {a b a bn
| n≥0} U {a b an
| n≥0} is: [Dec’ 2012-Paper-III]
(A)3 (B) 4 (C) 5 (D) 6
Solution
a b a a,b
.
a b
4.(Q24) Given a Non-deterministic Finite Automation(NFA) with states p and r as initial
and final states respectively and transition table as given below:
a b
p -- q
q r s
r r s
s r s
The minimum number of states required in Deterministic Finite Automation (DFA)
equivalent to NFA is: [June 2013-Paper-II]
(A)5 (B) 4 (C) 3 (D) 2
q
0
q
1
q
2
qn
qn-1
q
0
q
1
q
2
q3
q
2
2. Solution
1. Split the state into two groups final state and non-final state:
a. ∏={(p,q,s),(r)}
2. Again split the group states those having same transition on given input symbol
a. ∏new = {{p},{q,s},{r}}
3. Now, assign single name to group {q,s} as {q}
a. ∏new = {{p},{q},{r}}
4. Now the transition table becomes
b a
b a
b
DFA
Transition table
5.(Q13) The number of states in a minimal deterministic finite automation corresponding
to the language L={an
| n≥4} is: [September 2013-Paper-II]
(A)3 (B) 4 (C) 5 (D) 6
Solution a
a a a a a,
6.(Q19) Minimal deterministic finite automation for the language L={0n
| n≥0 , n≠4 } will
have: [June 2015-Paper-III]
(1) 1 final state among 5 states (2) 4 final state among 5 states
(3) 1 final state among 6 states (4) 5 final states among 6 states
Solution
0
0 0 0 0 , 0
7.(Q21) The transition function for the language L={w | na(w) and nb(w) are both odd} is
given by: [June 2015-Paper-III]
δ(q0,a) = q1 ; δ(q0,b) = q2
δ(q1,a) = q0 ; δ(q1,b) = q3
δ(q2,a) = q3 ; δ(q2,b) = q0
δ(q3,a) = q2 ; δ(q3,b) = q1
a b
p -- q
q r q
r r q
p q r
q
0
q
1
q
2
qn
qn-1
q5
q0
q1
q2 q3
q4
3. The initial and final states of the automata are:
(1) q0 and q0 respectively (2) q0 and q1 respectively.
(3) q0 and q2 respectively (4) q0 and q3 respectively
b
Solution b
a a
a a
b
b
• State q0 recognizes the string ’aa’ as : q0→q1→q1 (‘aa’- not belongs to L)
• State q1 recognizes the string ’abb’ as: q0→q1→q3→q1 (‘abb’- not belongs to L)
• State q2 recognizes the string ’aab’ as: q0→q1→q0→q2 (‘aab’- not belongs to L)
Regular Expression
8. (Q38). Which is not the correct statement? December 2012-Paper-III
(A) The class of regular sets is closed under homomorphisms.
(B) The class of regular sets is not closed under inverse homomorphisms.
(C) The class of regular sets is closed under quotient.
(D) The class of regular sets is closed under substitution.
9. (Q45). Which of the following regular expression identities are true? Dec’ 2012-Paper-III
(A) (r+s)* = r*s*
(B) (r+s)* = r*+s*
(C) (r+s)* = (r*s*)*
(D) r*s* = r*+s*
10. (Q43). The regular expression for the following DFA: June 2012-Paper-III
(A)ab*(b+aa*b)* (B) a*b(b+aa*b)* (C) a*b(b*+aa*b) (D) *b(b*+aa*b)*
q0
q1
q2 q
3
4. Solution
1. q0→q0→q1 : a*b
2. (q1→q1→…. q1 + q1→q0→q1)* : (b* + aa*b)*
3. Finally, concatenate 1 and 2 : a*b(b*+aa*b)*
11. (Q20). Given L1=L(a*baa*) and L2=L(ab*).The regular expression corresponding to
language L3=L1/L2 (right quotient) is given by: ( June 2013-Paper-II)
(A)a*b (B) a*baa* (C) a*ba* (D) None of the above
Solution
L1= L (a *baa *) = {a*ba, a*baa, a*baaa,… },
L2= L(ab*)= a{ λ ,b,b2
,b3
,…}={ a,ab,ab2
,ab3
,.....}
L3=L1/L2 = { x | xy ∈ L1 for some y ∈ L2 }
L3=L1/L2= L( a *baa * )/ L(ab* )
= L(a*baa * ) / a ( because L1 ends with only a∈L2, L1 doesn’t end with
ab,ab2 ,ab3 ,.... ∈L2. )
= {a *ba, a*baa, a*baaa...} / a = {a*b, a*ba, a*baa......}= L( a*ba * }
Correct answer is (c)
12. (Q43). Regular expression for the language L={ w {0,1}* | w has no pair of consecutiveԐ
zeros} is :[ September 2013-Paper-II]
(A)(1+010)* (B) (01+10)* (C) (1+010)*(0+ )ƛ (D) (1+01)*(0+ )ƛ
Solution
1. For (A): Second path followed by second path: 010010
2. For (B): Second path followed by First path: 1001
3. For (C): Second alternative in first part (010) followed by first alternative in second
part(0): 0100
4. Hence, D- is Correct option.
13. (Q44). Consider the following two languages:
L1={an
bl
ak
| n+l+k>5}
L2={an
bl
ak
| n>5,l>3,k<=l}
Which of the following is true?[ September 2013-Paper-II]
5. (A)L1 is regular language and L2 is not regular language
(B) Both L1 and L2 are regular languages.
(C) Both L1 and L2 are not regular languages.
(D)L1 is not regular language and L2 is regular language
Solution
Here is a regular expression for L: aaaaaaa∗ b ∗ a∗ + aaaaabb∗ a∗ + aaaabbb∗a∗ + aaaabaa∗ +
aaabbbb∗a∗ + aaabbaa∗ + aaabaaa∗ + +aabbbbb∗a∗ +aabbbaa∗ +aabbaaa∗+aabaaaa∗ +abbbbbb∗a∗
+abbbbaa∗ +abbbaaa∗+abbaaaa∗+abaaaaa∗ + bbbbbbb∗a∗ + bbbbbaa∗ + bbbbaaa∗ + bbbaaaa∗ +
bbaaaaa∗ + baaaaaa∗
Hence, L1-is regular
DFA for L={an
bl
ak
| n+l+k>5 } a
a a a a a
a b b b b b b
b b b b b b
a a a a a a
a a a a
a
14. (Q28). Given the following statements:
S1: If L is regular language then the language {uv| u L, v LԐ Ԑ R
} is also regular.
S2: If L={wwR
} is regular language.
Which of the following is true? (Dec’ 2013-Paper-II)
(A)S1 is not correct andS2 is not correct.
(B) S1 is not correct andS2 is correct.
(C) S1 is correct and S2 is not correct.
(D)S1 is correct and S2 is correct.
Solution
Consider the language L={a,b,aa,ab,ba,bb,abb,aab,aba,aab,,,..,aaaa,aaab,aabb,abab,abbb,…}
LR
={a,b,aa,ba,ab,bb,bba,baa,aba,baa,,,., aaaa,baaa,bbaa,baba,bbba,…}
1. Let u=’ab’ and v=’ba’
uv=’abba ‘ € L1.L2 →is regular(concatenation)
2. Let w=’abab’ € L
wR
=’baba’€ L
wwR
={ababbaba}€ L is also regular
q
3
q
4
q
5
q
2
q
1
q
0
q9
q1
0
q1
1
q
8
q
7
q1
4
q15
q16
q1
3
q
6
q1
2
q1
7
b
6. 15. (Q10). The regular grammar for the language L=w | na(w) and nb(w) are both even,
w {a , b}*} is given by :(Assume, p, q, r and s are states) [Ԑ June 2014-Paper-II]
(A)p→aq | br | , q→bs | ap r→as | bp, s→ar|bq, p and s are initial and final states.ƛ
(B) p→aq | br, q→bs | ap r→as | bp, s→ar|bq, p and s are initial and final states.
(C)p→aq | br | , q→bs | ap r→as | bp, s→ar|bq, p is both initial and final states.ƛ
(D)p→aq | br, q→bs | ap r→as | bp, s→ar|bq, p is both initial and final states.
Solution
b
b
a a
a a
ƛ b
b
• Since zero occurrences of ‘a’ and ‘b’ is even. Hence, Option (B) and (D) are need not be
consider because these are not supports for ƛ transition.
• For Option (A) State s recognizes the string ’ab’ as : p→q→s (‘ab’- not belongs to L)
• Therefore, Option (C) is correct. State p recognizes empty string as well as even numbers
of a’s and b’s
16(Q15) Let L be any language. Define even(W) as strings obtained by extracting from
W the letters in the even-numbered positions and even(L) = { even(W) | W L}. WeԐ
define another language Chop(L) by removing the two leftmost symbols of every
string in L given by Chop(L) = { W | vW L, with |v| = 2 }. If L is regular languageԐ
then: [June 2014-Paper-III]
(A)even(L) is regular and Chop(L) is not regular.
(B) Both even(L) and Chop(L) are regular.
(C) even(L) is not regular and Chop(L) is regular.
(D) Both even(L) and Chop(L) are not regular.
Solution
even(W) ={W | letters in the even numbered positions of W}
Consider the regular expression r=(a*b*)*
L(r)={ ,a,b,aa,ab,ba,bb,…,aaaa,aaab,aabb,abbb,abaa,abab,baaa,bbaa,bbba,…}Ԑ
q r sp
7. (i) Let W= ‘abaa’
even(W)=’ba’ € L, Therefore even(L) –is regular.
(ii) Let W=’abbababb’ ,Chop(W)=’bababb’ € L, v=’ab’
Chop(L)={W |vW vW L, with |v| = 2 }-is also regularԐ
17. (Q24). Regular expression for the complement of language L={ an
bm
| n≥4, m≤3} is:
[ Dec’ 2014-Paper-III]
(A)(a+b)*ba(a+b)* (B) a*bbbbb*
(C) ( +a+aa+aaa)b*+(a+b)*ba(a+b)*(Key)ƛ (D) None of the above.
Language L defined as: L=aaaaa*(( +b+bb+bbb)ƛ
18. (Q20). The regular expression corresponding to the language L where
L={x {0,1}* | x ends with 1 and does not contain substring 00} is:[Ԑ Jun’2015-Paper-
III]
(1) (1+01)* (10+01) (2) (1+01)*01 (3) (1+01)* (1+01) (4) (10+01)* 01
19(Q16).Assume, L is regular language, Let statements S1 and S2 be defined as :
S1: SQRT(L) = {x | for some y with |y|=|x|2
, xy € L}.
S2: LOG(L) = {x | for some y with |y|=2|x|
, xy € L}.
Which of the following is true? (September 2013-Paper-III)
(A) S1 is correct and S2 is not correct.
(B) Both S1 andS2 are correct.
(C) Both S1 andS2 are not correct.
(D) S1 is not correct and S2 is correct.
Explanation:
r={ an
| n≥0}
L={ ,a,aa,aaa,aaaa,aaaaa,aaaaaa,….}ƛ
SQRT(L)
Let x=aa and y= aaaa
|y| = |x|2
(i.e., |y|=4 and |x|=2.)
LOG(L)
Let x=aaa and y= aaaaaaaa
|y|=2|x|
(i.e., |y|=8 and |x|=3.)
Therefore, Option (B) Both S1 andS2 are correct.
20(Q17). A regular grammar for the language L={ an
bm
|n is even and m is even } is given
by: (September 2013-Paper-III)
(A) S→aSb | S1; S1→bS1a | ƛ
(B) S→aaS | S1; S1→bSb | ƛ
8. (C) S→aSb | S1; S1→S1ab | ƛ
(D) S→aaS | S1; S1→bbS1 | ƛ
Explanation:
Each production of regular grammar should have the following restrictions:
1. Left-hand side of each production should contain only one non-terminal.
2. Right hand side can contain at most one non-terminal symbol which is allowed to
appear as the right most symbol or left most symbol
Therefore, Option (D) S→aaS | S1; S1→bbS1 | ƛ
Context Free Grammar
21(Q39). The following CFG: S→aB | bA, A→a | aS | bAA, B→b | bS | aBB
Generates strings of terminals that have: [June 2012, Paper-III]
(A) odd number of a’s and odd number of b’s
(B) even number of a’s and even number of b’s
(C)equal number of a’s and b’s
(D) not equal number of a’s and b’s
Solution
• Whenever replace/substitute B by corresponding production, it places a single b or abb or
bS makes equal number of a’s and b’s.
• Whenever replace/substitute A by corresponding production, it places a single a or baa or
aS makes equal number of a’s and b’s.
22(Q7) The ‘C’ language is: [December 2012, Paper-II]
(A) Context free language (B) Context sensitive language
(C) Regular language (D) None of the above.
23(Q42) The Grammar ‘G1’
S→ 0S0 | 1S1 | 0 | 1 | ε and the grammar
‘G2’ is
S→ aS | aSb | X, X→Xa | a.
Which is the correct statement? [December 2012, Paper-III]
(A) G1 is ambiguous, G2 is un ambiguous (B) G1 is unambiguous, G2 is ambiguous
(C) Both G1and G2 are ambiguous (D) Both G1and G2 are unambiguous
24(Q21/Q73) Given the production rules of a grammar G1 as
S1→AB |aaB, A→ a | Aa, B→b and the production rules of grammar,
G2 as
9. S2→ a S2 b S2 | b S2 a S2 | ƛ
Which of the following is correct statement? [June 2013, Paper-II/June 2014, Paper-III]
(A) G1 is ambiguous, G2 is not ambiguous (B) G1 is ambiguous and G2 is ambiguous
(C) G1 is not ambiguous, G2 is ambiguous (D) G1 is not ambiguous and G2 is not ambiguous
25(Q75) Given the following two languages:
L1: {an
bn
| n≥1} U {a}
L2: {wcwR
| w € {a, b}* }
Which statement is correct?[June 2014, Paper-III]
(A) Both L1 and L2 are not deterministic.
(B) L1 is not deterministic and L2 is deterministic.
(C) L1 is deterministic and L2 is not deterministic
(D) Both L1 and L2 are deterministic
Solution
Both are CFG as
L1 is generated by the grammar: S→aSb | ab
L2 is generated by the grammar: S→aSa | bSb | c
26(Q63) Given the following grammar
G1: S→AB |aaB, A→ aA | ε, B→bB | ε
G2: S→ A | B, A→aAb | ab, B→abB | ε
Which of the following is correct statement? [June 2015, Paper-III]
(1) G1 is ambiguous and G2 is unambiguous grammars
(2) G1 is unambiguous and G2 is ambiguous grammars
(3) Both G1and G2 are ambiguous grammars
(4) Both G1 and G2 are unambiguous grammars
Solution
Ambiguous
A context-free grammar is said to be an ambiguous grammar if there exists a string which
can be generated by the grammar in more than one way.
The string derived by more than one parse tree or, equivalently, more than one leftmost
derivation is called ambiguous grammar.
A context-free language is inherently ambiguous if all context-free grammars generating
that language are ambiguous.
10. Grammar G1
Consider the word w=’aab’
S S
A B a a B
a A b B b B
Ԑ
a A Ԑ
Ԑ
Therefore G1=is ambigious
Grammar G2
Consider the word w=’aab’
S S
A B
a b a b B
Ԑ
Therefore G2=is ambigious
Option (3) Both G1and G2 are ambiguous grammars- is correct
27(Q38) For every context free grammar (G) there exists an algorithm that passes any
w L(G)Ԑ in number of steps proportional to: [June 2013, Paper-III]
(A) ln|w| (B) |w| (C) |w|2
(D) |w|3
11. 28(Q17) Assume the statements S1 and S2 given as :
S1 : Given a context free grammar G, there exists an algorithm for determining whether
L(G) is infinite.
S2 : There exists an algorithm for determining whether two context free grammars
generate the same language.
Which of the following is true? [September 2013, Paper-II]
(A) S1 is correct and S2 is not correct
(B) Both S1 and S2 are correct
(C) Both S1 and S2 are not correct
(D) S1 is not correct and S2 is correct
29(Q40) The statements S1 and S2 are given as :
S1 : Context sensitive languages are closed under intersection, concatenation,
substitution and inverse homomorphism.
S2 : Context free languages are closed under complementation, substitution and
homomorphism.
Which of the following is correct statement? [June 2013, Paper-III]
(A) Both S1 and S2 are correct (B) S1 is correct and S2 is not correct
(C) S1 is not correct and S2 is correct (D) Both S1 and S2 are not correct
30(Q27) The context free grammar for the language L={ an
bm
| n≤m+3, n≥0, m≥0} is:
[December 2013, Paper-II]
(A) S→aaaA; A→aAb | B, B→Bb | ƛ
(B) S→aaaA | ;ƛ A→aAb | B, B→Bb | ƛ
(C) S→aaaA | aaA | ;ƛ A→aAb | B, B→Bb | ƛ
(D) S→aaaA | aaA | aA | ;ƛ A→aAb | B, B→Bb | ƛ
Solution
For m=0, n=0,1,2,3
L={a0
,a1
,a2
,a3
}={ , a,aa,aaa}ƛ
• Option (A) does not recognize ,aƛ , and aa. So it is not CFG for given L.
12. • Option (B) does not recognize a, and aa. So it is not CFG for given L.
• Option (C) does not recognize a. So it is not CFG for given L.
• Option (D) recognize ,aƛ , and aa. So it is correct CFG for given L→Correct option
31(Q21) Given the following statements:
S1: The grammars S→aSb | bSa | SS | a and S→aSb |bSa | a are not equivalent.
S2: The grammars S→SS | SSS | aSb | bSa | ƛ and S→SS | aSb | bSa | ƛ are
equivalent.
Which of the following is true? [ December 2013, Paper-III]
(A) S1 is correct and S2 is not correct (Key)
(B) Both S1 and S2 are correct
(C) S1 is not correct and S2 is correct
(D) Both S1 and S2 are not correct
Solution
The G1 in statement S1 can recognize string ‘aa’ but not by G2.
32(Q9) The context free grammar for the language L={ an
bm
ck
| k=|n-m|,n≥0, m≥0 ,k ≥0}
is: [June 2014, Paper-II]
(A) S→S1S3, S1→aS1c | S2 | ,ƛ S2→aS2b| ,ƛ S3→aS3b | S4 | , Sƛ 4→bS4c | ƛ
(B) S→S1S3,; S1→aS1S2c| ,ƛ S2→aS2b| ,ƛ S3→aS3b | S4 | Sƛ 4→bS4c | ƛ
(C) S→ S1 |S2; S1→aS1S2c| ,ƛ S2→aS2b| ,ƛ S3→aS3b | S4 | Sƛ 4→bS4c | ƛ
(D) S→ S1 |S3; S1→aS1c | S2 | ,ƛ S2→aS2b | ,ƛ S3→aS3b | S4 | Sƛ 4→bS4c | ƛ
(Key but wrong)
S→S1S3→aS1cS3→acS3→acaS3b→acab
Explanation
Case 1: n>m
k=n-m
n=k+m.
L1=an
bm
ck
= ak
am
bm
ck
.
S1→a S1 c | S2 | ƛ
S2→a S2 b | ƛ
Case 1: n=m
k=0
L2=an
bn
.
S3→a S3 b | ƛ
Case 3: m>n
k=m-n
13. m=n+k
L3=an
bm
ck
= an
bn
bk
ck
.
S4→S5 S6
S5→a S5 b | ƛ
S6→b S6 c | ƛ
Hence, L1 U L2 U L3
S→ S1 | S3 | S5
S1→a S1 c | S2 | ƛ
S2→a S2 b | ƛ
S3→a S3 b | ƛ
S4→S5 S6
S5→a S5 b | ƛ
S6→b S6 c | ƛ
S2,S3 and S5 are same
S→ S1 | S3
S1→a S1 c | S2 | ƛ
S2→a S2 b | ƛ
S3→ S2 S4
S4→b S4 c | ƛ
33(Q33) If all the production rules have single non-terminal symbol on the left side, the
grammar defined is: [June 2015, Paper-II]
(1) context free grammar (2) context sensitive grammar.
(3) unrestricted grammary (4) phrase grammar
34(Q32) The equivalent grammar corresponding to the grammar
G: S→aA, A→BB, B→aBb | is : [Ԑ June 2012, Paper-III]
(A) S→aA, A→BB, B→aBb
(B) S→a | aA, A→BB, B→aBb | ab
(C) S→a | aA, A→BB | B, B→aBb
(D) S→a | aA, A→BB | B, B→aBb | ab
35(Q61)A context free grammar for L= {w | n0(w) > n1(w)} is given by[June 2015, Paper-III]
(1) S→0 | 0S | 1SS (2) S→ 0S | 1S |0SS | 1SS | 0 | 1
(3) S→0 | 0S | 1SS | S1S | SS1 (4) S→ 0S | 1S | 0 | 1
36(Q50) Which of the following definition generates the same language as L, where
L={WWR
| W {a,b}*}: [Ԑ December 2012, Paper-III]
(A) S→aSb | bSa | Ԑ (B) S→aSa | bSb | Ԑ
(C) S→aSb | bSa | aSa | bSb | Ԑ (D) S→aSb | bSa | aSa | bSb
Solution
• Each occurrences of S replaced by terminal symbol either ‘aa’ or ‘bb’ or ‘ ’.Ԑ
• This ensure WWR
37(Q36) The grammar with production rules S→aSb | SS | generates language L givenƛ
by: [June 2012, Paper-III]
(A) L={w {a,b}* | nԐ a(w) = nb(w) and na(v) ≥ nb(v) where v is any prefix of w }
(B) L={w {a,b}* | nԐ a(w) = nb(w) and na(v) ≤ nb(v) where v is any prefix of w }
(C) L={w {a,b}* | nԐ a(w) ≠ nb(w) and na(v) ≥ nb(v) where v is any prefix of w }
(D) L={w {a,b}* | nԐ a(w) ≠nb(w) and na(v) ≤ nb(v) where v is any prefix of w
14. Solution
Consider the word w= ‘aababb’ recognized by the language
Prefixes are a,aa,aab,aaba.aabab, and aababb,
Hence, na(v) ≥ nb(v) where v is any prefix of w.
38(Q18).Givem The following productions of a grammar:
S→aA | aBB;
A→aaA | ;ƛ
B→bB | bbC;
C→B
Which of the following is true? [September 2013, Paper-III]
(A) The language corresponding to the given grammar is a set of even number of a’s.
(B) The language corresponding to the given grammar is a set of odd number of a’s.
(C) The language corresponding to the given grammar is a set of even number of a’s followed
by odd number of b’s
(D) The language corresponding to the given grammar is a set of oddnumber of a’s followed
by even number of b’s
Explanation
• The production rule 2 (i.e. S→aBB) does not recognize any string because non-
terminalB and C does not have production with only terminal(s).
• The production rule 1 (i.e. S→aA) only recognize odd number of a’s.
39(Q20).The language L = {an
bn
am
bm
| n≥0, m≥0} is [September 2013, Paper-III]
(A)Context free but not linear (B) Context free and linear
(C) Not Context free and not linear (D) Not Context free but linear
40(Q35). The following context free grammar (CFG):
S→aB | bA
A→a | aS | bAA
B→b |bS | aBB
Will generate [December 2014, Paper-II]
(A)Odd numbers of a’s and odd numbers of b’s.
(B) even numbers of a’s and even numbers of b’s.
(C)equal numbers of a’s and b’s.
(D)different numbers of a’s and b’s.
Pumping Lemma
41(Q40) Pumping lemma for context free languages states:
Let L be an infinite context free language. Then there exists some positive integer m
15. such that any w L with |w| ≥ m can be decomposed as w=uv xy Z with |vxyԐ | and
|vy| such that uvz
xyz
Z L for all z=0,1,2,… : [Ԑ December 2012, Paper-III]
(A) ≤m, ≤1 (B) ≤m, ≥1 (C) ≥m, ≤1 (D) ≥m, ≥1
42(Q23) Given two languages:
L1 = { (ab)n
ak
| n>k, k ≥0 }
L2 = { an
bm
| n≠m }
Using Pumping lemma for regular language, it can be shown that:[ Dec’2014, Paper-III].
(A) L1 is regular and L2 is not regular.
(B) L1 is not regular and L2 is regular.
(C) L1 is regular and L2 is regular.
(D) L1 is not regular and L2 is not regular.
43(Q63) :[ Dec’2014, Paper-III].
Please refer Q40 in Dec’2012, Paper-III.
Chomsky Normal Form
Every production in Griebach Normal form should be:
A→BC (or)
A→a
Where A,B, and C are variables( Non-terminals),
a-is a terminal
• On the right hand side you can have either two terminals or a single terminal.
44(Q53) If the parse tree of a word w generated by a Chomsky normal form grammar
has no path of length greater than I, then the word w is of length[Dec’2012, Paper-III]
(A)No greater than 2i+1
.
(B) No greater than 2i
.
(C)No greater than 2i+1
.
(D)No greater than i.
Greibach Normal Form
Every production in Griebach Normal form should be:
A→aα
Where A-is a variable( Non-terminal),
a-is a terminal and
α-is a only zero or more Variables (Non-terminals)
Example:
A→a | aBC | bC
16. B→b
C→c
45(Q28) Which one of the following is not a Greibach Normal form grammar?
[June 2012,Paper-III]
(i) S→ a | bA | aA |bB, A→a, B→b
(ii) S→ a | aA | AB, A→a, B→b
(iii) S→ a | A | aA, A→a
(A) (i) and (ii) (B) (i) and (iii) (C) (ii) and (iii) (D) (i), (ii) and (iii)
46(Q41) The Greibach Normal form grammar for the language L={an
bn+1
| n≥0} is
[December 2013,Paper-III]
(A) S→aSB, B→bB | ƛ
(B) S→aSB, B→bB | b
(C) S→aSB | b, B→b
(D) S→aSb | b
Pushdown Automata
47(Q37) A pushdown automation M=(Q, ∑, Γ, δ, q0,Z, F) is set to be deterministic subject
to which of the following condition(s), for every q €Q, a €∑ U { } and b € Γƛ
S1: δ(q,a,b) contains at most one element
S2: If δ(q, ,b) is not empty then δ(q,c,b) must be empty for every c € ∑.ƛ
[June 2013,Paper-III]
(A) Only S1 (B) Only S2 (C) Both S1 and S2 (D) Neither S1 nor S2
48(Q22) The pushdown automation M=( {q0,q1,q2},{a,b},{0,1}, δ, q0,0, {q0} ) with
δ(q0,a,0) = { q1, 10}
δ(q1,a,1) = { q1, 11}
δ(q1,b,1) = { q2, }ƛ
δ(q2,b,1) = { q2, }ƛ
18. δ(q0,a,S) = { (q1, SS) , (q1, B) };
δ(q0,b, ) = { (qƛ 1, B) }
δ(q1, ,z) = { (qƛ 1, ) }ƛ
Solution
Given,
S→aSS | ab
Let us consider the input string: aabab
(A) (B)
Initial: (q0, ƛaabab, z) (q0, ƛaabab, z)
→(q0, aabab, z) →(q0, aabab, Sz) [ z→Sz]ƛ
(no match for az→?) →(q1, abab, SSz) [aS→SS]
→(q1, bab, BSz) [aS→B]
→(q1, ab, Sz) [bB→ ]ƛ
→(q1, b, Bz) [aS→B]
→(q1, ƛ, z) [bB→ ]ƛ
→(q1, , ) [ z→ ]ƛ ƛ ƛ ƛ
(Accepted)
51(Q16) Given the following statements:
(i) The power of deterministic finite state machine and non-deterministic finite state
machine are same.
(ii) The power of deterministic pushdown automation and non-deterministic pushdown
automation are same.
Which of the above is the correct statement(s)? [June 2012, Paper-III]
(A)Both (i) and (ii) (B) Only (i) (C) only (ii) (D) Neither (i) nor (ii)
1. (Q1)Which of the following is not true? [June 2005, Paper-II]
(A) Power of deterministic automata is equivalent to power of non-deterministic automata.
(B) Power of deterministic pushdown automata is equivalent to power of non-deterministic
pushdown automata.
(C) Power of deterministic Turing machine is equivalent to power of non-deterministic Turing
q
0
q
1
ƛz→z z→ƛ ƛ
aS→SS
aS→B
bB→ƛ
q
0
q
1
ƛz→Sz z→ƛ ƛ
aS→SS
aS→B
bB→ƛ
19. machine.
(D) All the above
Answer: B
Recursive, Recursive Enumerable
52(Q40). Consider the following statements:
I. Recursive languages are closed under complementation.
II. Recursively enumerable languages are closed under union.
III. Recursively enumerable languages are closed under complementation
Which of the above statements are true? [June 2012, Paper-II]
(A) I only (B) I and II (C) I and III (D) II and III
53(Q57). Given the following statements:
(i) Recursive enumerable sets are closed under complementation.
(ii) Recursive sets are closed under complementation..
Which is/are the correct statements? [December 2012, Paper-III]
(A) Only (i) (B) Only (ii) (C) Both (i) and (ii) (D) Neither (i) nor (ii)
54(Q42). Given the following statements
S1: Every context-sensitive language L is recursive.
S2: There exists a recursive language that is not context sensitive.
Which statement is correct? [December 2013, Paper-III]
(A) S1 is not correct and S2 is not correct
(B) S1 is not correct and S2 is correct
(C) S1 is correct and S2 is not correct
(D) S1 is correct and S2 is correct
55(Q21). Assume statements S1 and S2, defined as
S1: L2-L1 is recursive enumerable where L1 and L2 are recursive and recursive
enumerable respectively
S2: The set of all Turing machines is countable.
Which of the following is true? [September 2013,Paper-III]
(A) S1 is correct and S2 is not correct
(B) Both S1 and S2 are correct
(C) Both S1 and S2 are not correct
(D) S1 is not correct and S2 is correct
20. Reason
• Every recursive language is recursive enumerable. Hence statement S1 is correct.
Recursive enumerable Language L2
• Turing Machines are composite, hence they are countable
Output
Input
56(Q61). Given the recursively enumerable language (LRE), the context sensitive language
(LCS), the recursive language (LREC), the context free language(LCF), and deterministic
context free language(LDCF). The relationship between these families is given by
[December 2014, Paper-III]
(A)LCF € LDCF € LCS € LRE € LREC
(B) LCF € LDCF € LCS € LREC € LRE
(C) LDCF € LCF € LCS € LRE € LREC
(D)LDCF € LCF € LCS € LREC € LRE
Solution
Recursive Enumerable
L2-L1
Recursive Language L1
TM
1
TM
2
TM
3
TM
n…
REC
CS
CF
DCE
21. 57(Q62) Given the following two statements:
S1 : If L1 and L2 are recursively enumerable languages over ∑, then L1 U L2 and L1 ∩
L2 are also recursively enumerable.
S2 : The set of recursively enumerable languages is countable.
Which of the following is correct?[June 2015, Paper-III]
(1) S1 is correct and S2 is not correct
(2) S1 is not correct and S2 is correct
(3) Both S1 and S2 are not correct
(4) Both S1 and S2 are correct
Match the following
58(Q52/Q62). Match the following:[June 2012/December 2014, Paper-III]
(i) Regular Grammar (a) Pushdown automation
(ii) Context free Grammar (b) Linear bounded automation.
(iii) Unrestricted Grammar (c) Deterministic finite automation.
(iv) Context Sensitive Grammar (d) Turing machine.
(i) (ii) (iii) (iv)
(A) (c) (a) (b) (d)
(B) (c) (a) (d) (b)
(C) (c) (b) (a) (d)
(D) (c) (b) (d) (a)
59(Q39). Match the following:[June 2013, Paper-III]
(a) Context sensitive language i . Deterministic finite automation.
(b) Regular Grammar ii. Recursive enumerable.
(c) Context free grammar iii. Recursive language
(d) Unrestricted Grammar iv. Pushdown automation
.
(a) (b) (c) (d)
(A) ii i iv iii
22. (B) iii iv i ii
(C) iii i iv ii
(D) ii iv i iii
60(Q74) Match the following:[June 2013, Paper-III]
List-I List-II
a. Chomsky Normal form i. S→bSS | aS |c
b. Griebach Normal form ii. S→aSb | ab
c. S-grammar iii. S→AS |a; A→SA | b
d. LL grammar iv. S→aBSB; B→b
Codes:
a b c d
(A) iv iii i ii
(B) iv iii ii i
(C) iii iv i ii
(D) iii iv ii i
Closure properties on languages
operation REG DCFL CFL CSL RC RE
union Y N Y Y Y Y
intersection Y N N Y Y Y
set difference Y N N Y Y N
complementation Y Y N Y Y N
intersection with a regular language Y Y Y Y Y Y
concatenation Y N Y Y Y Y
Kleene star Y N Y Y Y Y
Kleene plus Y N Y Y Y Y
reversal Y Y Y Y Y Y
homomorphism Y N Y N N Y
inverse homomorphism Y Y Y Y Y Y
substitution Y N Y N N Y
rational transduction Y N Y N N Y
right quotient with a regular language Y Y Y N Y
left quotient with a regular language Y Y Y N Y