Proof by The Pumping Lemma Observation

76
Pumping Lemma Mindmap Proofs Proof by existence Proof by contradiction Observation Unary alphabet Pigeon-hole principle Binary alphabet Pumping Lemma PL Game! Examples a n b n ww Pumping down Implications Constant Space Limitations of the Regular Languages The Pumping Lemma Dr Kamal Bentahar School of Computing, Electronics and Mathematics Coventry University Lecture 4 0 / 23

Transcript of Proof by The Pumping Lemma Observation

Page 1: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Limitations of the Regular LanguagesThe Pumping Lemma

Dr Kamal Bentahar

School of Computing, Electronics and MathematicsCoventry University

Lecture 4

0 / 23

Page 2: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

PumpingLemma

Theoryof CS

Models ofComputation

DFA/NFA

NFA→DFA

RegExGNFA

PDA

CFG

TMDecidability

“Haltingproblem”

TuringUnrecog-nizable

Reduction

Complexity

P

NP

NP-hard

NP-complete

0 / 23

Page 3: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Last week. . .

Regular Languages

The class of regular languages can be:1 Recognized by NFAs. (equiv. GNFA or ε-NFA or NFA or DFA).2 Described using Regular Expressions.

Today:1 See the limit of regular languages.2 How to show a language is not regular.

1 / 23

Page 4: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Types of proofs

We show a language is regular using “proof by existence”:Construct an NFA recognizing it.Write a Regular Expression for it.Using closure under the union, concatenation and star operations.

However, if a languages is not regular then how can we show that?!

2 / 23

Page 5: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Types of proofs

We show a language is regular using “proof by existence”:Construct an NFA recognizing it.Write a Regular Expression for it.Using closure under the union, concatenation and star operations.

However, if a languages is not regular then how can we show that?!

2 / 23

Page 6: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Is it raining now? – example of proof by contradiction

Is it raining now?

Suppose it is.Let us go outside where it is supposed to be raining.

If it is raining then we should get wet.(No umberlla, etc.)

However, we did not get wet!Thus, it is not raining!

3 / 23

Page 7: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Is it raining now? – example of proof by contradiction

Is it raining now?Suppose it is.

Let us go outside where it is supposed to be raining.

If it is raining then we should get wet.(No umberlla, etc.)

However, we did not get wet!Thus, it is not raining!

3 / 23

Page 8: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Is it raining now? – example of proof by contradiction

Is it raining now?Suppose it is.Let us go outside where it is supposed to be raining.

If it is raining then we should get wet.(No umberlla, etc.)

However, we did not get wet!Thus, it is not raining!

3 / 23

Page 9: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Is it raining now? – example of proof by contradiction

Is it raining now?Suppose it is.Let us go outside where it is supposed to be raining.

If it is raining then we should get wet.(No umberlla, etc.)

However, we did not get wet!Thus, it is not raining!

3 / 23

Page 10: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Is it raining now? – example of proof by contradiction

Is it raining now?Suppose it is.Let us go outside where it is supposed to be raining.

If it is raining then we should get wet.(No umberlla, etc.)

However, we did not get wet!

Thus, it is not raining!

3 / 23

Page 11: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Is it raining now? – example of proof by contradiction

Is it raining now?Suppose it is.Let us go outside where it is supposed to be raining.

If it is raining then we should get wet.(No umberlla, etc.)

However, we did not get wet!Thus, it is not raining!

3 / 23

Page 12: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Eulerian paths – example of proof by contradictionIs it possible to traversethis graph by travellingalong each edgeexactly once?

Suppose it is possible.How many times would each vertex be visited?

Every time a vertex is entered, it is also exited.So, each vertex must have an even number ofneighbours.The starting and ending vertices are exceptions:odd number of neighbours.There can only be 0 or 2 such exceptions.

However, this graph has 4 exceptions!Thus, it is impossible to traverse this graph bytravelling along each path exactly once.

4 / 23

Page 13: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Eulerian paths – example of proof by contradictionIs it possible to traversethis graph by travellingalong each edgeexactly once?

Suppose it is possible.

How many times would each vertex be visited?

Every time a vertex is entered, it is also exited.So, each vertex must have an even number ofneighbours.The starting and ending vertices are exceptions:odd number of neighbours.There can only be 0 or 2 such exceptions.

However, this graph has 4 exceptions!Thus, it is impossible to traverse this graph bytravelling along each path exactly once.

4 / 23

Page 14: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Eulerian paths – example of proof by contradictionIs it possible to traversethis graph by travellingalong each edgeexactly once?

Suppose it is possible.How many times would each vertex be visited?

Every time a vertex is entered, it is also exited.So, each vertex must have an even number ofneighbours.The starting and ending vertices are exceptions:odd number of neighbours.There can only be 0 or 2 such exceptions.

However, this graph has 4 exceptions!Thus, it is impossible to traverse this graph bytravelling along each path exactly once.

4 / 23

Page 15: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Eulerian paths – example of proof by contradictionIs it possible to traversethis graph by travellingalong each edgeexactly once?

Suppose it is possible.How many times would each vertex be visited?

Every time a vertex is entered, it is also exited.

So, each vertex must have an even number ofneighbours.The starting and ending vertices are exceptions:odd number of neighbours.There can only be 0 or 2 such exceptions.

However, this graph has 4 exceptions!Thus, it is impossible to traverse this graph bytravelling along each path exactly once.

4 / 23

Page 16: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Eulerian paths – example of proof by contradictionIs it possible to traversethis graph by travellingalong each edgeexactly once?

Suppose it is possible.How many times would each vertex be visited?

Every time a vertex is entered, it is also exited.So, each vertex must have an even number ofneighbours.

The starting and ending vertices are exceptions:odd number of neighbours.There can only be 0 or 2 such exceptions.

However, this graph has 4 exceptions!Thus, it is impossible to traverse this graph bytravelling along each path exactly once.

4 / 23

Page 17: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Eulerian paths – example of proof by contradictionIs it possible to traversethis graph by travellingalong each edgeexactly once?

Suppose it is possible.How many times would each vertex be visited?

Every time a vertex is entered, it is also exited.So, each vertex must have an even number ofneighbours.The starting and ending vertices are exceptions:odd number of neighbours.

There can only be 0 or 2 such exceptions.

However, this graph has 4 exceptions!Thus, it is impossible to traverse this graph bytravelling along each path exactly once.

4 / 23

Page 18: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Eulerian paths – example of proof by contradictionIs it possible to traversethis graph by travellingalong each edgeexactly once?

Suppose it is possible.How many times would each vertex be visited?

Every time a vertex is entered, it is also exited.So, each vertex must have an even number ofneighbours.The starting and ending vertices are exceptions:odd number of neighbours.There can only be 0 or 2 such exceptions.

However, this graph has 4 exceptions!Thus, it is impossible to traverse this graph bytravelling along each path exactly once.

4 / 23

Page 19: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Eulerian paths – example of proof by contradictionIs it possible to traversethis graph by travellingalong each edgeexactly once?

Suppose it is possible.How many times would each vertex be visited?

Every time a vertex is entered, it is also exited.So, each vertex must have an even number ofneighbours.The starting and ending vertices are exceptions:odd number of neighbours.There can only be 0 or 2 such exceptions.

However, this graph has 4 exceptions!

Thus, it is impossible to traverse this graph bytravelling along each path exactly once.

4 / 23

Page 20: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Eulerian paths – example of proof by contradictionIs it possible to traversethis graph by travellingalong each edgeexactly once?

Suppose it is possible.How many times would each vertex be visited?

Every time a vertex is entered, it is also exited.So, each vertex must have an even number ofneighbours.The starting and ending vertices are exceptions:odd number of neighbours.There can only be 0 or 2 such exceptions.

However, this graph has 4 exceptions!Thus, it is impossible to traverse this graph bytravelling along each path exactly once.

4 / 23

Page 21: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Types of proofs – Proof by contradiction

To prove a language is not regular, we can use proof by contradiction.We need a property that all regular languages must satisfy.Then, if a given language does not satisfy it then it cannot be regular.

Let us try to understand the regular languages (RLs) a bit more. . .Let us examine some examples in the next few slides. . .For each automaton, let us think about the path taken by an acceptedstring – is it “straight” or does it loop?

5 / 23

Page 22: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Types of proofs – Proof by contradiction

To prove a language is not regular, we can use proof by contradiction.We need a property that all regular languages must satisfy.Then, if a given language does not satisfy it then it cannot be regular.

Let us try to understand the regular languages (RLs) a bit more. . .Let us examine some examples in the next few slides. . .For each automaton, let us think about the path taken by an acceptedstring – is it “straight” or does it loop?

5 / 23

Page 23: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Unary alphabet {1} – Strings of length 3,5,7,9, . . .

1 1

1

1

1

111 takes a “straight path” to the accept state11111 goes through a loop.Repeating the looped part produces longer strings:11 11 11 1, 11 11 11 11 1, 11 11 11 11 11 1, . . .In fact, we can also omit the 11 loop to get: 111.

We say: we pump the substring 11.

6 / 23

Page 24: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Unary alphabet {1} – Strings of length 3,5,7,9, . . .

1 1

1

1

1

111 takes a “straight path” to the accept state

11111 goes through a loop.Repeating the looped part produces longer strings:11 11 11 1, 11 11 11 11 1, 11 11 11 11 11 1, . . .In fact, we can also omit the 11 loop to get: 111.

We say: we pump the substring 11.

6 / 23

Page 25: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Unary alphabet {1} – Strings of length 3,5,7,9, . . .

1 1

1

1

1

111 takes a “straight path” to the accept state11111 goes through a loop.

Repeating the looped part produces longer strings:11 11 11 1, 11 11 11 11 1, 11 11 11 11 11 1, . . .In fact, we can also omit the 11 loop to get: 111.

We say: we pump the substring 11.

6 / 23

Page 26: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Unary alphabet {1} – Strings of length 3,5,7,9, . . .

1 1

1

1

1

111 takes a “straight path” to the accept state11111 goes through a loop.Repeating the looped part produces longer strings:11 11 11 1, 11 11 11 11 1, 11 11 11 11 11 1, . . .

In fact, we can also omit the 11 loop to get: 111.

We say: we pump the substring 11.

6 / 23

Page 27: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Unary alphabet {1} – Strings of length 3,5,7,9, . . .

1 1

1

1

1

111 takes a “straight path” to the accept state11111 goes through a loop.Repeating the looped part produces longer strings:11 11 11 1, 11 11 11 11 1, 11 11 11 11 11 1, . . .In fact, we can also omit the 11 loop to get: 111.

We say: we pump the substring 11.

6 / 23

Page 28: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Unary alphabet {1} – Strings of length 3,5,7,9, . . .

1 1

1

1

1

111 takes a “straight path” to the accept state11111 goes through a loop.Repeating the looped part produces longer strings:11 11 11 1, 11 11 11 11 1, 11 11 11 11 11 1, . . .In fact, we can also omit the 11 loop to get: 111.

We say: we pump the substring 11.6 / 23

Page 29: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

(111)∗+(11111)∗

1

1

1

1

1

1

1

1

ε

ε

Set of accepted strings is:{ε,13,16,19, . . .} ∪ {ε,15,110,115, . . .}

111 can be pumped to give:(111)0 = ε,(111)1 = 13,(111)2 = 16,(111)3 = 19, . . .

11111 can be pumped to give:(11111)0 = ε,(11111)1 = 15,(11111)2 = 110,(11111)3 = 115, . . .

The shortest string that can bepumped is: 111.3, the length of 111, is called:pumping length.

6 / 23

Page 30: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

(111)∗+(11111)∗

1

1

1

1

1

1

1

1

ε

ε

Set of accepted strings is:{ε,13,16,19, . . .} ∪ {ε,15,110,115, . . .}

111 can be pumped to give:(111)0 = ε,(111)1 = 13,(111)2 = 16,(111)3 = 19, . . .

11111 can be pumped to give:(11111)0 = ε,(11111)1 = 15,(11111)2 = 110,(11111)3 = 115, . . .

The shortest string that can bepumped is: 111.3, the length of 111, is called:pumping length.

6 / 23

Page 31: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

(111)∗+(11111)∗

1

1

1

1

1

1

1

1

ε

ε

Set of accepted strings is:{ε,13,16,19, . . .} ∪ {ε,15,110,115, . . .}

111 can be pumped to give:(111)0 = ε,(111)1 = 13,(111)2 = 16,(111)3 = 19, . . .

11111 can be pumped to give:(11111)0 = ε,(11111)1 = 15,(11111)2 = 110,(11111)3 = 115, . . .

The shortest string that can bepumped is: 111.3, the length of 111, is called:pumping length.

6 / 23

Page 32: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

(111)∗+(11111)∗

1

1

1

1

1

1

1

1

ε

ε

Set of accepted strings is:{ε,13,16,19, . . .} ∪ {ε,15,110,115, . . .}

111 can be pumped to give:(111)0 = ε,(111)1 = 13,(111)2 = 16,(111)3 = 19, . . .

11111 can be pumped to give:(11111)0 = ε,(11111)1 = 15,(11111)2 = 110,(11111)3 = 115, . . .

The shortest string that can bepumped is: 111.

3, the length of 111, is called:pumping length.

6 / 23

Page 33: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

(111)∗+(11111)∗

1

1

1

1

1

1

1

1

ε

ε

Set of accepted strings is:{ε,13,16,19, . . .} ∪ {ε,15,110,115, . . .}

111 can be pumped to give:(111)0 = ε,(111)1 = 13,(111)2 = 16,(111)3 = 19, . . .

11111 can be pumped to give:(11111)0 = ε,(11111)1 = 15,(11111)2 = 110,(11111)3 = 115, . . .

The shortest string that can bepumped is: 111.3, the length of 111, is called:pumping length.

6 / 23

Page 34: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Unary alphabetLet L be a regular language over a unary alphabet Σ = {1}.The language L is:

either finite, in which case it is regular trivially,or infinite, in which case its DFA will have to loop:

The DFA that recgnizes L has a finite number of states.Any string in L determines a path through the DFA.So any sufficiently long string must visit a state twice.This forms a loop.

This looped part can be repeated any arbitrary number of times to produceother strings in L.

Pigeon-hole principle

If we put more than n pigeons into n holes then there must be a hole withmore than one pigeon in.

7 / 23

Page 35: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Unary alphabetLet L be a regular language over a unary alphabet Σ = {1}.The language L is:

either finite, in which case it is regular trivially,or infinite, in which case its DFA will have to loop:

The DFA that recgnizes L has a finite number of states.Any string in L determines a path through the DFA.So any sufficiently long string must visit a state twice.This forms a loop.

This looped part can be repeated any arbitrary number of times to produceother strings in L.

Pigeon-hole principle

If we put more than n pigeons into n holes then there must be a hole withmore than one pigeon in.

7 / 23

Page 36: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

aΣ∗b

a

a,b

b

8 / 23

Page 37: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

aΣ∗

a

a,b

9 / 23

Page 38: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Σ∗b

a,b

b

10 / 23

Page 39: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Σ∗1Σ

1

0,1

0,1

11 / 23

Page 40: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Σ∗aaa

a

a,b

a a

12 / 23

Page 41: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

aabΣ∗ + abaΣ∗

a

a

a ba,b

b aa,b

13 / 23

Page 42: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

(Σ11)∗Σ

0,1

11

14 / 23

Page 43: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

(0Σ∗(01 + 10))∗

0

0

0,1

1

01

15 / 23

Page 44: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

A property satisfied by all RLsFinite number of states→ DFA repeats one or more states if the string is long.

S R Fx

y

z

When a DFA repeats a state R, divide the string into 3 parts:1 The substring x before the first occurrence of R2 The substring y between the first and last occurrence of R3 The substring z after the last occurrence of R

x , z can be ε but y cannot be ε. (y forms a genuine loop.)Then, if the DFA accepts xyz then it accepts all of:xz, xyz, xyyz, xyyyz, . . .

For any RL L, it is possible to divide an accepted string, that is “long enough”,into 3 substrings xyz, in such a way that xy∗z is a subset of L.

16 / 23

Page 45: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

A property satisfied by all RLsFinite number of states→ DFA repeats one or more states if the string is long.

S R Fx

y

z

When a DFA repeats a state R, divide the string into 3 parts:1 The substring x before the first occurrence of R2 The substring y between the first and last occurrence of R3 The substring z after the last occurrence of R

x , z can be ε but y cannot be ε. (y forms a genuine loop.)Then, if the DFA accepts xyz then it accepts all of:xz, xyz, xyyz, xyyyz, . . .

For any RL L, it is possible to divide an accepted string, that is “long enough”,into 3 substrings xyz, in such a way that xy∗z is a subset of L.

16 / 23

Page 46: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

A property satisfied by all RLsFinite number of states→ DFA repeats one or more states if the string is long.

S R Fx

y

z

When a DFA repeats a state R, divide the string into 3 parts:1 The substring x before the first occurrence of R2 The substring y between the first and last occurrence of R3 The substring z after the last occurrence of R

x , z can be ε but y cannot be ε. (y forms a genuine loop.)Then, if the DFA accepts xyz then it accepts all of:xz, xyz, xyyz, xyyyz, . . .

For any RL L, it is possible to divide an accepted string, that is “long enough”,into 3 substrings xyz, in such a way that xy∗z is a subset of L.

16 / 23

Page 47: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

A property satisfied by all RLsFinite number of states→ DFA repeats one or more states if the string is long.

S R Fx

y

z

When a DFA repeats a state R, divide the string into 3 parts:1 The substring x before the first occurrence of R2 The substring y between the first and last occurrence of R3 The substring z after the last occurrence of R

x , z can be ε but y cannot be ε. (y forms a genuine loop.)

Then, if the DFA accepts xyz then it accepts all of:xz, xyz, xyyz, xyyyz, . . .

For any RL L, it is possible to divide an accepted string, that is “long enough”,into 3 substrings xyz, in such a way that xy∗z is a subset of L.

16 / 23

Page 48: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

A property satisfied by all RLsFinite number of states→ DFA repeats one or more states if the string is long.

S R Fx

y

z

When a DFA repeats a state R, divide the string into 3 parts:1 The substring x before the first occurrence of R2 The substring y between the first and last occurrence of R3 The substring z after the last occurrence of R

x , z can be ε but y cannot be ε. (y forms a genuine loop.)Then, if the DFA accepts xyz then it accepts all of:xz, xyz, xyyz, xyyyz, . . .

For any RL L, it is possible to divide an accepted string, that is “long enough”,into 3 substrings xyz, in such a way that xy∗z is a subset of L.

16 / 23

Page 49: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

A property satisfied by all RLsFinite number of states→ DFA repeats one or more states if the string is long.

S R Fx

y

z

When a DFA repeats a state R, divide the string into 3 parts:1 The substring x before the first occurrence of R2 The substring y between the first and last occurrence of R3 The substring z after the last occurrence of R

x , z can be ε but y cannot be ε. (y forms a genuine loop.)Then, if the DFA accepts xyz then it accepts all of:xz, xyz, xyyz, xyyyz, . . .

For any RL L, it is possible to divide an accepted string, that is “long enough”,into 3 substrings xyz, in such a way that xy∗z is a subset of L. 16 / 23

Page 50: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

The Pumping Lemma (PL)We will denote a pumping length by p.The precise meaning of “long enough” will be: |w | ≥ p.y has to be in the first p symbols of w .

Pumping Lemma (PL)

Let L be a regular language. Then, there exists a constant p such that everystring w from L, with |w | ≥ p, can be broken into three substrings xyz suchthat

1 y 6= ε (or equivalently: |y | 6= 0 or |y | > 0)2 |xy | ≤ p (y is in the first p symbols of w)3 For any k ≥ 0, the string xykz is also in L (xy∗z ⊂ L)

Its main purpose in practice is to prove that a language is not regular.That is, if we can show that a language L does not have this property, then we conclude that Lcannot be recognized by a DFA/NFA or expressed as a regular expression.

17 / 23

Page 51: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

The Pumping Lemma (PL)We will denote a pumping length by p.The precise meaning of “long enough” will be: |w | ≥ p.y has to be in the first p symbols of w .

Pumping Lemma (PL)

Let L be a regular language. Then, there exists a constant p such that everystring w from L, with |w | ≥ p, can be broken into three substrings xyz suchthat

1 y 6= ε (or equivalently: |y | 6= 0 or |y | > 0)2 |xy | ≤ p (y is in the first p symbols of w)3 For any k ≥ 0, the string xykz is also in L (xy∗z ⊂ L)

Its main purpose in practice is to prove that a language is not regular.That is, if we can show that a language L does not have this property, then we conclude that Lcannot be recognized by a DFA/NFA or expressed as a regular expression.

17 / 23

Page 52: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

The Pumping Lemma (PL)We will denote a pumping length by p.The precise meaning of “long enough” will be: |w | ≥ p.y has to be in the first p symbols of w .

Pumping Lemma (PL)

Let L be a regular language. Then, there exists a constant p such that everystring w from L, with |w | ≥ p, can be broken into three substrings xyz suchthat

1 y 6= ε (or equivalently: |y | 6= 0 or |y | > 0)2 |xy | ≤ p (y is in the first p symbols of w)3 For any k ≥ 0, the string xykz is also in L (xy∗z ⊂ L)

Its main purpose in practice is to prove that a language is not regular.That is, if we can show that a language L does not have this property, then we conclude that Lcannot be recognized by a DFA/NFA or expressed as a regular expression.

17 / 23

Page 53: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

The PL Game!When the PL is used to prove that a language L is not regular, the proof canbe viewed as a “game” between a Prover and a Falsifier as follows:

Ê Prover claims L is regular andfixes a pumping length p.

Ë Falsifier challenges Prover andpicks a string w ∈ L of length atleast p symbols.

Ì Prover writes w = xyz where|xy | ≤ p and y 6= ε.

Í Falsifier wins by finding a valuefor k such that xykz is not in L.

If Falsifier always wins then L is not regular.If Prover always wins then L may be regular.

18 / 23

Page 54: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

The PL Game!When the PL is used to prove that a language L is not regular, the proof canbe viewed as a “game” between a Prover and a Falsifier as follows:

Ê Prover claims L is regular andfixes a pumping length p.

Ë Falsifier challenges Prover andpicks a string w ∈ L of length atleast p symbols.

Ì Prover writes w = xyz where|xy | ≤ p and y 6= ε.

Í Falsifier wins by finding a valuefor k such that xykz is not in L.

If Falsifier always wins then L is not regular.If Prover always wins then L may be regular.

18 / 23

Page 55: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

The PL Game!When the PL is used to prove that a language L is not regular, the proof canbe viewed as a “game” between a Prover and a Falsifier as follows:

Ê Prover claims L is regular andfixes a pumping length p.

Ë Falsifier challenges Prover andpicks a string w ∈ L of length atleast p symbols.

Ì Prover writes w = xyz where|xy | ≤ p and y 6= ε.

Í Falsifier wins by finding a valuefor k such that xykz is not in L.

If Falsifier always wins then L is not regular.If Prover always wins then L may be regular.

18 / 23

Page 56: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

The PL Game!When the PL is used to prove that a language L is not regular, the proof canbe viewed as a “game” between a Prover and a Falsifier as follows:

Ê Prover claims L is regular andfixes a pumping length p.

Ë Falsifier challenges Prover andpicks a string w ∈ L of length atleast p symbols.

Ì Prover writes w = xyz where|xy | ≤ p and y 6= ε.

Í Falsifier wins by finding a valuefor k such that xykz is not in L.

If Falsifier always wins then L is not regular.If Prover always wins then L may be regular.

18 / 23

Page 57: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

The PL Game!When the PL is used to prove that a language L is not regular, the proof canbe viewed as a “game” between a Prover and a Falsifier as follows:

Ê Prover claims L is regular andfixes a pumping length p.

Ë Falsifier challenges Prover andpicks a string w ∈ L of length atleast p symbols.

Ì Prover writes w = xyz where|xy | ≤ p and y 6= ε.

Í Falsifier wins by finding a valuefor k such that xykz is not in L.

If Falsifier always wins then L is not regular.If Prover always wins then L may be regular.

18 / 23

Page 58: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

The PL Game!When the PL is used to prove that a language L is not regular, the proof canbe viewed as a “game” between a Prover and a Falsifier as follows:

Ê Prover claims L is regular andfixes a pumping length p.

Ë Falsifier challenges Prover andpicks a string w ∈ L of length atleast p symbols.

Ì Prover writes w = xyz where|xy | ≤ p and y 6= ε.

Í Falsifier wins by finding a valuefor k such that xykz is not in L.

If Falsifier always wins then L is not regular.If Prover always wins then L may be regular.

18 / 23

Page 59: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Example (L = {anbn | n ≥ 0})Ê Prover claims L is regular and fixesa pumping length p.

Ë Falsifier challenges Prover andpicks w = apbp ∈ L. (|w | = 2p ≥ p)

Ì Prover tries to split w =a . . . ab . . . b into xyz such that |xy | ≤ p

a . . .x

. . . . . .y

. . . ab . . . . . . bz

Since y must be within the first p sym-bols then y is made of a’s only.

w = a . . . . . . . . . . . .ap symbols

b . . . . . . . . .bp symbols

Í Falsifier now can for example build

xy2z = xyyz = a . . . . . . . . . . . .amore than p symbols

b . . . . . . . . . bstill p symbols

Hence xy2z 6∈ L, and L is not regular.

19 / 23

Page 60: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Example (L = {anbn | n ≥ 0})Ê Prover claims L is regular and fixesa pumping length p.

Ë Falsifier challenges Prover andpicks w = apbp ∈ L. (|w | = 2p ≥ p)

Ì Prover tries to split w =a . . . ab . . . b into xyz such that |xy | ≤ p

a . . .x

. . . . . .y

. . . ab . . . . . . bz

Since y must be within the first p sym-bols then y is made of a’s only.

w = a . . . . . . . . . . . .ap symbols

b . . . . . . . . .bp symbols

Í Falsifier now can for example build

xy2z = xyyz = a . . . . . . . . . . . .amore than p symbols

b . . . . . . . . . bstill p symbols

Hence xy2z 6∈ L, and L is not regular.

19 / 23

Page 61: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Example (L = {anbn | n ≥ 0})Ê Prover claims L is regular and fixesa pumping length p.

Ë Falsifier challenges Prover andpicks w = apbp ∈ L. (|w | = 2p ≥ p)

Ì Prover tries to split w =a . . . ab . . . b into xyz such that |xy | ≤ p

a . . .x

. . . . . .y

. . . ab . . . . . . bz

Since y must be within the first p sym-bols then y is made of a’s only.

w = a . . . . . . . . . . . .ap symbols

b . . . . . . . . .bp symbols

Í Falsifier now can for example build

xy2z = xyyz = a . . . . . . . . . . . .amore than p symbols

b . . . . . . . . . bstill p symbols

Hence xy2z 6∈ L, and L is not regular.

19 / 23

Page 62: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Example (L = {anbn | n ≥ 0})Ê Prover claims L is regular and fixesa pumping length p.

Ë Falsifier challenges Prover andpicks w = apbp ∈ L. (|w | = 2p ≥ p)

Ì Prover tries to split w =a . . . ab . . . b into xyz such that |xy | ≤ p

a . . .x

. . . . . .y

. . . ab . . . . . . bz

Since y must be within the first p sym-bols then y is made of a’s only.

w = a . . . . . . . . . . . .ap symbols

b . . . . . . . . .bp symbols

Í Falsifier now can for example build

xy2z = xyyz = a . . . . . . . . . . . .amore than p symbols

b . . . . . . . . . bstill p symbols

Hence xy2z 6∈ L, and L is not regular.19 / 23

Page 63: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Example (L = {ww | w ∈ {0,1}∗})Ê Prover claims L is regular and fixesa pumping length p.

Ë Falsifier challenges Prover andChoose w = 0p1 0p1 ∈ L. This haslength |w | = (p + 1) + (p + 1) ≥ p.Ì Prover tries to split w =

0 . . . 01 0 . . . 01 into xyz such that|xy | ≤ p

0 . . .x

. . . . . .y

. . . 010 . . . . . . 01z

Since y must be within the first p sym-bols then y is made of 0’s only.

w = 0 . . . . . . . . . . . .0p symbols

1 0 . . . . . . . . .0p symbols

1

Í Falsifier pumps y to produce

xy2z = 0 . . . . . . . . . . . .0more than p symbols

1 0 . . . . . . . . .0still p symbols

1

Hence xy2z 6∈ L, and L is not regular.

20 / 23

Page 64: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Example (L = {ww | w ∈ {0,1}∗})Ê Prover claims L is regular and fixesa pumping length p.

Ë Falsifier challenges Prover andChoose w = 0p1 0p1 ∈ L. This haslength |w | = (p + 1) + (p + 1) ≥ p.

Ì Prover tries to split w =0 . . . 01 0 . . . 01 into xyz such that|xy | ≤ p

0 . . .x

. . . . . .y

. . . 010 . . . . . . 01z

Since y must be within the first p sym-bols then y is made of 0’s only.

w = 0 . . . . . . . . . . . .0p symbols

1 0 . . . . . . . . .0p symbols

1

Í Falsifier pumps y to produce

xy2z = 0 . . . . . . . . . . . .0more than p symbols

1 0 . . . . . . . . .0still p symbols

1

Hence xy2z 6∈ L, and L is not regular.

20 / 23

Page 65: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Example (L = {ww | w ∈ {0,1}∗})Ê Prover claims L is regular and fixesa pumping length p.

Ë Falsifier challenges Prover andChoose w = 0p1 0p1 ∈ L. This haslength |w | = (p + 1) + (p + 1) ≥ p.Ì Prover tries to split w =

0 . . . 01 0 . . . 01 into xyz such that|xy | ≤ p

0 . . .x

. . . . . .y

. . . 010 . . . . . . 01z

Since y must be within the first p sym-bols then y is made of 0’s only.

w = 0 . . . . . . . . . . . .0p symbols

1 0 . . . . . . . . .0p symbols

1

Í Falsifier pumps y to produce

xy2z = 0 . . . . . . . . . . . .0more than p symbols

1 0 . . . . . . . . .0still p symbols

1

Hence xy2z 6∈ L, and L is not regular.

20 / 23

Page 66: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Example (L = {ww | w ∈ {0,1}∗})Ê Prover claims L is regular and fixesa pumping length p.

Ë Falsifier challenges Prover andChoose w = 0p1 0p1 ∈ L. This haslength |w | = (p + 1) + (p + 1) ≥ p.Ì Prover tries to split w =

0 . . . 01 0 . . . 01 into xyz such that|xy | ≤ p

0 . . .x

. . . . . .y

. . . 010 . . . . . . 01z

Since y must be within the first p sym-bols then y is made of 0’s only.

w = 0 . . . . . . . . . . . .0p symbols

1 0 . . . . . . . . .0p symbols

1

Í Falsifier pumps y to produce

xy2z = 0 . . . . . . . . . . . .0more than p symbols

1 0 . . . . . . . . .0still p symbols

1

Hence xy2z 6∈ L, and L is not regular.

20 / 23

Page 67: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Example (L = {aibj | i > j})Ê Prover claims L is regular and fixesa pumping length p.

Ë Falsifier challenges Prover andchooses w = ap+1bp.Here |w | = (p + 1) + p ≥ p.

Ì Prover splits w = a . . . aab . . . b intoxyz:

a . . .x

. . . . . .y

. . . aab . . . . . . bz

So y is made of a’s only.

w = a . . . . . . . . . . . .ap + 1 symbols

b . . . . . . . . .bp symbols

Í Falsifier pumps y down and formsxy0z = xz

xy0z = a . . . . . . . . . . . .aat most p symbols

b . . . . . . . . .bstill p symbols

Hence xy0z 6∈ L, and L is not regular.

21 / 23

Page 68: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Example (L = {aibj | i > j})Ê Prover claims L is regular and fixesa pumping length p.

Ë Falsifier challenges Prover andchooses w = ap+1bp.Here |w | = (p + 1) + p ≥ p.

Ì Prover splits w = a . . . aab . . . b intoxyz:

a . . .x

. . . . . .y

. . . aab . . . . . . bz

So y is made of a’s only.

w = a . . . . . . . . . . . .ap + 1 symbols

b . . . . . . . . .bp symbols

Í Falsifier pumps y down and formsxy0z = xz

xy0z = a . . . . . . . . . . . .aat most p symbols

b . . . . . . . . .bstill p symbols

Hence xy0z 6∈ L, and L is not regular.

21 / 23

Page 69: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Example (L = {aibj | i > j})Ê Prover claims L is regular and fixesa pumping length p.

Ë Falsifier challenges Prover andchooses w = ap+1bp.Here |w | = (p + 1) + p ≥ p.

Ì Prover splits w = a . . . aab . . . b intoxyz:

a . . .x

. . . . . .y

. . . aab . . . . . . bz

So y is made of a’s only.

w = a . . . . . . . . . . . .ap + 1 symbols

b . . . . . . . . .bp symbols

Í Falsifier pumps y down and formsxy0z = xz

xy0z = a . . . . . . . . . . . .aat most p symbols

b . . . . . . . . .bstill p symbols

Hence xy0z 6∈ L, and L is not regular.

21 / 23

Page 70: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Example (L = {aibj | i > j})Ê Prover claims L is regular and fixesa pumping length p.

Ë Falsifier challenges Prover andchooses w = ap+1bp.Here |w | = (p + 1) + p ≥ p.

Ì Prover splits w = a . . . aab . . . b intoxyz:

a . . .x

. . . . . .y

. . . aab . . . . . . bz

So y is made of a’s only.

w = a . . . . . . . . . . . .ap + 1 symbols

b . . . . . . . . .bp symbols

Í Falsifier pumps y down and formsxy0z = xz

xy0z = a . . . . . . . . . . . .aat most p symbols

b . . . . . . . . .bstill p symbols

Hence xy0z 6∈ L, and L is not regular. 21 / 23

Page 71: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Food for thoughtIf “modern computer” = Finite Automaton then:

We can only store a fixed finite amount of data, say1TB = 10244 × 8 = 243 bits of information, i.e. a maximum of2243 ≈ 102,647,887,844,335 states – a finite number still!

So, our “modern computer” is not even able to recognize the (entire)language anbn!

At some point, our “modern computer” can no longer keep track of howmany a’s there are in the input.This occurs when the number of a’s becomes greater than 2243

.

We have assumed that the input string is not stored in thecomputer. . . (otherwise, it would just run out of memory anyway).However, at 3GHz for example, this would take. . . a length of time soinconceivably huge that the age of the universe would be negligible bycomparison. (So, do we care?)

22 / 23

Page 72: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Food for thoughtIf “modern computer” = Finite Automaton then:

We can only store a fixed finite amount of data, say1TB = 10244 × 8 = 243 bits of information, i.e. a maximum of2243 ≈ 102,647,887,844,335 states – a finite number still!So, our “modern computer” is not even able to recognize the (entire)language anbn!

At some point, our “modern computer” can no longer keep track of howmany a’s there are in the input.This occurs when the number of a’s becomes greater than 2243

.

We have assumed that the input string is not stored in thecomputer. . . (otherwise, it would just run out of memory anyway).However, at 3GHz for example, this would take. . . a length of time soinconceivably huge that the age of the universe would be negligible bycomparison. (So, do we care?)

22 / 23

Page 73: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Food for thoughtIf “modern computer” = Finite Automaton then:

We can only store a fixed finite amount of data, say1TB = 10244 × 8 = 243 bits of information, i.e. a maximum of2243 ≈ 102,647,887,844,335 states – a finite number still!So, our “modern computer” is not even able to recognize the (entire)language anbn!

At some point, our “modern computer” can no longer keep track of howmany a’s there are in the input.This occurs when the number of a’s becomes greater than 2243

.

We have assumed that the input string is not stored in thecomputer. . . (otherwise, it would just run out of memory anyway).However, at 3GHz for example, this would take. . . a length of time soinconceivably huge that the age of the universe would be negligible bycomparison. (So, do we care?)

22 / 23

Page 74: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Food for thoughtIf “modern computer” = Finite Automaton then:

We can only store a fixed finite amount of data, say1TB = 10244 × 8 = 243 bits of information, i.e. a maximum of2243 ≈ 102,647,887,844,335 states – a finite number still!So, our “modern computer” is not even able to recognize the (entire)language anbn!

At some point, our “modern computer” can no longer keep track of howmany a’s there are in the input.This occurs when the number of a’s becomes greater than 2243

.

We have assumed that the input string is not stored in thecomputer. . . (otherwise, it would just run out of memory anyway).

However, at 3GHz for example, this would take. . . a length of time soinconceivably huge that the age of the universe would be negligible bycomparison. (So, do we care?)

22 / 23

Page 75: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Food for thoughtIf “modern computer” = Finite Automaton then:

We can only store a fixed finite amount of data, say1TB = 10244 × 8 = 243 bits of information, i.e. a maximum of2243 ≈ 102,647,887,844,335 states – a finite number still!So, our “modern computer” is not even able to recognize the (entire)language anbn!

At some point, our “modern computer” can no longer keep track of howmany a’s there are in the input.This occurs when the number of a’s becomes greater than 2243

.

We have assumed that the input string is not stored in thecomputer. . . (otherwise, it would just run out of memory anyway).However, at 3GHz for example, this would take. . . a length of time soinconceivably huge that the age of the universe would be negligible bycomparison. (So, do we care?)

22 / 23

Page 76: Proof by The Pumping Lemma Observation

PumpingLemma

Mindmap

ProofsProof by existence

Proof bycontradiction

ObservationUnary alphabet

Pigeon-hole principle

Binary alphabet

PumpingLemmaPL Game!

Examples

an bn

ww

Pumping down

ImplicationsConstant Space

Space Complexity: Constant Space←→ NFAs

Finite Automaton: good model for algorithms which require constantspace (i.e. space used does not grow with respect to the input size).Some languages cannot be recognized by NFAs.Space used in computation must grow with respect to the input size.

We will see a more powerful model of computation next week!

23 / 23