# costas busch1 more applications of the pumping lemma

Post on 15-Jan-2016

220 views

Embed Size (px)

TRANSCRIPT

More Applicationsof The Pumping Lemma

Costas Busch

The Pumping Lemma:there exists an integer such that for any string we can writeFor infinite context-free language with lengthsand it must be:

Costas Busch

Context-free languagesNon-context free languages

Costas Busch

Theorem:The languageis not context freeProof:Use the Pumping Lemmafor context-free languages

Costas Busch

Assume for contradiction thatis context-freeSince is context-free and infinitewe can apply the pumping lemma

Costas Busch

Pumping Lemma gives a magic numbersuch that: Pick any string of with length at least we pick:

Costas Busch

We can write:with lengths andPumping Lemma says:for all

Costas Busch

We examine all the possible locationsof string in

Costas Busch

Case 1:is within the first

Costas Busch

Case 1:is within the first

Costas Busch

Case 1:is within the first

Costas Busch

Case 1:is within the firstContradiction!!!However, from Pumping Lemma:

Costas Busch

is in the firstis in the firstCase 2:

Costas Busch

is in the firstis in the firstCase 2:

Costas Busch

is in the firstis in the firstCase 2:

Costas Busch

is in the firstis in the firstCase 2:Contradiction!!!However, from Pumping Lemma:

Costas Busch

is in the firstoverlaps the firstCase 3:

Costas Busch

is in the firstoverlaps the firstCase 3:

Costas Busch

is in the firstoverlaps the firstCase 3:

Costas Busch

is in the firstoverlaps the firstCase 3:Contradiction!!!However, from Pumping Lemma:

Costas Busch

Overlaps the firstin the firstCase 4:Analysis is similar to case 3

Costas Busch

Other cases:is withinororAnalysis is similar to case 1:

Costas Busch

More cases:overlapsorAnalysis is similar to cases 2,3,4:

Costas Busch

Since , it is impossible to overlap:There are no other cases to considernornor

Costas Busch

In all cases we obtained a contradictionTherefore:The original assumption that is context-free must be wrongConclusion:is not context-free

Costas Busch

Context-free languagesNon-context free languages

Costas Busch

Theorem:The languageis not context freeProof:Use the Pumping Lemmafor context-free languages

Costas Busch

Assume for contradiction thatis context-freeSince is context-free and infinitewe can apply the pumping lemma

Costas Busch

Pumping Lemma gives a magic numbersuch that: Pick any string of with length at least we pick:

Costas Busch

We can write:with lengths andPumping Lemma says:for all

Costas Busch

We examine all the possible locationsof string in There is only one case to consider

Costas Busch

Costas Busch

Costas Busch

Costas Busch

Costas Busch

Since , for we have:

Costas Busch

Costas Busch

Contradiction!!!However, from Pumping Lemma:

Costas Busch

We obtained a contradictionTherefore:The original assumption that is context-free must be wrongConclusion:is not context-free

Costas Busch

Context-free languagesNon-context free languages

Costas Busch

Theorem:The languageis not context freeProof:Use the Pumping Lemmafor context-free languages

Costas Busch

Assume for contradiction thatis context-freeSince is context-free and infinitewe can apply the pumping lemma

Costas Busch

Pumping Lemma gives a magic numbersuch that: Pick any string of with length at least we pick:

Costas Busch

We can write:with lengths andPumping Lemma says:for all

Costas Busch

We examine all the possible locations

of string in

Costas Busch

Most complicated case:is inis in

Costas Busch

Costas Busch

Most complicated sub-case:and

Costas Busch

Most complicated sub-case:and

Costas Busch

Most complicated sub-case:and

Costas Busch

and

Costas Busch

Costas Busch

However, from Pumping Lemma:Contradiction!!!

Costas Busch

When we examine the rest of the caseswe also obtain a contradiction

Costas Busch

In all cases we obtained a contradictionTherefore:The original assumption that is context-free must be wrongConclusion:is not context-free

Costas Busch

Recommended