Toc 1
Toc 1
Toc 1
Unit-1
Sr. No Questions
1. Define following:
1. Conjunction
2. Disjunction
3. Negation
4. Tautology
5. Composition
6. Inverse of function
2. Define one-to-one, onto and bijection function. Check whether the function
1. f: R→R, f(x) = x2 is one to one or onto.
2. f: R→R+, f(x) = x2 is one to one or onto.
3. f: R+→R, f(x) = x2 is one to one or onto.
4. f: R+→R+, f(x) = x2 is one to one or onto.
3. Define tautology and contradiction
Draw truth table for following logic formula:
1. P → (¬P V ¬Q). Is it a tautology? A contradiction? Or neither? Justify your answer.
2. (p v q) ^ (p→q) is tautology? A contradiction? Or neither? Justify your answer.
4. Explain reflexivity, symmetry, and transitivity properties of relations. OR
Define Equivalence Relation with its property. Check Equivalence Relation for given Ex.
1. A={1,2,3}, R = {(1, 3), (3, 1), (2, 2)}
2. A={1,2,3}, R = {(1, 1), (2, 2), (3, 3), (1, 2)}
3. R = Ø
4. A={1,2,3}, R = {(1,2), (1,1), (2,1), (2,2), (3,2), (3,3)}
5. Prove that √2 is irrational by method of contradiction.
6. Principle of Mathematical Induction (PMI).
1. Prove that for every n >= 1,
n
Σ i = n (n+1) / 2
i=0
2. Prove that for every n >= 1, 7 + 13 + 19 + . . . + (6n + 1) = n(3n +4)
3. Prove that for every n ≥ 1,
n
Σ 1 / i(i+1) = n/(n+1)
i=1
4. Prove that For every n >= 1,
n
Σ i2 = n (n+1)(2n+1)/ 6
i=1
5. Prove that 1 +3 +5 + … +r = n2 for all n>0 where r is an odd integer (Note : r = 2n-1)
6. Show that 2 n > n 3 for n >= 10 by Mathematical Induction.
7. Prove that for every n >= 0, n (n2 +5) is divisible by 6.
Sem-VI | Assignment-2
Unit-2
Sr. No Questions
1. Union, Intersection & Complement of Finite Automata.
1. Draw Finite Automata (FA) for following languages:
L1 = {x / 11 is not a substring of x, x Є {0,1}*}
L2 = {x / x ends with 10, x Є {0,1}* }
Find FA accepting languages (i) L1 ∩ L2 and (ii) L1 – L2 (iii) L1 U L2
2. Draw Finite Automata (FA) for following languages:
L1 = {x / 00 is not a substring of x }
L2 = {x / x ends with 01 }
Find FA accepting languages (i) L1 ∩ L2 and (ii) L2 – L1 (iii) L1 U L2
3. Let M1, M2 and M3 be the FAs pictured in Figure, recognizing languages L1, L2 and
L3, respectively. Draw FAs recognizing the following languages.
a. L1 U L2
b. L1 ∩ L3
2.
Λ a b c
→p Ø {p} {q} {r}
q {p} {q} {r} Ø
3160704 - TOC
5.
6.
7.
4. For the following Regular Expression draw an NFA- Λ recognizing the corresponding
languages.
1. (00 + 1)* (10)*
2. 001*0*11
3. (0 + 1)* (10+01)* 11
2
3160704 - TOC
4. (0 + 1)*1(0 + 1)
5. (0 + 1)* (10+110)* 1
5. Prove: Any Regular Language can be accepted by a finite automaton
(Kleene’s Theorem, Part - I)
6. Minimize DFA for given example.
3
3160704 - TOC
2.
Present Next State Output
State 0 1
→p0 r q0 ε
p1 r q0 1
q0 p1 s0 0
q1 p1 s0 1
r q1 p1 0
s0 s1 r 0
s1 s1 r 1
3.
4
Sem-VI | Assignment-3
Unit-3
Sr. No Questions
1. Explain Chomsky hierarchy,
Find CFG for the following languages.
1. L = { ai bj ak | j > i + k }
2. L = { ai bj ck | i = j or j = k }
3. L = { 0i1j0k | j > i + k }
4. (011 +1)* (01)*
5. L=(0+1)1*(1+(01)*)
6. L = a*b*
7. {aibjck | i=j+k}
2. 1. For string aaabbabbba, find Left most derivation and Right most derivation.
S→ aB|bA
A→a|aS|bAA
B→b|bS|aBB
2. Derive left most and right most derivation of string aabbaa using given grammar.
S→aAS|a
A→SbA|SS|ba
3. Define CFG. When a CFG is called an ‘ambiguous CFG’? Explain with example.
S →a|Sa|bSS|SSb|SbS S→ABA, S →ABA
A→aA | ε A →aA | Ʌ
B→bB | ε B →bB | Ʌ
S→A|B S→S+S|S*S|a|b
A →aAb | aabb Write the unambiguous CFG based on precedence
B →abB | Ʌ rules for the above grammar.
Derive the parse tree for expression (a + a)*b
4. Explain Union Rule and Concatenation Rule for Context-Free Grammar.
5. Define CNF and Convert following CFG to equivalent Chomsky Normal Form.
1. S→ AACD | ACD | AAC | CD | AC | C 2. S→ ASB | Λ
A→ aAb | ab A→ aAS | a
C→ aC | a B→ SbS | A | bb
D→ aDa | bDb | aa | bb
3. S→ ASA | aB 4. S→ bA|aB 5. S→ aAbB
A→ B | S A→ bAA|aS|a A→ Ab | b
B→ b | Λ B→ aBB|bS|b B→ Ba | a
6. S→0A0 | 1B1 | BB 7. S→ aY | Ybb | Y
A→C X→ Λ | a
B→S | A Y→ aXY | bb | Xxa
C→S | ε
8. S→ AaA | CA | BaB 9. S → TU | V
A→ aaBa | CDA | aa | DC T → aTb | Ʌ
B→ bB | bAB | bb | aS U→ cU | Ʌ
C→ Ca | bC | D V →aVc | W
D→ bD | Λ W →bW | Ʌ
2020-21 | Sem-VI | Assignment-4
Unit-4
Sr. No Questions
1. Define PDA & its application also explain acceptance of a string by empty stack.
2. Design PDA for following languages:
1. Describe the pushdown automata for language {0n1n | n≥ 0}.
2. Equal number of a’s and b’s OR Equal no of 0’s and 1’s.
3. L = { x ∈ { a, b}* | na(x) > nb(x) } OR Design PDA accepting strings with more a’s than
b’s. Trace it for the string “abbabaa”.
4. L = { xcxr/ x Є {a,b}* } design a PDA and trace it for string “abcba”.
5. Design PDA accepting all odd-even length strings over {a, b}
6. Design PDA accepting the language: { ai bj ck | i, j, k ≥ 0 and j = i or j = k}
7. Design PDA accepting the language: { ai bj ck | i, j, k ≥ 0 and i=j+k}
8. Design PDA accepting the language: { an bn+m am | n, m ≥ 0}
9. Design and draw a deterministic PDA accepting “Balanced strings of Brackets” which
are accepted by following CFG. S SS | [S] | {S} | Λ OR Design a pushdown automata
to check well-formed parenthesis.
10. Design PDA for L = {x ϵ {a, b}* | na(x) ≠ nb(x)} Trace it for the string abbaababbb
(no of a’s and b’s are not same)
11. Design a PDA, M to accept L = {an b2n | n ≥ 1}
2. Convert given CFG to PDA.
1. S 0AB 2. S 0B| 1A
A 1A | 1 A 0S|1AA | 0
B 0B | 1A | 0 B 1S| 0BB | 1
Trace the string 01011 using PDA.
3. I a | b | Ia | Ib | I0 | I1 4. S AB
E I | E * E | E + E | (E) A BB | a
B AB | a | b
2020-21 | Sem-VI | Assignment-5
Unit-5
Sr. No Questions
1. Draw Turing Machine (TM) & Transition Diagram.
1. Draw TM to accept Palindromes over {a, b}. (Even as well as Odd Palindromes)
2. Draw TM to accept the language: {0n 1n | n ≥ 1}
3. Draw TM to accept the language: { an bn cn | n ≥ 1 }
4. Draw the TM to copy string and delete a symbol.
5. Design a Turing machine to reverse the string over alphabet {0, 1}
6. Design a Turing machine which accepts the language consisting string which
contain aba as a substring over alphabets {a, b}
7. Draw a Turing Machine that accepts the language {anbnan | n ≥0} over {a,b}∗. Also
trace the TM on input string aaabbbaaa.
8. Draw the TM for L = { ss | s ∈ (a, b)*} OR
Draw the TM for L = {xx | x ∈ {a, b}∗} also trace string aa.
9. Draw a transition diagram for a Turing machine accepting the following language. L
= {x ∈ {a, b, c}* | na(x) = nb(x) = nc(x)}.
2. Explain Universal TM and Church Turing Thesis describes its capabilities.