- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Explain about pumping lemma for context free language?
Problem
Explain the pumping lemma for context free language by showing that the language of strings in the form xnynzn is not a context free language.
Solution
Pumping lemma (Context free grammar)
We can prove that a particular language is not context free grammar using pumping lemma.
Let’s take the concept of proof by contradiction
Here we assume that language is CFG
Conditions of pumping lemma
First of all consider a string and split into 5 parts those are pqrst it must satisfy the following conditions −
|qs|>=1
|qrs|=n (“ n” is pumping length)
pqirsit € L for different values of i
Let the L be the CF language.
Now we can take a string such that S={xnynzn}
We divide S in five parts.
Case 1 − let n=4 so S=x4y4z4
q and s each contain only one type of symbols
xxxxyyyyzzzz
p=x , q=xx, r=xyyyyz, s=z, t=zz
Let take i=2
Pq2rs2t
xxxxxxyyyyzzzzz
x6y4z5 ≠L
Because, it is not in the form of xnynzn
- Related Articles
- Explain Pumping lemma for context free language
- What is the pumping lemma for regular language?
- Explain about CYK Algorithm for Context Free Grammar
- Explain the context free language closure under concatenation?
- Explain the context free language closure under union operation?
- How to generate the language for context free grammar?
- What are the closure properties for context free language?
- Generate a Context-free grammar for the language L = {anbm| m≠n}?
- What is context free grammar? Explain with examples
- Explain removing unit productions in context free grammar
- Explain the simplification of context free grammar in TOC
- Give the examples of a context free language that are not regular?
- Explain Euclid Division Lemma.
- Generate a CNF for a given context free grammar
- What is Context-Free Grammar?
