0% found this document useful (0 votes)
82 views10 pages

Toc Gtu

1. The document contains practice questions on regular expressions and finite automata. 2. It includes questions to convert regular expressions to NFAs/DFAs, minimize DFAs, apply pumping lemma, and describe languages using regular grammars. 3. There are also questions involving set operations on regular languages like union, intersection, difference and properties of regular languages.

Uploaded by

jlo
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)
82 views10 pages

Toc Gtu

1. The document contains practice questions on regular expressions and finite automata. 2. It includes questions to convert regular expressions to NFAs/DFAs, minimize DFAs, apply pumping lemma, and describe languages using regular grammars. 3. There are also questions involving set operations on regular languages like union, intersection, difference and properties of regular languages.

Uploaded by

jlo
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/ 10

1.

Darshan ch 1 - 10 pgs
2. Relations question practice:
3, 8, 9, 11, 17, 20, 26, 29, 31, 32, 33, 34
3. TOPIC 2 : 3, 10, 21, 24, 26

Ch : 2

Regular Expression :

38. Strings that do not end in 01.


^ + 0 + 1 + [(0+1)* (00+11+10)]
39. String that start with 1 and do not end in 10
1 (0+1)* (00 + 11 + 01 + 1)
40. String do not contain substring 110
0* (100*)* 1*
41. Strings containing both 101 and 010 as substrings
(0+1)* [(101 (0+1)* 010) +
(010 (0+1)* 101) +
(1010) +
(0101)] (0+1)*
42. Strings in which both no of 0’s and no of 1’s are odd.
43. Strings in which both no of 0’s and no of 1’s are even.
(00 + 11 + (01+10) (00+11)* (01+10))*
44. Strings that do not end in 11.
^ + 0 + 1 + [(0+1)* (00 + 10 + 01)]
45. Strings containing at least two zeros
(1+0)*0(1+0)*(1+0)*
46. Strings begin with 00 and ends with 11.
00 (1+0)* 11
47. Strings contain alternate 0 and 1.
(01)* OR (10)*
48. Strings begins or ends with 00 or 11.
[(00+11) (0+1)*] + [(0+1)*(00+11)]
49. Strings in which every 0 is followed immediately by 11.
(011+1)*
50. Strings begin with 1 and end with 0.
1(0+1)*0
51. Strings with second last character ‘a’.
(a+b)*a(a+b)
52. String consisting exactly two 0’s.
1* 0 1* 0 1*
53. Strings ending with 1 and not containing 00.
54. String ending in 11 or 10.
(1+0)* (11+10)
54. College material.
55. RE for the FA :
2. L1 U L2 L1 ∩ L2 L2 – L1
Finite Automata :
1. (111 + 100) * 0
2. (11 + 110) * 0
3. (11)* (00)*
4. (a+b)* baaa
5. 1(01 + 10)* + 0(11 + 10)*
6. (010 + 00)*(10)*
3. L1 U L2, L1 ∩ L2, L1 - L2, L1 ∩ L3, L3 - L2
7. (0+1)(01)*(011)*
8. (0+1)*(1+00)(0+1)*
9. (0+1)*(01+110)
10. (0+1)*(10+11)
11. String of length at least one, and divisible by 3.
12. String with last-second character 0.
13. String with odd no of 0’s and odd number of 1’s.
14. String with even no of 1’s & even number of 1’s
15. String ending in 10 or 11.
16. String end in 1 and not contain 00. 4. L1 U L2 L1 ∩ L2 L2 – L1
17. String contains 110111
18. String contains 101
19. String do not contain 110.
20. String contain odd no of 0’s & ends with 00.
21. String ends with 11.
22. String ends with 01.
23. String not ending with 01.
24. String containing bba.
25. String doesnot contain 00
26. String ends with abba.
27. L1 = String do not contain 00.
L2 = String ends with 01. 5. L1 U L2 L1 ∩ L2 L2 – L1
(a) L1 - L2 (b) L1 ∩ L2
28. L1 = String do not contain 11.
L2 = String ends with 10.
(a) L1 - L2 (b) L2 - L1 (c) L1 ∩ L2
29. L1 = String with a double ‘a’
L2 = String with even number of ‘a’
(a) L1 - L2 (b) L1 ∩ L2
30. L1 = String does not contain 11.
L2 = String start and end with 0. 1. Dead end state
(a) L1 - L2 (b) L2 - L1 (c) L1 ∩ L2 2. Define regular grammar
3. Define FA & recursive definition of NFA.
4. Prove that any Regular Language can be
accepted by FA.
5. Finite state machine with outputs.
1. L1 ∩ L2 L1 – L2 6. Closure properties of regular languages.
7. Properties of distinguishability.
8. Mealy to moore :
9. Moore to mealy :

2.

3.

4.

10. Moore for residue number 3 for binary number.


11. Moore for 1’s complement of binary number
12. Mealy that outputs 1 if abb comes, otherwise 0.
13. Kleene’s theorem part - I
14. 36, 61

5.

Minimize:

6.

1.
5.

7.

6.
NFA-^ to NFA / DFA:

7.

1.

8.

2.
9.

3.

10.

4.
Draw NFA-^ :
1. (00 + 1)* (10)*
2. 001*0*11
3. (0 + 1)* (10+01)* 11
4. (0+1)*(011+01010)(0+1)*
5. (0+1)(01)*(011)*
6. (0*10+1*0)(01)*
7. (010)*1 + (1*0)*
8. (0 + 1)*1(0 + 1)
9. ((0+1)*10 + (00)*)* using kleene’s theorem
10. ({0,1}*{10} U {00}*{11}*) * using kleene’s

11.
1. Pumping lemma & its applications
2. Pumping lemma to show that L is not regular :
a. L = {ww | w ϵ {0,1}*}
b. L = {ww r | w ε {0,1}*}
c. L = {0 n: n is a prime number}
d. L = {o n 12n | n > 0}
e. L = {0 i 1i | i >= 0}
f. L = {a n bn abn+1 | n > 0}
3. Prove that if L1 and L2 are regular languages
12. then L1∩ L2 is also a regular language
4. NFA & recursive definition of NFA-^
5. What is pumping lemma & equivalence relation
6. Kleene’s theorem part 1 & part 2
7. Give recursive definitions of regular expressions.
State the hierarchy of operators of regex.
8. Recursive definitions of extended transition
13. functions δ* for DFA, NFA, NFA-^
9. Compare FA, NFA, NFA-^
10. Mealy vs Moore machines.

14.

15.
1. an bn, variations 12. (0+1)1*(1+(01)*)
S → AB S → ABC
A → aA | ^ A→0|1
B → bB | ^ B → 1B | ^
C→1|E
2. L = {ai bj | i < 2j} E → 01E | ^
S → Sb | aSb | ^
13. (01*1 + 1)* (01)*
3. an+2 bn | n >= 0 S → AB
S → aSb | aa A → 0C1 | 1
C → 1C | ^
4. n(a) = n(b) B → 01B | ^
S → aSb | bSa | ^ doubt
14. (a + b) (a + b + 0 + 1)*
5. n(a) ≠ n(b) S → AB
S→A A→a|b
S→B B → ( a | b | 0 | 1 )B
A → aA | a
A → aAb 15. Palindromes
B → bB | b S → aSa | bSb | a | b | ^
B → aBb

6. j = i or j = k 16. Non-palindromes
For : i = j For j = k S → ASA | B
S → AB S → BC B → aTb | bTa
A → aAb | ab B → aB | a T → ATA | A | ^
B → cB | c C → cCb | bc A→a|b

7. i ≠ j + k 17. Algebraic expressions


E → int
8. i = j + k E → E Op E
S → aSc | A E → (E)
A → aAb | ^ Op → + | - | * | /

9. j > i + k 18. Balanced parenthesis


S → ABC S → (S)
A → aAb | ^ S → SS
B → bB | b S→^
C → bCc | ^
19. Odd length strings with middle symbol a
10. 0i 1j 0k, j > i + k S → TaT
S → ABC T→a|b|^
A → 0A1 | ^
B → 1B | 1 20. Even length strings with two middle symbol
C → 1C0 | ^ S→ (a | b | c | d) S (a | b | c | d) | aa | bb | cc | dd

11. (011 + 1)* (01)* 21. w with at least three 1s


S → AB S → A1A1A1A
A → 011A | 1A | ^ A → 0A | 1A | ^
B → 01B | ^
22. w start & end with same symbol
S → 0A0 | 1A1
Derivation : A → 0A | 1A | ^
10, 14, 16, 41, 48, 70, 81
23. Describe the language it accepts: Y → aXY | bb | Xxa
a. S → SS | XaXaX | ^ l. S→ASB | SAB
X → bX | ^ A→ BC
b. S → aM | bS B→ bB | c
M → aF | bS C→e
F → aF | bF | ^ m. S →ASB | Λ
c. S → aS | bS | a | b | ^ A → aAS | a
d. S →aA | bC | 𝑏 B → SbS | A | bb
A →𝑎𝑆 | bB n. S → aY | Ybb | Y
B →𝑎𝐶 | bA | 𝑎 X → /\ | a
C →aB | bS Y → aXY | bb | Xxa
e. S → aT | bT | Ʌ o. S → AaA | CA | BaB
T →aS | bS A → aaBa | CDA | aa | DC
B → bB | bAB | bb | aS
C → Ca | bC | D
D → bD | ɛ
24. Find CFG G’ in CNF L(G) - {} : p. S → ASA | aB
a. S → SS | A | B A→B|S
A → SS | AS | a B → b | ε.
B → /\ q. S -> 0A0 | 1B1 | BB
b. S → S(S) | ^ A -> C
c. S → aY | Ybb | Y B -> S | A
X → /\ | at C -> S | ɛ
Y → aXY | bb | Xxa r. S→ AACD
d. S → AA A →aAb | Λ
A → B | BB C→ aC | a
B → abB | b | bb D→ aDa | bDb | Λ
e. S → A | B | C s. S → TU | V
A → aAa | B T → aTb | Ʌ
B → bB | bb U → cU | Ʌ
C → aCaa | D V → aVc | W
D → baD | abD | aa W→ bW | Ʌ
f. S → AaA | CA | BaB t. S -> AaA | CA | BaB
A → aaBa | CDA | aa | DC A -> aaBa | DC
B → bB | bAB | bb | aS B -> bb | aS
C → Ca | bC | D C -> Ca | bC | D
D → bD | Λ D -> bD | Λ
g. S → bA|aB u. S → aX | Y | bab
A → bAA|aS|a X→^|Y
B → aBB|bS|b Y → bb | bXb
h. S → aAbB
A → Ab | b 14, 16, 14, 25, 26, 27, 28, 30, 46, 54, 63,
B → Ba | a
i. S → AACD
A → aAb|ᴧ 25. Top down vs bottom up
C → aC|a 26. Derivation tree, expression tree, ambiguity
D → aDa|bDb|ᴧ 27. Union, concatenation
j. S -> AaA|CA|BbB 28. CFG, CNF
A -> aaBa|CDA|aa|DC 29. Prove: There are context-free languages L1 and
B -> bB|bAB|bb|aS L2 so that L1 ∩ L2 is not a CFL and there is a
C -> Ca|bC|D CFL L so that L’ is not a CFL.
D -> bD|ᴧ 30. Write theorem: If L1 and L2 are context-free
k. S → aY | Ybb | Y languages, then the languages L1 U L2, L1L2
X → /\ | a and L1* are also CFLs
31. Use the pumping lemma to show that following j.
language is not regular: L = {xy|x,y ϵ {0,1}* and y 1. 0n 1n, n >= 1
is either x or xr} 2. an bn cn, n >= 1
32. Regular vs context-sensitive grammar 3. Palindrome ( even & odd both )
33. Decide whether the given language is a CFL, 4. ss , (s in {a,b}*)
and prove your answer. L = { xyx | x, y ϵ {a, b}* 5. Copy strings
and |x| ≥ 1} 6. Copy strings + delete symbol
34. Prove that the context-free languages are closed 7. n(a) = n(b) = n(c), n >=0 / n >= 1
under union 8. Equal no of a and b
35. Prove that the following CFG is Ambiguous and 9. Delete nth symbol from w
convert it into unambiguous. Derive parse trees 10. {a,b} *{aba}{a,b} *
a. S → S + S | S * S | (S) | a 11. aba as substring
b. S → S + S | S * S | a | b 12. Ends with aba
c. S → S + S | S * S | a 13. Universal TM
d. S → a | Sa | bSS | SSb | SbS 14. Halting, Church Turing thesis
e. S → ABA 15. Recursive language & REL
A → aA | ɛ 16. Chomsky hierarchy
B → bB | ɛ 17. Post machines
f. S → A | B 18. PDA vs Turing
A → aAb | ab 19. Develop a Turing Machine that creates a copy of
B → abB | ^ its input string to the right of the input but with a
g. S → A | B blank space separating the copy from the
A →aAb | aabb original
B →abB | Ʌ
h. 14, 67, 76
i.
1. an bn 22. PDA vs FSM
2. an bn+m am 23. PDA vs NPDA
3. am b2m, m >= 1 24.
4. n(a) = n(b)
5. n(a) = 2n(b)
6. n(a) > n(b) 52
7. n(a) ≠ n(b)
8. n(a) < n(b) or n(a) < n(c)
9. Well-formed parenthesis
10. i+j=k
11. j = i or j = k
12. Palindrome
13. Palindrome with middle char “c”
14. Non palindrome
15. Prove : x = xr, can’t be accepted by any PDA
16. Odd length strings with middle symbol a
17. xcy, |x| = |y|
18. wwr

19. CFG to PDA :


a. S --> 0B| 1A
A --> 0S|1AA|0
B --> 1S| 0BB | 1
b. I → a | b | Ia | Ib | I0 | I1
E → I | E * E | E + E | (E)
c. S → 0AB
A → 1A | 1
B → 0B | 1A | 0
d. S → AB
A → BB
B → AB
A→a
e. S → [S] | SS | ^

20. PDA to CFG :


a. δ(q, 1, z) = (q, xz)
δ(q, 1, x) = (q, xx)
δ(q, ^, x) = (q,^)
δ(q, 0, x) = (p, x)
δ(p, 1, x) = (p, ɛ)
δ(p, 0, z) = (q, z)
b. δ(q0, ɛ, z0) = {(q1, ɛ)}
δ(q0, 0, z0) = {(q0, 0z0)}
δ(q0, 0, 0) = {(q0, 00)}
δ(q0, 1, 0) = {(q0, 10)}
δ(q0, 1, 1) = {(q0, 11)}
δ(q0, 0, 1) = {(q1, ɛ)}
δ(q1, 0, 1) = {(q1, ɛ)}
δ(q1, 0, 0) = {(q1, ɛ)}
δ(q1, ɛ, z0) = {(q1, ɛ)}
21. Using pumping lemma for CFL’s, show that
a. {am bm cn | m ≤ n ≤ 2m} is not CFL
b. {an bn cn | n ≥ 0 } is not a CFL
c. {ai bj ck | i < j < k} is not a CFL
Ch 6 : (technical full)

1. Time & space complexity


2. Halting problem
3. Church Turing thesis
4. μ Unbound minimization
5. Primitive Recursive functions
6. Undecidable problem
7. μ recursive function
8. Recursive languages & recursively enumerable
language
9. Define :
a. Basic complexity classes
b. Constant function
c. Successor function
d. Projection function
e. Initial function
f. Composition

10. Prove that add(x, y) = x + y is primitive recursive


function
11. Write theorem: Let f: Σ*1 Σ*2. Then f is
computable if and only if f is μ recursive.
12. A language is recursive if and only if both it and
its complement are recursively enumerable
13. Define the language L defined by the following
recursive definition over ∑ = {a, b}: ^ ∈ L; For
every x ∈ L, xa, bx, and abx are in L; Nothing
else is in L

Ch: 7 (technical full)

1. P & NP-Completeness
2. NP-hard
3. NP-complete
4. Sets of P, NP, Pspace, NPSpace
5. Cook’s theorem
6. Polynomial time reductions
7. Define :
a. P problem
b. NP problem
c. NP-Hard problem
d. NP-Complete problem

You might also like