## Practice Set – 0

This practice set covers the basic terminologies related to set theory.

### Define the following terms and explain with appropriate example of each:

- Set
- Subset
- Proper superset
- Power set
- Symmetrical relation
- Injective function
- Surjective function
- Bijective function
- Equivalence relation
- Cartesian product

## Practice Set – 1

This practice set covers the basic terminologies related to formal language and finite automata

### Define the following terms and give example of each:

- Symbol
- Alphabet set
- String
- Language
- Finite language
- Infinite language
- Finite Automata
- Deterministic finite automata
- Non determinisitc finite automata
- Transition function

## Practice Set – 2

This practice set contains the questions on the design of regular expression for the given regular language.

### Design Regular Expressions for the following languages:

Design regular expression for following languages over alphabet set Σ = { a, b }

- L
_{1}= Strings of even length - L
_{2}= Strings of odd length - L
_{3}= Strings of length divisible by 3 - L
_{4}= Strings having exactly 2 a’s - L
_{5}= Strings having at least 2 a’s - L
_{6}= Strings having at most ‘2’ a’s - L
_{7}= Strings containing an even number of a’s - L
_{8}= Strings ending with the same symbols - L
_{9}= Strings ending with different symbols - L
_{10}= No two a’s should come together

## Practice Set – 3

Design Push Down Automata for the following languages. Also, show the derivation of at least one string with the instantaneous descriptor. (The string length should be at least five). Also, show the graphical representation of each PDA

- L = {a
^{n}b^{n}c^{n}| n ≥ 1} - L = {a
^{n}b^{n}c^{n}| n ≥ 0} - L = {a
^{n}b^{m}| n > m, and n, m ≥ 1} - L = {a
^{n}b^{m}| n < m, and n, m ≥ 1} - L = {a
^{n}b^{2n}| n ≥ 1} - L = {a
^{n}b^{2n + 1}| n ≥ 1}

## Practice Set – 4

Design Push Down Automata for the following languages. Also, show the derivation of at least one string with the instantaneous descriptor. (The string length should be at least five). Also, show a graphical representation of each PDA

- L = {a
^{n}w | n ≥ 0, w ∈ {a, b}* and |w| ≤ n} - L = {a
^{n}b^{n}c^{m}| n ≥ 0} - L = {a
^{n}b^{n}c^{m}| n ≥ 1} - L = {a
^{n}b^{m}c^{n}| n ≥ 0} - L = {a
^{n}b^{m}c^{n}| n ≥ 1} - L = {a
^{m+n}b^{m}c^{n}| n ≥ 1}

## Practice Set – 5

Design Push Down Automata for the following languages. Also, show the derivation of at least one string with the instantaneous descriptor. (String length should be at least five). Also, show the graphical representation of each PDA

- L = {a
^{m}b^{m+n}c^{n}| n ≥ 1} - L = {a
^{m}bc^{m+n}| n ≥ 1} - L = {a
^{i}b^{j}c^{k}| i, j, k ≥ 0, i = j or i = k} - L = {a
^{i}b^{j}c^{k}| i, j, k ≥ 0, j = i or j = k} - L = {a
^{i}b^{j}c^{k}| i, j, k ≥ 0, k = j or k = j} - L = {a
^{i}b^{j}c^{k}| i, j, k ≥ 0, i = j + k}

## Practice Set – 6

Design Push Down Automata for the following languages. Also, show the derivation of at least one string with the instantaneous descriptor. (The string length should be at least five). Also, show the graphical representation of each PDA

- L = {a
^{i}b^{j}c^{k}| i, j, k ≥ 0, j = i + k} - L = {a
^{i}b^{j}c^{k}| i, j, k ≥ 0, k = i + j} - L = {a
^{i}b^{j}c^{k}| i, j, k ≥ 0, i > j + k} - L = {a
^{i}b^{j}c^{k}| i, j, k ≥ 0, j > i + k} - L = {a
^{i}b^{j}c^{k}| i, j, k ≥ 0, k > i + j} - L = {w | w ∈ {a, b}*, and n
_{a}(w) = n_{b}(w)}

## Practice Set – 7

Design Push Down Automata for the following languages. Also, show the derivation of at least one string with the instantaneous descriptor. (String length should be at least Five). Also show graphical representation of each PDA

- L = {w | w ∈ {a, b}*, and n
_{a}(w) > n_{b}(w)} - L = {w | w ∈ {a, b}*, and n
_{a}(w) < n_{b}(w)} - L = {w | w ∈ {a, b}*, and n
_{a}(w) ≠ n_{b}(w)} - L = {wcw
^{R}| w ∈ {a, b}*} - L = { Balanced strings of brackets }, ex. S → (S) | {S} | [S] | ε
- L = {a
^{i}b^{j}c^{k}| i ≠ j or j ≠ k}

## Practice Set – 8

Convert the following Context Free Grammar to PDA:

- { S → AB, A → CD, B → b, C → a, D → a }
- { S → aAA, A → aS | bS | a }
- { S → AA | a, A → SA | b }
- { S → AA | a, A → SA | b }

## Practice Set – 9

Conver following PDA to Context Free Grammar:

- δ(q
_{0}, 0, Z) = (q_{0}, AZ), δ(q_{0}, 1, A) = (q_{0}, AA), δ(q_{0}, 0, A) = (q_{1}, ε) - δ
**(q**, δ(q_{0}, 0, Z) = (q_{0}, AZ)_{0}, 0, A) = (q_{0}, AA), δ(q_{0}, 1, A) = (q_{1}, ε), δ(q_{1}, 1, A) = (q_{1}, ε), δ(q_{1}, ε, A) = (q_{1}, ε), δ(q_{1}, ε, Z) = (q_{1}, ε) - Using pumping lemma, show that the language L = { a
^{i}b^{i}c^{i}| i ≥ 1 } is not a CFL - Using pumping lemma, show that the language L = { a
^{n}b^{m}c^{p}| 0 ≤ n < m < p } is not a CFL

## Practice Set – 10

- Design DFA for language over {0, 1} such that all strings begin and end with the same digit
- Design DFA to for the language L = { a
^{3}bwa^{3}| w is any string over {a, b}} - Design FA for |w| mod 3 = 0, where w ∈ {a, b}*
- Design minimal DFA for w ∈ {a, b}* such that n
_{a}(w) mod 3 - Deisgn DFA for strings having n
_{a}(w) mod 3 > n_{b}(w) mod 3 - Design DFA for strings that do
**not having**‘abb’ as substring - Prove that 7 + 13 + 19 + … + (6n + 1) = n(3n + 4) using Mathematical induction
- Explain deductive proof and inductive proof

**Important Notice:**

Problem set 10 is to be solved by everyone. There are 10 other Practice sets (numbered from 0 to 9). You have to solve the practice set having the last digit of your enrollment number. For example, if your enrollment number is 19016010702**7**, then you have to solve practice set **7**, If your enrollment number is 20016010750**2** then you have to solve practice set **2**, and so on. You have to submit a file including an index with proper problem descriptions and page numbers. You may refer video playlist at www.shorturl.at/inryW to solve the assignments.