## NPTEL Theory of Computation Week 5 Assignment Answers 2024

1. Let L be a context-free language. Then according to the pumping lemma for context-free languages, there exists an integer p≥1 such that every string w∈L can be written as w=uvwxy satisfying the following conditions:

- ∣vx∣≥1
- ∣vwx∣≤pand

- ∀n≥0,uv
^{n}wx^{n}y∈L - ∃n≥0,uv
^{n}wx^{n}y∈L - ∀n≥0,uv
^{n}wxy^{n}∈L - ∃n≥0,uv
^{n}w^{n}x^{n}y∈L

Answer :-For Answers Click Here

2. Which of the following languages is not context-free?

- {}
- {a
^{n}b^{n}w∣m,n≥0,w∈{0,1}∗} - {a
^{n}b^{n}c^{m}d^{m}∣m,n≥0} - {ww∣w∈{0,1}∗}

Answer :-For Answers Click Here

3. Consider the following PDA.

What is the language accepted by this PDA?

- Set of all strings of the form a
^{n}b^{n} - Set of all strings of the form b
^{n}a^{n} - Set of all even-length palindromes over the alphabet {0,1}
- Set of all odd-length palindromes over the alphabet {0,1}

Answer :-For Answers Click Here

4. Consider the following PDA.

Which of the following strings is not accepted by this PDA?

- 00000000
- 00000011
- 00001111
- 00111111

Answer :-

5. Which of the following is context-free?

- {0
^{n}∣n is prime } - {ww
^{R}∣w∈{0,1}∗ and w^{R}is the reverse of w} - {a
^{n}c^{m}b^{n}d^{m}∣m,n≥0} - {a
^{n}b^{n}c^{n}∣n≥0}

Answer :-For Answers Click Here