cs250: discrete math for computer sciencepumping lemma for regular sets: let d = (q; ; ;q0;f) be a...

Post on 12-Sep-2020

0 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

CS250: Discrete Math for Computer Science

L31: Proving Languages are Not Recognized by any DFA

Which Languages are Recognized by DFAs?

So far we have seen that the following languages have DFAsthat recognize them and regular expressions that denote them:

{w ∈ {a,b}?

∣∣ #b(w) ≡ 1 (mod 2)}

L(a∗ba∗(ba∗ba∗)∗)

{w ∈ {0,1}∗

∣∣ next to last symbol is 1}

L((0|1)∗1(0|1))

{w ∈ {a,b}?

∣∣∣∣ #a(w) ≡ 1 (mod 2) ∧#b(w) ≡ 0 (mod 3)

}?

{w ∈ {0,1}∗

∣∣ w has at least two 0’s}

L(1∗01∗0(0|1)∗)

{w ∈ {0,1}∗

∣∣ w has 001 or 100}

L((0|1)∗(001|100)(0|1)∗)

Which Languages are Recognized by DFAs?

So far we have seen that the following languages have DFAsthat recognize them and regular expressions that denote them:{

w ∈ {a,b}?∣∣ #b(w) ≡ 1 (mod 2)

}L(a∗ba∗(ba∗ba∗)∗)

{w ∈ {0,1}∗

∣∣ next to last symbol is 1}

L((0|1)∗1(0|1))

{w ∈ {a,b}?

∣∣∣∣ #a(w) ≡ 1 (mod 2) ∧#b(w) ≡ 0 (mod 3)

}?

{w ∈ {0,1}∗

∣∣ w has at least two 0’s}

L(1∗01∗0(0|1)∗)

{w ∈ {0,1}∗

∣∣ w has 001 or 100}

L((0|1)∗(001|100)(0|1)∗)

Which Languages are Recognized by DFAs?

So far we have seen that the following languages have DFAsthat recognize them and regular expressions that denote them:{

w ∈ {a,b}?∣∣ #b(w) ≡ 1 (mod 2)

}L(a∗ba∗(ba∗ba∗)∗)

{w ∈ {0,1}∗

∣∣ next to last symbol is 1}

L((0|1)∗1(0|1))

{w ∈ {a,b}?

∣∣∣∣ #a(w) ≡ 1 (mod 2) ∧#b(w) ≡ 0 (mod 3)

}?

{w ∈ {0,1}∗

∣∣ w has at least two 0’s}

L(1∗01∗0(0|1)∗)

{w ∈ {0,1}∗

∣∣ w has 001 or 100}

L((0|1)∗(001|100)(0|1)∗)

Which Languages are Recognized by DFAs?

So far we have seen that the following languages have DFAsthat recognize them and regular expressions that denote them:{

w ∈ {a,b}?∣∣ #b(w) ≡ 1 (mod 2)

}L(a∗ba∗(ba∗ba∗)∗)

{w ∈ {0,1}∗

∣∣ next to last symbol is 1}

L((0|1)∗1(0|1))

{w ∈ {a,b}?

∣∣∣∣ #a(w) ≡ 1 (mod 2) ∧#b(w) ≡ 0 (mod 3)

}?

{w ∈ {0,1}∗

∣∣ w has at least two 0’s}

L(1∗01∗0(0|1)∗)

{w ∈ {0,1}∗

∣∣ w has 001 or 100}

L((0|1)∗(001|100)(0|1)∗)

Which Languages are Recognized by DFAs?

So far we have seen that the following languages have DFAsthat recognize them and regular expressions that denote them:{

w ∈ {a,b}?∣∣ #b(w) ≡ 1 (mod 2)

}L(a∗ba∗(ba∗ba∗)∗)

{w ∈ {0,1}∗

∣∣ next to last symbol is 1}

L((0|1)∗1(0|1))

{w ∈ {a,b}?

∣∣∣∣ #a(w) ≡ 1 (mod 2) ∧#b(w) ≡ 0 (mod 3)

}?

{w ∈ {0,1}∗

∣∣ w has at least two 0’s}

L(1∗01∗0(0|1)∗)

{w ∈ {0,1}∗

∣∣ w has 001 or 100}

L((0|1)∗(001|100)(0|1)∗)

Which Languages are Recognized by DFAs?

So far we have seen that the following languages have DFAsthat recognize them and regular expressions that denote them:{

w ∈ {a,b}?∣∣ #b(w) ≡ 1 (mod 2)

}L(a∗ba∗(ba∗ba∗)∗)

{w ∈ {0,1}∗

∣∣ next to last symbol is 1}

L((0|1)∗1(0|1))

{w ∈ {a,b}?

∣∣∣∣ #a(w) ≡ 1 (mod 2) ∧#b(w) ≡ 0 (mod 3)

}?

{w ∈ {0,1}∗

∣∣ w has at least two 0’s}

L(1∗01∗0(0|1)∗)

{w ∈ {0,1}∗

∣∣ w has 001 or 100}

L((0|1)∗(001|100)(0|1)∗)

{w ∈ {0,1}∗

∣∣ w has at least two 0’s}

= L(1∗01∗0(0|1)∗)

Build a DFA D4 s.t. L(D4) = L(1∗01∗0(0|1)∗)

1∗D4

1

1∗01∗

0

1

qf

00,1

{w ∈ {0,1}∗

∣∣ w has at least two 0’s}

= L(1∗01∗0(0|1)∗)

Build a DFA D4 s.t. L(D4) = L(1∗01∗0(0|1)∗)

1∗D4

1

1∗01∗

0

1

qf

00,1

{w ∈ {0,1}∗

∣∣ w has at least two 0’s}

= L(1∗01∗0(0|1)∗)

Build a DFA D4 s.t. L(D4) = L(1∗01∗0(0|1)∗)

1∗D4

1

1∗01∗

0

1

qf

00,1

{w ∈ {0,1}∗

∣∣ w has at least two 0’s}

= L(1∗01∗0(0|1)∗)

Build a DFA D4 s.t. L(D4) = L(1∗01∗0(0|1)∗)

1∗D4

1

1∗01∗

0

1

qf

00,1

{w ∈ {0,1}∗

∣∣ w has at least two 0’s}

= L(1∗01∗0(0|1)∗)

Build a DFA D4 s.t. L(D4) = L(1∗01∗0(0|1)∗)

1∗D4

1

1∗01∗

0

1

qf

00,1

{w ∈ {0,1}∗

∣∣ w has at least two 0’s}

= L(1∗01∗0(0|1)∗)

Build a DFA D4 s.t. L(D4) = L(1∗01∗0(0|1)∗)

1∗D4

1

1∗01∗

0

1

qf

0

0,1

{w ∈ {0,1}∗

∣∣ w has at least two 0’s}

= L(1∗01∗0(0|1)∗)

Build a DFA D4 s.t. L(D4) = L(1∗01∗0(0|1)∗)

1∗D4

1

1∗01∗

0

1

qf

00,1

Which languages are recognized by DFA or denoted byregular expressions?

How can we prove a language, L, is not recognized by anyDFA?

Idea: must show that need more than a bounded size memoryto remember what we have seen so far, x , in order to decide ifextensions of x belong to L.

Which languages are recognized by DFA or denoted byregular expressions?

How can we prove a language, L, is not recognized by anyDFA?

Idea: must show that need more than a bounded size memoryto remember what we have seen so far, x , in order to decide ifextensions of x belong to L.

Which languages are recognized by DFA or denoted byregular expressions?

How can we prove a language, L, is not recognized by anyDFA?

Idea: must show that need more than a bounded size memoryto remember what we have seen so far, x , in order to decide ifextensions of x belong to L.

Pumping Lemma for Regular Sets:Let D = (Q,Σ, δ,q0,F ) be a DFA.

Let n = |Q|.

Let w ∈ L(D) s.t. |w | ≥ n.

Then ∃x , y , z ∈ Σ? s.t. the following all hold:1. xyz = w

2. |xy | ≤ n

3. |y | > 0, and

4. ∀k ≥ 0 (xykz ∈ L(D))

Pumping Lemma for Regular Sets:Let D = (Q,Σ, δ,q0,F ) be a DFA.

Let n = |Q|.

Let w ∈ L(D) s.t. |w | ≥ n.

Then ∃x , y , z ∈ Σ? s.t. the following all hold:1. xyz = w

2. |xy | ≤ n

3. |y | > 0, and

4. ∀k ≥ 0 (xykz ∈ L(D))

Pumping Lemma for Regular Sets:Let D = (Q,Σ, δ,q0,F ) be a DFA.

Let n = |Q|.

Let w ∈ L(D) s.t. |w | ≥ n.

Then ∃x , y , z ∈ Σ? s.t. the following all hold:1. xyz = w

2. |xy | ≤ n

3. |y | > 0, and

4. ∀k ≥ 0 (xykz ∈ L(D))

Pumping Lemma for Regular Sets:Let D = (Q,Σ, δ,q0,F ) be a DFA.

Let n = |Q|.

Let w ∈ L(D) s.t. |w | ≥ n.

Then ∃x , y , z ∈ Σ? s.t. the following all hold:1. xyz = w

2. |xy | ≤ n

3. |y | > 0, and

4. ∀k ≥ 0 (xykz ∈ L(D))

Pumping Lemma for Regular Sets:Let D = (Q,Σ, δ,q0,F )

be a DFA, n = |Q|w ∈ L(D) s.t. |w | ≥ n

Then ∃x , y , z ∈ Σ? s.t.

1. xyz = w

2. |xy | ≤ n

3. |y | > 0, and

4. ∀k ≥ 0 (xykz ∈ L(D))

1∗D4

1

1∗01∗

0

1

qf

00,1

n = 3, w = 10101 ∈ L(D4), |w | ≥ 3

Split w into x · y · z s.t. 1 ∧ 2 ∧ 3 ∧ 4

x def= ε y def

= 1 z def= 0101 ∀k ≥ 0 (xykz ∈ L(D4))

k = 0 : 0101 ∈ L(D4), k = 1 : 10101 ∈ L(D4),

k = 2 : 110101 ∈ L(D4), k = 3 : 1110101 ∈ L(D4), . . .

Pumping Lemma for Regular Sets:Let D = (Q,Σ, δ,q0,F )

be a DFA, n = |Q|w ∈ L(D) s.t. |w | ≥ n

Then ∃x , y , z ∈ Σ? s.t.

1. xyz = w

2. |xy | ≤ n

3. |y | > 0, and

4. ∀k ≥ 0 (xykz ∈ L(D))

1∗D4

1

1∗01∗

0

1

qf

00,1

n = 3, w = 10101 ∈ L(D4), |w | ≥ 3

Split w into x · y · z s.t. 1 ∧ 2 ∧ 3 ∧ 4

x def= ε y def

= 1 z def= 0101 ∀k ≥ 0 (xykz ∈ L(D4))

k = 0 : 0101 ∈ L(D4), k = 1 : 10101 ∈ L(D4),

k = 2 : 110101 ∈ L(D4), k = 3 : 1110101 ∈ L(D4), . . .

Pumping Lemma for Regular Sets:Let D = (Q,Σ, δ,q0,F )

be a DFA, n = |Q|w ∈ L(D) s.t. |w | ≥ n

Then ∃x , y , z ∈ Σ? s.t.

1. xyz = w

2. |xy | ≤ n

3. |y | > 0, and

4. ∀k ≥ 0 (xykz ∈ L(D))

1∗D4

1

1∗01∗

0

1

qf

00,1

n = 3, w = 10101 ∈ L(D4), |w | ≥ 3

Split w into x · y · z s.t. 1 ∧ 2 ∧ 3 ∧ 4

x def= ε y def

= 1 z def= 0101 ∀k ≥ 0 (xykz ∈ L(D4))

k = 0 : 0101 ∈ L(D4), k = 1 : 10101 ∈ L(D4),

k = 2 : 110101 ∈ L(D4), k = 3 : 1110101 ∈ L(D4), . . .

Pumping Lemma for Regular Sets:Let D = (Q,Σ, δ,q0,F )

be a DFA, n = |Q|w ∈ L(D) s.t. |w | ≥ n

Then ∃x , y , z ∈ Σ? s.t.

1. xyz = w

2. |xy | ≤ n

3. |y | > 0, and

4. ∀k ≥ 0 (xykz ∈ L(D))

1∗D4

1

1∗01∗

0

1

qf

00,1

n = 3, w = 10101 ∈ L(D4), |w | ≥ 3

Split w into x · y · z s.t. 1 ∧ 2 ∧ 3 ∧ 4

x def= ε y def

= 1 z def= 0101 ∀k ≥ 0 (xykz ∈ L(D4))

k = 0 : 0101 ∈ L(D4), k = 1 : 10101 ∈ L(D4),

k = 2 : 110101 ∈ L(D4), k = 3 : 1110101 ∈ L(D4), . . .

Pumping Lemma for Regular Sets:Let D = (Q,Σ, δ,q0,F )

be a DFA, n = |Q|w ∈ L(D) s.t. |w | ≥ n

Then ∃x , y , z ∈ Σ? s.t.

1. xyz = w

2. |xy | ≤ n

3. |y | > 0, and

4. ∀k ≥ 0 (xykz ∈ L(D))

1∗D4

1

1∗01∗

0

1

qf

00,1

n = 3, w = 10101 ∈ L(D4), |w | ≥ 3

Split w into x · y · z s.t. 1 ∧ 2 ∧ 3 ∧ 4

x def= ε y def

= 1 z def= 0101

∀k ≥ 0 (xykz ∈ L(D4))

k = 0 : 0101 ∈ L(D4), k = 1 : 10101 ∈ L(D4),

k = 2 : 110101 ∈ L(D4), k = 3 : 1110101 ∈ L(D4), . . .

Pumping Lemma for Regular Sets:Let D = (Q,Σ, δ,q0,F )

be a DFA, n = |Q|w ∈ L(D) s.t. |w | ≥ n

Then ∃x , y , z ∈ Σ? s.t.

1. xyz = w

2. |xy | ≤ n

3. |y | > 0, and

4. ∀k ≥ 0 (xykz ∈ L(D))

1∗D4

1

1∗01∗

0

1

qf

00,1

n = 3, w = 10101 ∈ L(D4), |w | ≥ 3

Split w into x · y · z s.t. 1 ∧ 2 ∧ 3 ∧ 4

x def= ε y def

= 1 z def= 0101 ∀k ≥ 0 (xykz ∈ L(D4))

k = 0 : 0101 ∈ L(D4), k = 1 : 10101 ∈ L(D4),

k = 2 : 110101 ∈ L(D4), k = 3 : 1110101 ∈ L(D4), . . .

Pumping Lemma for Regular Sets:Let D = (Q,Σ, δ,q0,F )

be a DFA, n = |Q|w ∈ L(D) s.t. |w | ≥ n

Then ∃x , y , z ∈ Σ? s.t.

1. xyz = w

2. |xy | ≤ n

3. |y | > 0, and

4. ∀k ≥ 0 (xykz ∈ L(D))

1∗D4

1

1∗01∗

0

1

qf

00,1

n = 3, w = 10101 ∈ L(D4), |w | ≥ 3

Split w into x · y · z s.t. 1 ∧ 2 ∧ 3 ∧ 4

x def= ε y def

= 1 z def= 0101 ∀k ≥ 0 (xykz ∈ L(D4))

k = 0 : 0101 ∈ L(D4),

k = 1 : 10101 ∈ L(D4),

k = 2 : 110101 ∈ L(D4), k = 3 : 1110101 ∈ L(D4), . . .

Pumping Lemma for Regular Sets:Let D = (Q,Σ, δ,q0,F )

be a DFA, n = |Q|w ∈ L(D) s.t. |w | ≥ n

Then ∃x , y , z ∈ Σ? s.t.

1. xyz = w

2. |xy | ≤ n

3. |y | > 0, and

4. ∀k ≥ 0 (xykz ∈ L(D))

1∗D4

1

1∗01∗

0

1

qf

00,1

n = 3, w = 10101 ∈ L(D4), |w | ≥ 3

Split w into x · y · z s.t. 1 ∧ 2 ∧ 3 ∧ 4

x def= ε y def

= 1 z def= 0101 ∀k ≥ 0 (xykz ∈ L(D4))

k = 0 : 0101 ∈ L(D4), k = 1 : 10101 ∈ L(D4),

k = 2 : 110101 ∈ L(D4), k = 3 : 1110101 ∈ L(D4), . . .

Pumping Lemma for Regular Sets:Let D = (Q,Σ, δ,q0,F )

be a DFA, n = |Q|w ∈ L(D) s.t. |w | ≥ n

Then ∃x , y , z ∈ Σ? s.t.

1. xyz = w

2. |xy | ≤ n

3. |y | > 0, and

4. ∀k ≥ 0 (xykz ∈ L(D))

1∗D4

1

1∗01∗

0

1

qf

00,1

n = 3, w = 10101 ∈ L(D4), |w | ≥ 3

Split w into x · y · z s.t. 1 ∧ 2 ∧ 3 ∧ 4

x def= ε y def

= 1 z def= 0101 ∀k ≥ 0 (xykz ∈ L(D4))

k = 0 : 0101 ∈ L(D4), k = 1 : 10101 ∈ L(D4),

k = 2 : 110101 ∈ L(D4),

k = 3 : 1110101 ∈ L(D4), . . .

Pumping Lemma for Regular Sets:Let D = (Q,Σ, δ,q0,F )

be a DFA, n = |Q|w ∈ L(D) s.t. |w | ≥ n

Then ∃x , y , z ∈ Σ? s.t.

1. xyz = w

2. |xy | ≤ n

3. |y | > 0, and

4. ∀k ≥ 0 (xykz ∈ L(D))

1∗D4

1

1∗01∗

0

1

qf

00,1

n = 3, w = 10101 ∈ L(D4), |w | ≥ 3

Split w into x · y · z s.t. 1 ∧ 2 ∧ 3 ∧ 4

x def= ε y def

= 1 z def= 0101 ∀k ≥ 0 (xykz ∈ L(D4))

k = 0 : 0101 ∈ L(D4), k = 1 : 10101 ∈ L(D4),

k = 2 : 110101 ∈ L(D4), k = 3 : 1110101 ∈ L(D4), . . .

Pumping Lemma for Regular Sets:Let D = (Q,Σ, δ,q0,F )

be a DFA, n = |Q|w ∈ L(D) s.t. |w | ≥ n

Then ∃x , y , z ∈ Σ? s.t.

1. xyz = w

2. |xy | ≤ n

3. |y | > 0, and

4. ∀k ≥ 0 (xykz ∈ L(D))

1∗D4

1

1∗01∗

0

1

qf

00,1

n = 3, w = 000 ∈ L(D4), |w | ≥ 3

Split w into x · y · z s.t. 1 ∧ 2 ∧ 3 ∧ 4

x def= 00 y def

= 0 z def= ε ∀k ≥ 0 (xykz ∈ L(D4))

k = 0 : 00 ∈ L(D4), k = 1 : 000 ∈ L(D4),

k = 2 : 0000 ∈ L(D4), k = 3 : 00000 ∈ L(D4), . . .

Pumping Lemma for Regular Sets:Let D = (Q,Σ, δ,q0,F )

be a DFA, n = |Q|w ∈ L(D) s.t. |w | ≥ n

Then ∃x , y , z ∈ Σ? s.t.

1. xyz = w

2. |xy | ≤ n

3. |y | > 0, and

4. ∀k ≥ 0 (xykz ∈ L(D))

1∗D4

1

1∗01∗

0

1

qf

00,1

n = 3, w = 000 ∈ L(D4), |w | ≥ 3

Split w into x · y · z s.t. 1 ∧ 2 ∧ 3 ∧ 4

x def= 00 y def

= 0 z def= ε ∀k ≥ 0 (xykz ∈ L(D4))

k = 0 : 00 ∈ L(D4), k = 1 : 000 ∈ L(D4),

k = 2 : 0000 ∈ L(D4), k = 3 : 00000 ∈ L(D4), . . .

Pumping Lemma for Regular Sets:Let D = (Q,Σ, δ,q0,F )

be a DFA, n = |Q|w ∈ L(D) s.t. |w | ≥ n

Then ∃x , y , z ∈ Σ? s.t.

1. xyz = w

2. |xy | ≤ n

3. |y | > 0, and

4. ∀k ≥ 0 (xykz ∈ L(D))

1∗D4

1

1∗01∗

0

1

qf

00,1

n = 3, w = 000 ∈ L(D4), |w | ≥ 3

Split w into x · y · z s.t. 1 ∧ 2 ∧ 3 ∧ 4

x def= 00 y def

= 0 z def= ε ∀k ≥ 0 (xykz ∈ L(D4))

k = 0 : 00 ∈ L(D4), k = 1 : 000 ∈ L(D4),

k = 2 : 0000 ∈ L(D4), k = 3 : 00000 ∈ L(D4), . . .

Pumping Lemma for Regular Sets:Let D = (Q,Σ, δ,q0,F )

be a DFA, n = |Q|w ∈ L(D) s.t. |w | ≥ n

Then ∃x , y , z ∈ Σ? s.t.

1. xyz = w

2. |xy | ≤ n

3. |y | > 0, and

4. ∀k ≥ 0 (xykz ∈ L(D))

1∗D4

1

1∗01∗

0

1

qf

00,1

n = 3, w = 000 ∈ L(D4), |w | ≥ 3

Split w into x · y · z s.t. 1 ∧ 2 ∧ 3 ∧ 4

x def= 00 y def

= 0 z def= ε ∀k ≥ 0 (xykz ∈ L(D4))

k = 0 : 00 ∈ L(D4), k = 1 : 000 ∈ L(D4),

k = 2 : 0000 ∈ L(D4), k = 3 : 00000 ∈ L(D4), . . .

Pumping Lemma for Regular Sets:Let D = (Q,Σ, δ,q0,F )

be a DFA, n = |Q|w ∈ L(D) s.t. |w | ≥ n

Then ∃x , y , z ∈ Σ? s.t.

1. xyz = w

2. |xy | ≤ n

3. |y | > 0, and

4. ∀k ≥ 0 (xykz ∈ L(D))

1∗D4

1

1∗01∗

0

1

qf

00,1

n = 3, w = 000 ∈ L(D4), |w | ≥ 3

Split w into x · y · z s.t. 1 ∧ 2 ∧ 3 ∧ 4

x def= 00 y def

= 0 z def= ε

∀k ≥ 0 (xykz ∈ L(D4))

k = 0 : 00 ∈ L(D4), k = 1 : 000 ∈ L(D4),

k = 2 : 0000 ∈ L(D4), k = 3 : 00000 ∈ L(D4), . . .

Pumping Lemma for Regular Sets:Let D = (Q,Σ, δ,q0,F )

be a DFA, n = |Q|w ∈ L(D) s.t. |w | ≥ n

Then ∃x , y , z ∈ Σ? s.t.

1. xyz = w

2. |xy | ≤ n

3. |y | > 0, and

4. ∀k ≥ 0 (xykz ∈ L(D))

1∗D4

1

1∗01∗

0

1

qf

00,1

n = 3, w = 000 ∈ L(D4), |w | ≥ 3

Split w into x · y · z s.t. 1 ∧ 2 ∧ 3 ∧ 4

x def= 00 y def

= 0 z def= ε ∀k ≥ 0 (xykz ∈ L(D4))

k = 0 : 00 ∈ L(D4), k = 1 : 000 ∈ L(D4),

k = 2 : 0000 ∈ L(D4), k = 3 : 00000 ∈ L(D4), . . .

Pumping Lemma for Regular Sets:Let D = (Q,Σ, δ,q0,F )

be a DFA, n = |Q|w ∈ L(D) s.t. |w | ≥ n

Then ∃x , y , z ∈ Σ? s.t.

1. xyz = w

2. |xy | ≤ n

3. |y | > 0, and

4. ∀k ≥ 0 (xykz ∈ L(D))

1∗D4

1

1∗01∗

0

1

qf

00,1

n = 3, w = 000 ∈ L(D4), |w | ≥ 3

Split w into x · y · z s.t. 1 ∧ 2 ∧ 3 ∧ 4

x def= 00 y def

= 0 z def= ε ∀k ≥ 0 (xykz ∈ L(D4))

k = 0 : 00 ∈ L(D4),

k = 1 : 000 ∈ L(D4),

k = 2 : 0000 ∈ L(D4), k = 3 : 00000 ∈ L(D4), . . .

Pumping Lemma for Regular Sets:Let D = (Q,Σ, δ,q0,F )

be a DFA, n = |Q|w ∈ L(D) s.t. |w | ≥ n

Then ∃x , y , z ∈ Σ? s.t.

1. xyz = w

2. |xy | ≤ n

3. |y | > 0, and

4. ∀k ≥ 0 (xykz ∈ L(D))

1∗D4

1

1∗01∗

0

1

qf

00,1

n = 3, w = 000 ∈ L(D4), |w | ≥ 3

Split w into x · y · z s.t. 1 ∧ 2 ∧ 3 ∧ 4

x def= 00 y def

= 0 z def= ε ∀k ≥ 0 (xykz ∈ L(D4))

k = 0 : 00 ∈ L(D4), k = 1 : 000 ∈ L(D4),

k = 2 : 0000 ∈ L(D4), k = 3 : 00000 ∈ L(D4), . . .

Pumping Lemma for Regular Sets:Let D = (Q,Σ, δ,q0,F )

be a DFA, n = |Q|w ∈ L(D) s.t. |w | ≥ n

Then ∃x , y , z ∈ Σ? s.t.

1. xyz = w

2. |xy | ≤ n

3. |y | > 0, and

4. ∀k ≥ 0 (xykz ∈ L(D))

1∗D4

1

1∗01∗

0

1

qf

00,1

n = 3, w = 000 ∈ L(D4), |w | ≥ 3

Split w into x · y · z s.t. 1 ∧ 2 ∧ 3 ∧ 4

x def= 00 y def

= 0 z def= ε ∀k ≥ 0 (xykz ∈ L(D4))

k = 0 : 00 ∈ L(D4), k = 1 : 000 ∈ L(D4),

k = 2 : 0000 ∈ L(D4),

k = 3 : 00000 ∈ L(D4), . . .

Pumping Lemma for Regular Sets:Let D = (Q,Σ, δ,q0,F )

be a DFA, n = |Q|w ∈ L(D) s.t. |w | ≥ n

Then ∃x , y , z ∈ Σ? s.t.

1. xyz = w

2. |xy | ≤ n

3. |y | > 0, and

4. ∀k ≥ 0 (xykz ∈ L(D))

1∗D4

1

1∗01∗

0

1

qf

00,1

n = 3, w = 000 ∈ L(D4), |w | ≥ 3

Split w into x · y · z s.t. 1 ∧ 2 ∧ 3 ∧ 4

x def= 00 y def

= 0 z def= ε ∀k ≥ 0 (xykz ∈ L(D4))

k = 0 : 00 ∈ L(D4), k = 1 : 000 ∈ L(D4),

k = 2 : 0000 ∈ L(D4), k = 3 : 00000 ∈ L(D4), . . .

proof: Let w ∈ L(D), |w | ≥ n, w = w1,w2, . . . ,wn · u

w = w1 w2 w3 · · · wn uq0 q1 q2 q3 · · · qn−1 qn qf

By Pigeon-Hole Principle ∃i < j ≤ n (qi = qj)

w =

x︷ ︸︸ ︷w1 . . .wi

y︷ ︸︸ ︷wi+1 . . .wj

z︷ ︸︸ ︷wj+1 . . .wnu

q0 qi qi qf

qi = δ?(qi , y) |y | ≥ 1 δ?(qi , z) = qf ∈ F

Thus, xykz ∈ L(D) for k = 0,1,2, . . . �

proof: Let w ∈ L(D), |w | ≥ n, w = w1,w2, . . . ,wn · u

w = w1 w2 w3 · · · wn uq0 q1 q2 q3 · · · qn−1 qn qf

By Pigeon-Hole Principle ∃i < j ≤ n (qi = qj)

w =

x︷ ︸︸ ︷w1 . . .wi

y︷ ︸︸ ︷wi+1 . . .wj

z︷ ︸︸ ︷wj+1 . . .wnu

q0 qi qi qf

qi = δ?(qi , y) |y | ≥ 1 δ?(qi , z) = qf ∈ F

Thus, xykz ∈ L(D) for k = 0,1,2, . . . �

proof: Let w ∈ L(D), |w | ≥ n, w = w1,w2, . . . ,wn · u

w = w1 w2 w3 · · · wn uq0 q1 q2 q3 · · · qn−1 qn qf

By Pigeon-Hole Principle ∃i < j ≤ n (qi = qj)

w =

x︷ ︸︸ ︷w1 . . .wi

y︷ ︸︸ ︷wi+1 . . .wj

z︷ ︸︸ ︷wj+1 . . .wnu

q0 qi qi qf

qi = δ?(qi , y) |y | ≥ 1 δ?(qi , z) = qf ∈ F

Thus, xykz ∈ L(D) for k = 0,1,2, . . . �

proof: Let w ∈ L(D), |w | ≥ n, w = w1,w2, . . . ,wn · u

w = w1 w2 w3 · · · wn uq0 q1 q2 q3 · · · qn−1 qn qf

By Pigeon-Hole Principle ∃i < j ≤ n (qi = qj)

w =

x︷ ︸︸ ︷w1 . . .wi

y︷ ︸︸ ︷wi+1 . . .wj

z︷ ︸︸ ︷wj+1 . . .wnu

q0 qi qi qf

qi = δ?(qi , y) |y | ≥ 1 δ?(qi , z) = qf ∈ F

Thus, xykz ∈ L(D) for k = 0,1,2, . . . �

proof: Let w ∈ L(D), |w | ≥ n, w = w1,w2, . . . ,wn · u

w = w1 w2 w3 · · · wn uq0 q1 q2 q3 · · · qn−1 qn qf

By Pigeon-Hole Principle ∃i < j ≤ n (qi = qj)

w =

x︷ ︸︸ ︷w1 . . .wi

y︷ ︸︸ ︷wi+1 . . .wj

z︷ ︸︸ ︷wj+1 . . .wnu

q0 qi qi qf

qi = δ?(qi , y) |y | ≥ 1 δ?(qi , z) = qf ∈ F

Thus, xykz ∈ L(D) for k = 0,1,2, . . . �

proof: Let w ∈ L(D), |w | ≥ n, w = w1,w2, . . . ,wn · u

w = w1 w2 w3 · · · wn uq0 q1 q2 q3 · · · qn−1 qn qf

By Pigeon-Hole Principle ∃i < j ≤ n (qi = qj)

w =

x︷ ︸︸ ︷w1 . . .wi

y︷ ︸︸ ︷wi+1 . . .wj

z︷ ︸︸ ︷wj+1 . . .wnu

q0 qi qi qf

qi = δ?(qi , y) |y | ≥ 1 δ?(qi , z) = qf ∈ F

Thus, xykz ∈ L(D) for k = 0,1,2, . . . �

Pumping Lemma for Regular Sets:Let D = (Q,Σ, δ,q0,F ) be a DFA.

Let n = |Q|.

Let w ∈ L(D) s.t. |w | ≥ n.

Then ∃x , y , z ∈ Σ? s.t. the following all hold:1. xyz = w

2. |xy | ≤ n

3. |y | > 0, and

4. ∀k ≥ 0 (xykz ∈ L(D))

Easiest tool to prove languages not DFA acceptable

Pumping Lemma for Regular Sets:Let D = (Q,Σ, δ,q0,F ) be a DFA.

Let n = |Q|.

Let w ∈ L(D) s.t. |w | ≥ n.

Then ∃x , y , z ∈ Σ? s.t. the following all hold:1. xyz = w

2. |xy | ≤ n

3. |y | > 0, and

4. ∀k ≥ 0 (xykz ∈ L(D))

Easiest tool to prove languages not DFA acceptable

Prop: E ={

ar br∣∣ r ∈ N

}is not DFA acceptable.

proof by contradiction:Assume: E is accepted by DFA D with n states.

you (G) choose string: w ∈ E = L(D)Let w = anbn

By pumping lemma, D chooses x , y , z ∈ {a,b}?, s.t.,

1. w = anbn = xyz2. |xy | ≤ n3. |y | > 0, and4. ∀k ∈ N ( xykz ∈ E )

Since 0 < |xy | ≤ n, y = ai , 0 < i ≤ n

Thus xy0z = an−ibn ∈ E .

but an−ibn 6∈ E .

FTherefore E is not DFA acceptable. �

Prop: E ={

ar br∣∣ r ∈ N

}is not DFA acceptable.

proof by contradiction:Assume: E is accepted by DFA D with n states.

you (G) choose string: w ∈ E = L(D)Let w = anbn

By pumping lemma, D chooses x , y , z ∈ {a,b}?, s.t.,

1. w = anbn = xyz2. |xy | ≤ n3. |y | > 0, and4. ∀k ∈ N ( xykz ∈ E )

Since 0 < |xy | ≤ n, y = ai , 0 < i ≤ n

Thus xy0z = an−ibn ∈ E .

but an−ibn 6∈ E .

FTherefore E is not DFA acceptable. �

Prop: E ={

ar br∣∣ r ∈ N

}is not DFA acceptable.

proof by contradiction:Assume: E is accepted by DFA D with n states.

you (G) choose string: w ∈ E = L(D)

Let w = anbn

By pumping lemma, D chooses x , y , z ∈ {a,b}?, s.t.,

1. w = anbn = xyz2. |xy | ≤ n3. |y | > 0, and4. ∀k ∈ N ( xykz ∈ E )

Since 0 < |xy | ≤ n, y = ai , 0 < i ≤ n

Thus xy0z = an−ibn ∈ E .

but an−ibn 6∈ E .

FTherefore E is not DFA acceptable. �

Prop: E ={

ar br∣∣ r ∈ N

}is not DFA acceptable.

proof by contradiction:Assume: E is accepted by DFA D with n states.

you (G) choose string: w ∈ E = L(D)Let w = anbn

By pumping lemma, D chooses x , y , z ∈ {a,b}?, s.t.,

1. w = anbn = xyz2. |xy | ≤ n3. |y | > 0, and4. ∀k ∈ N ( xykz ∈ E )

Since 0 < |xy | ≤ n, y = ai , 0 < i ≤ n

Thus xy0z = an−ibn ∈ E .

but an−ibn 6∈ E .

FTherefore E is not DFA acceptable. �

Prop: E ={

ar br∣∣ r ∈ N

}is not DFA acceptable.

proof by contradiction:Assume: E is accepted by DFA D with n states.

you (G) choose string: w ∈ E = L(D)Let w = anbn

By pumping lemma, D chooses x , y , z ∈ {a,b}?, s.t.,

1. w = anbn = xyz2. |xy | ≤ n3. |y | > 0, and4. ∀k ∈ N ( xykz ∈ E )

Since 0 < |xy | ≤ n, y = ai , 0 < i ≤ n

Thus xy0z = an−ibn ∈ E .

but an−ibn 6∈ E .

FTherefore E is not DFA acceptable. �

Prop: E ={

ar br∣∣ r ∈ N

}is not DFA acceptable.

proof by contradiction:Assume: E is accepted by DFA D with n states.

you (G) choose string: w ∈ E = L(D)Let w = anbn

By pumping lemma, D chooses x , y , z ∈ {a,b}?, s.t.,

1. w = anbn = xyz2. |xy | ≤ n3. |y | > 0, and4. ∀k ∈ N ( xykz ∈ E )

Since 0 < |xy | ≤ n, y = ai , 0 < i ≤ n

Thus xy0z = an−ibn ∈ E .

but an−ibn 6∈ E .

FTherefore E is not DFA acceptable. �

Prop: E ={

ar br∣∣ r ∈ N

}is not DFA acceptable.

proof by contradiction:Assume: E is accepted by DFA D with n states.

you (G) choose string: w ∈ E = L(D)Let w = anbn

By pumping lemma, D chooses x , y , z ∈ {a,b}?, s.t.,

1. w = anbn = xyz2. |xy | ≤ n3. |y | > 0, and4. ∀k ∈ N ( xykz ∈ E )

Since 0 < |xy | ≤ n, y = ai , 0 < i ≤ n

Thus xy0z = an−ibn ∈ E .

but an−ibn 6∈ E .

FTherefore E is not DFA acceptable. �

Prop: E ={

ar br∣∣ r ∈ N

}is not DFA acceptable.

proof by contradiction:Assume: E is accepted by DFA D with n states.

you (G) choose string: w ∈ E = L(D)Let w = anbn

By pumping lemma, D chooses x , y , z ∈ {a,b}?, s.t.,

1. w = anbn = xyz2. |xy | ≤ n3. |y | > 0, and4. ∀k ∈ N ( xykz ∈ E )

Since 0 < |xy | ≤ n, y = ai , 0 < i ≤ n

Thus xy0z = an−ibn ∈ E .

but an−ibn 6∈ E .

FTherefore E is not DFA acceptable. �

Prop: E ={

ar br∣∣ r ∈ N

}is not DFA acceptable.

proof by contradiction:Assume: E is accepted by DFA D with n states.

you (G) choose string: w ∈ E = L(D)Let w = anbn

By pumping lemma, D chooses x , y , z ∈ {a,b}?, s.t.,

1. w = anbn = xyz2. |xy | ≤ n3. |y | > 0, and4. ∀k ∈ N ( xykz ∈ E )

Since 0 < |xy | ≤ n, y = ai , 0 < i ≤ n

Thus xy0z = an−ibn ∈ E .

but an−ibn 6∈ E .

F

Therefore E is not DFA acceptable. �

Prop: E ={

ar br∣∣ r ∈ N

}is not DFA acceptable.

proof by contradiction:Assume: E is accepted by DFA D with n states.

you (G) choose string: w ∈ E = L(D)Let w = anbn

By pumping lemma, D chooses x , y , z ∈ {a,b}?, s.t.,

1. w = anbn = xyz2. |xy | ≤ n3. |y | > 0, and4. ∀k ∈ N ( xykz ∈ E )

Since 0 < |xy | ≤ n, y = ai , 0 < i ≤ n

Thus xy0z = an−ibn ∈ E .

but an−ibn 6∈ E .

FTherefore E is not DFA acceptable. �

Prop: M ={

w ∈ {a,b}?∣∣ #a(w) > #b(w)

}not DFA-acceptable.

proof by contradiction:Assume: M is accepted by DFA D with n states.

you choose string: w ∈ M = L(D) Let w = an+1bn

By pumping lemma, D chooses x , y , z ∈ {a,b}∗ s.t.

1. w = an+1bn = xyz2. |xy | ≤ n3. |y | > 0, and4. ∀k ∈ N ( xykz ∈ M )

Since 0 < |xy | ≤ n, y = ai , 0 < i ≤ n

Thus xy0z = an+1−ibn ∈ M.

but an+1−ibn 6∈ M.

FTherefore M is not DFA acceptable. �

Prop: M ={

w ∈ {a,b}?∣∣ #a(w) > #b(w)

}not DFA-acceptable.

proof by contradiction:Assume: M is accepted by DFA D with n states.

you choose string: w ∈ M = L(D) Let w = an+1bn

By pumping lemma, D chooses x , y , z ∈ {a,b}∗ s.t.

1. w = an+1bn = xyz2. |xy | ≤ n3. |y | > 0, and4. ∀k ∈ N ( xykz ∈ M )

Since 0 < |xy | ≤ n, y = ai , 0 < i ≤ n

Thus xy0z = an+1−ibn ∈ M.

but an+1−ibn 6∈ M.

FTherefore M is not DFA acceptable. �

Prop: M ={

w ∈ {a,b}?∣∣ #a(w) > #b(w)

}not DFA-acceptable.

proof by contradiction:Assume: M is accepted by DFA D with n states.

you choose string: w ∈ M = L(D)

Let w = an+1bn

By pumping lemma, D chooses x , y , z ∈ {a,b}∗ s.t.

1. w = an+1bn = xyz2. |xy | ≤ n3. |y | > 0, and4. ∀k ∈ N ( xykz ∈ M )

Since 0 < |xy | ≤ n, y = ai , 0 < i ≤ n

Thus xy0z = an+1−ibn ∈ M.

but an+1−ibn 6∈ M.

FTherefore M is not DFA acceptable. �

Prop: M ={

w ∈ {a,b}?∣∣ #a(w) > #b(w)

}not DFA-acceptable.

proof by contradiction:Assume: M is accepted by DFA D with n states.

you choose string: w ∈ M = L(D) Let w = an+1bn

By pumping lemma, D chooses x , y , z ∈ {a,b}∗ s.t.

1. w = an+1bn = xyz2. |xy | ≤ n3. |y | > 0, and4. ∀k ∈ N ( xykz ∈ M )

Since 0 < |xy | ≤ n, y = ai , 0 < i ≤ n

Thus xy0z = an+1−ibn ∈ M.

but an+1−ibn 6∈ M.

FTherefore M is not DFA acceptable. �

Prop: M ={

w ∈ {a,b}?∣∣ #a(w) > #b(w)

}not DFA-acceptable.

proof by contradiction:Assume: M is accepted by DFA D with n states.

you choose string: w ∈ M = L(D) Let w = an+1bn

By pumping lemma, D chooses x , y , z ∈ {a,b}∗ s.t.

1. w = an+1bn = xyz2. |xy | ≤ n3. |y | > 0, and4. ∀k ∈ N ( xykz ∈ M )

Since 0 < |xy | ≤ n, y = ai , 0 < i ≤ n

Thus xy0z = an+1−ibn ∈ M.

but an+1−ibn 6∈ M.

FTherefore M is not DFA acceptable. �

Prop: M ={

w ∈ {a,b}?∣∣ #a(w) > #b(w)

}not DFA-acceptable.

proof by contradiction:Assume: M is accepted by DFA D with n states.

you choose string: w ∈ M = L(D) Let w = an+1bn

By pumping lemma, D chooses x , y , z ∈ {a,b}∗ s.t.

1. w = an+1bn = xyz2. |xy | ≤ n3. |y | > 0, and4. ∀k ∈ N ( xykz ∈ M )

Since 0 < |xy | ≤ n, y = ai , 0 < i ≤ n

Thus xy0z = an+1−ibn ∈ M.

but an+1−ibn 6∈ M.

FTherefore M is not DFA acceptable. �

Prop: M ={

w ∈ {a,b}?∣∣ #a(w) > #b(w)

}not DFA-acceptable.

proof by contradiction:Assume: M is accepted by DFA D with n states.

you choose string: w ∈ M = L(D) Let w = an+1bn

By pumping lemma, D chooses x , y , z ∈ {a,b}∗ s.t.

1. w = an+1bn = xyz2. |xy | ≤ n3. |y | > 0, and4. ∀k ∈ N ( xykz ∈ M )

Since 0 < |xy | ≤ n, y = ai , 0 < i ≤ n

Thus xy0z = an+1−ibn ∈ M.

but an+1−ibn 6∈ M.

FTherefore M is not DFA acceptable. �

Prop: M ={

w ∈ {a,b}?∣∣ #a(w) > #b(w)

}not DFA-acceptable.

proof by contradiction:Assume: M is accepted by DFA D with n states.

you choose string: w ∈ M = L(D) Let w = an+1bn

By pumping lemma, D chooses x , y , z ∈ {a,b}∗ s.t.

1. w = an+1bn = xyz2. |xy | ≤ n3. |y | > 0, and4. ∀k ∈ N ( xykz ∈ M )

Since 0 < |xy | ≤ n, y = ai , 0 < i ≤ n

Thus xy0z = an+1−ibn ∈ M.

but an+1−ibn 6∈ M.

FTherefore M is not DFA acceptable. �

Prop: M ={

w ∈ {a,b}?∣∣ #a(w) > #b(w)

}not DFA-acceptable.

proof by contradiction:Assume: M is accepted by DFA D with n states.

you choose string: w ∈ M = L(D) Let w = an+1bn

By pumping lemma, D chooses x , y , z ∈ {a,b}∗ s.t.

1. w = an+1bn = xyz2. |xy | ≤ n3. |y | > 0, and4. ∀k ∈ N ( xykz ∈ M )

Since 0 < |xy | ≤ n, y = ai , 0 < i ≤ n

Thus xy0z = an+1−ibn ∈ M.

but an+1−ibn 6∈ M.

F

Therefore M is not DFA acceptable. �

Prop: M ={

w ∈ {a,b}?∣∣ #a(w) > #b(w)

}not DFA-acceptable.

proof by contradiction:Assume: M is accepted by DFA D with n states.

you choose string: w ∈ M = L(D) Let w = an+1bn

By pumping lemma, D chooses x , y , z ∈ {a,b}∗ s.t.

1. w = an+1bn = xyz2. |xy | ≤ n3. |y | > 0, and4. ∀k ∈ N ( xykz ∈ M )

Since 0 < |xy | ≤ n, y = ai , 0 < i ≤ n

Thus xy0z = an+1−ibn ∈ M.

but an+1−ibn 6∈ M.

FTherefore M is not DFA acceptable. �

Prop: P ={

w ∈ {a,b}?∣∣ |w | is prime

}is not DFA acceptable.

proof: Assume: P is accepted

by DFA D with n states.

you choose string: w ∈ P = L(D) to get contradiction

Let w = ap where p ≥ n is prime

By pumping lemma, D chooses x , y , z ∈ {a,b}∗ s.t.

1. w = ap = xyz2. |xy | ≤ n3. |y | > 0, and4. ∀k ∈ N ( xykz ∈ P )

y = ai , 0 < i ≤ n

Thus xyp+1z = xyzyp = apap·i = ap(i+1) ∈ P.

but p(i + 1) is not prime, so xyp+1z 6∈ P.

FTherefore P is not regular. �

Prop: P ={

w ∈ {a,b}?∣∣ |w | is prime

}is not DFA acceptable.

proof: Assume: P is accepted by DFA D with n states.

you choose string: w ∈ P = L(D) to get contradiction

Let w = ap where p ≥ n is prime

By pumping lemma, D chooses x , y , z ∈ {a,b}∗ s.t.

1. w = ap = xyz2. |xy | ≤ n3. |y | > 0, and4. ∀k ∈ N ( xykz ∈ P )

y = ai , 0 < i ≤ n

Thus xyp+1z = xyzyp = apap·i = ap(i+1) ∈ P.

but p(i + 1) is not prime, so xyp+1z 6∈ P.

FTherefore P is not regular. �

Prop: P ={

w ∈ {a,b}?∣∣ |w | is prime

}is not DFA acceptable.

proof: Assume: P is accepted by DFA D with n states.

you choose string: w ∈ P = L(D) to get contradiction

Let w = ap where p ≥ n is prime

By pumping lemma, D chooses x , y , z ∈ {a,b}∗ s.t.

1. w = ap = xyz2. |xy | ≤ n3. |y | > 0, and4. ∀k ∈ N ( xykz ∈ P )

y = ai , 0 < i ≤ n

Thus xyp+1z = xyzyp = apap·i = ap(i+1) ∈ P.

but p(i + 1) is not prime, so xyp+1z 6∈ P.

FTherefore P is not regular. �

Prop: P ={

w ∈ {a,b}?∣∣ |w | is prime

}is not DFA acceptable.

proof: Assume: P is accepted by DFA D with n states.

you choose string: w ∈ P = L(D) to get contradiction

Let w = ap where p ≥ n is prime

By pumping lemma, D chooses x , y , z ∈ {a,b}∗ s.t.

1. w = ap = xyz2. |xy | ≤ n3. |y | > 0, and4. ∀k ∈ N ( xykz ∈ P )

y = ai , 0 < i ≤ n

Thus xyp+1z = xyzyp = apap·i = ap(i+1) ∈ P.

but p(i + 1) is not prime, so xyp+1z 6∈ P.

FTherefore P is not regular. �

Prop: P ={

w ∈ {a,b}?∣∣ |w | is prime

}is not DFA acceptable.

proof: Assume: P is accepted by DFA D with n states.

you choose string: w ∈ P = L(D) to get contradiction

Let w = ap where p ≥ n is prime

By pumping lemma, D chooses x , y , z ∈ {a,b}∗ s.t.

1. w = ap = xyz2. |xy | ≤ n3. |y | > 0, and4. ∀k ∈ N ( xykz ∈ P )

y = ai , 0 < i ≤ n

Thus xyp+1z = xyzyp = apap·i = ap(i+1) ∈ P.

but p(i + 1) is not prime, so xyp+1z 6∈ P.

FTherefore P is not regular. �

Prop: P ={

w ∈ {a,b}?∣∣ |w | is prime

}is not DFA acceptable.

proof: Assume: P is accepted by DFA D with n states.

you choose string: w ∈ P = L(D) to get contradiction

Let w = ap where p ≥ n is prime

By pumping lemma, D chooses x , y , z ∈ {a,b}∗ s.t.

1. w = ap = xyz2. |xy | ≤ n3. |y | > 0, and4. ∀k ∈ N ( xykz ∈ P )

y = ai , 0 < i ≤ n

Thus xyp+1z = xyzyp = apap·i = ap(i+1) ∈ P.

but p(i + 1) is not prime, so xyp+1z 6∈ P.

FTherefore P is not regular. �

Prop: P ={

w ∈ {a,b}?∣∣ |w | is prime

}is not DFA acceptable.

proof: Assume: P is accepted by DFA D with n states.

you choose string: w ∈ P = L(D) to get contradiction

Let w = ap where p ≥ n is prime

By pumping lemma, D chooses x , y , z ∈ {a,b}∗ s.t.

1. w = ap = xyz2. |xy | ≤ n3. |y | > 0, and4. ∀k ∈ N ( xykz ∈ P )

y = ai , 0 < i ≤ n

Thus xyp+1z = xyzyp = apap·i = ap(i+1) ∈ P.

but p(i + 1) is not prime, so xyp+1z 6∈ P.

FTherefore P is not regular. �

Prop: P ={

w ∈ {a,b}?∣∣ |w | is prime

}is not DFA acceptable.

proof: Assume: P is accepted by DFA D with n states.

you choose string: w ∈ P = L(D) to get contradiction

Let w = ap where p ≥ n is prime

By pumping lemma, D chooses x , y , z ∈ {a,b}∗ s.t.

1. w = ap = xyz2. |xy | ≤ n3. |y | > 0, and4. ∀k ∈ N ( xykz ∈ P )

y = ai , 0 < i ≤ n

Thus xyp+1z = xyzyp = apap·i = ap(i+1) ∈ P.

but p(i + 1) is not prime, so xyp+1z 6∈ P.

FTherefore P is not regular. �

Prop: P ={

w ∈ {a,b}?∣∣ |w | is prime

}is not DFA acceptable.

proof: Assume: P is accepted by DFA D with n states.

you choose string: w ∈ P = L(D) to get contradiction

Let w = ap where p ≥ n is prime

By pumping lemma, D chooses x , y , z ∈ {a,b}∗ s.t.

1. w = ap = xyz2. |xy | ≤ n3. |y | > 0, and4. ∀k ∈ N ( xykz ∈ P )

y = ai , 0 < i ≤ n

Thus xyp+1z = xyzyp = apap·i = ap(i+1) ∈ P.

but p(i + 1) is not prime, so xyp+1z 6∈ P.

F

Therefore P is not regular. �

Prop: P ={

w ∈ {a,b}?∣∣ |w | is prime

}is not DFA acceptable.

proof: Assume: P is accepted by DFA D with n states.

you choose string: w ∈ P = L(D) to get contradiction

Let w = ap where p ≥ n is prime

By pumping lemma, D chooses x , y , z ∈ {a,b}∗ s.t.

1. w = ap = xyz2. |xy | ≤ n3. |y | > 0, and4. ∀k ∈ N ( xykz ∈ P )

y = ai , 0 < i ≤ n

Thus xyp+1z = xyzyp = apap·i = ap(i+1) ∈ P.

but p(i + 1) is not prime, so xyp+1z 6∈ P.

FTherefore P is not regular. �

Pumping Lemma for Regular SetsLet D = (Q,Σ, δ,q0,F ) be a DFA.

Let n = |Q|.

You (G) choose w ∈ L(D) s.t. |w | ≥ n.

Then D chooses x , y , z ∈ Σ? s.t. the following all hold:1. xyz = w

2. |xy | ≤ n

3. |y | > 0, and

4. ∀k ≥ 0 (xykz ∈ L(D))

Finally, you point out why a contradiction ensues.

Pumping Lemma for Regular SetsLet D = (Q,Σ, δ,q0,F ) be a DFA.

Let n = |Q|.

You (G) choose w ∈ L(D) s.t. |w | ≥ n.

Then D chooses x , y , z ∈ Σ? s.t. the following all hold:1. xyz = w

2. |xy | ≤ n

3. |y | > 0, and

4. ∀k ≥ 0 (xykz ∈ L(D))

Finally, you point out why a contradiction ensues.

Preview: Nondeterministic Finite Automata (NFA)

{w ∈ {0,1}∗

∣∣ w has 001 or 100}

= L((0|1)∗(001|100)(0|1)∗)

Build an NFA N5 that accepts L((0|1)∗(001|100)(0|1)∗)

ε

0,1

N5

0

0

1

1

100

000

qf

0

1 0,1

Preview: Nondeterministic Finite Automata (NFA)

{w ∈ {0,1}∗

∣∣ w has 001 or 100}

= L((0|1)∗(001|100)(0|1)∗)

Build an NFA N5 that accepts L((0|1)∗(001|100)(0|1)∗)

ε

0,1

N5

0

0

1

1

100

000

qf

0

1 0,1

Preview: Nondeterministic Finite Automata (NFA)

{w ∈ {0,1}∗

∣∣ w has 001 or 100}

= L((0|1)∗(001|100)(0|1)∗)

Build an NFA N5 that accepts L((0|1)∗(001|100)(0|1)∗)

ε

0,1

N5

0

0

1

1

100

000

qf

0

1 0,1

Preview: Nondeterministic Finite Automata (NFA)

{w ∈ {0,1}∗

∣∣ w has 001 or 100}

= L((0|1)∗(001|100)(0|1)∗)

Build an NFA N5 that accepts L((0|1)∗(001|100)(0|1)∗)

ε

0,1

N5

0

0

1

1

100

000

qf

0

1 0,1

Preview: Nondeterministic Finite Automata (NFA)

{w ∈ {0,1}∗

∣∣ w has 001 or 100}

= L((0|1)∗(001|100)(0|1)∗)

Build an NFA N5 that accepts L((0|1)∗(001|100)(0|1)∗)

ε

0,1

N5

0

0

1

1

100

000

qf

0

1 0,1

Preview: Nondeterministic Finite Automata (NFA)

{w ∈ {0,1}∗

∣∣ w has 001 or 100}

= L((0|1)∗(001|100)(0|1)∗)

Build an NFA N5 that accepts L((0|1)∗(001|100)(0|1)∗)

ε

0,1

N5

0

0

1

1

100

000

qf

0

1 0,1

Preview: Nondeterministic Finite Automata (NFA)

{w ∈ {0,1}∗

∣∣ w has 001 or 100}

= L((0|1)∗(001|100)(0|1)∗)

Build an NFA N5 that accepts L((0|1)∗(001|100)(0|1)∗)

ε

0,1

N5

0

0

1

1

100

000

qf

0

1 0,1

Goal for Friday

Kleene’s Theorem Let A ⊆ Σ? be any language. Then thefollowing are equivalent:

1. A = L(D), for some DFA D.

2. A = L(N), for some NFA N wo ε transitions.

3. A = L(N), for some NFA N.

4. A = L(e), for some regular expression e.

5. A is regular.

True by definition: (4)⇔ (5)

Goal for Friday

Kleene’s Theorem Let A ⊆ Σ? be any language. Then thefollowing are equivalent:

1. A = L(D), for some DFA D.

2. A = L(N), for some NFA N wo ε transitions.

3. A = L(N), for some NFA N.

4. A = L(e), for some regular expression e.

5. A is regular.

True by definition: (4)⇔ (5)

top related