Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Home Assignment-1

Course code: 18B11CI917


Course Name: Theory of Computation
Course Coordinator: Dr. Ajay Kumar/Prof. Sanjay Garg

Note: This home assignment has due date 31-08-2023. This assignment helps you in preparing
T1. For this assignment, refer to the study material given in classroom folder shared with you.
You have to keep the solution of this home assignment in your notebook as announce in the
classroom.
1. Briefly describe what theory of computation is.
2. Describe P and NP Class problem with example.
3. For each of the following languages, (i) give a plain English description of the
language, and (ii) give two examples of strings in the language and two examples
of strings that are in Σ*but are outside the language.
(a) L1 = {0x1 | x ∈ {0, 1}*}
(b) L2 = {w ∈ {a, b} ∗ | |w| ≥ 4} ∩ {xabbay | x, y ∈ {a, b}*}
4. For each of the following languages, (i) describe the language using set-builder
notation and union/intersection/complement/reverse/concatenation operations
(the notation used in Problem 3), and (ii) give two examples of strings in the
language and two examples of strings that are in Σ* but are outside the language.
(a) L3 = the set of all strings over alphabet {a, b, c} that are palindromes (read
the same forwards and backwards) or start with a. (For example, bacab and
cabbac are palindromes.)
(b) L4 = the set of all strings over alphabet {1, 2, . . . , 9} whose length is divisible
by a, where a is the first symbol of the string.
5. Prove the following equivalences using logical identities:
(a) (¬P => (¬P => (¬P ^ Q))) ≡ P v Q
(b) P ≡ (P v Q) ^ (P v ¬Q)
6. Obtain the principal disjunctive normal form of the following:
(a) P => (P => Q ^ (¬ (¬ Q v ¬P)))
(b) (Q ^ ¬R ^ ¬ S) v (R ^ S).
7. Draw the deterministic finite automata accepting each of the following languages

a) {w ∈ {a, b}* : each a in w is immediately preceded by a b}


b) {w ∈ {a, b}* : w has abab as a substring}
c) {w ∈ {a, b}* : w has neither aa nor bb as a substring}
d) {w ∈ {a, b}* : w has an odd number of a’s and an even number of b’s}
e) {w ∈ {a, b}* : w has both ab and ba as a substrings}
8. Describe the languages accepted by the deterministic finite automata given in
Figure-1.
9. Transform the NDFA’s given in figure-2 into DFA’s
Figure 1

a a
a
e
a s
p f
s
e
b
a a a a
b
e
q
p q
b
a
a

Figure 2

You might also like