NPTEL Theory of Computation Week 5 Assignment Answers 2024

Sanket
By Sanket

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,uvnwxny∈L
  • ∃n≥0,uvnwxny∈L
  • ∀n≥0,uvnwxyn∈L
  • ∃n≥0,uvnwnxny∈L
Answer :- For Answers Click Here 

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

  • {}
  • {anbnw∣m,n≥0,w∈{0,1}∗}
  • {anbncmdm∣m,n≥0}
  • {ww∣w∈{0,1}∗}
Answer :- For Answers Click Here 

3. Consider the following PDA.

image10

What is the language accepted by this PDA?

  • Set of all strings of the form anbn
  • Set of all strings of the form bnan
  • 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.

image11

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

  • 00000000
  • 00000011
  • 00001111
  • 00111111
Answer :- 

5. Which of the following is context-free?

  • {0n∣n is prime }
  • {wwR∣w∈{0,1}∗ and wR is the reverse of w}
  • {ancmbndm∣m,n≥0}
  • {anbncn∣n≥0}
Answer :- For Answers Click Here 
Share This Article
Leave a comment