the pumping azadeh/page11/page12/material/pumping-lemآ  the pumping lemma n x theorem. for any...

Download THE PUMPING azadeh/page11/page12/material/pumping-lemآ  THE PUMPING LEMMA n x Theorem. For any regular

If you can't read please download the document

Post on 04-Jun-2020

1 views

Category:

Documents

0 download

Embed Size (px)

TRANSCRIPT

  • THE PUMPING LEMMA

  • THE PUMPING LEMMA

    x

    Theorem. For any regular language L there exists an integer n, such that for all x ∈ L with |x| ≥ n, there exist u, v, w ∈ Σ∗, such that

    (1) x = uvw

    (2) |uv| ≤ n

    (3) |v| ≥ 1

    (4) for all i ≥ 0: uviw ∈ L. x L

  • THE PUMPING LEMMA

    n x

    Theorem. For any regular language L there exists an integer n, such that for all x ∈ L with |x| ≥ n, there exist u, v, w ∈ Σ∗, such that

    (1) x = uvw

    (2) |uv| ≤ n

    (3) |v| ≥ 1

    (4) for all i ≥ 0: uviw ∈ L. x L

  • THE PUMPING LEMMA

    n x

    Theorem. For any regular language L there exists an integer n, such that for all x ∈ L with |x| ≥ n, there exist u, v, w ∈ Σ∗, such that

    (1) x = uvw

    (2) |uv| ≤ n

    (3) |v| ≥ 1

    (4) for all i ≥ 0: uviw ∈ L.

    x L

  • THE PUMPING LEMMA

    n

    x

    Theorem. For any regular language L there exists an integer n, such that for all x ∈ L with |x| ≥ n, there exist u, v, w ∈ Σ∗, such that

    (1) x = uvw

    (2) |uv| ≤ n

    (3) |v| ≥ 1

    (4) for all i ≥ 0: uviw ∈ L.

    x L

  • THE PUMPING LEMMA

    n

    x

    Theorem. For any regular language L there exists an integer n, such that for all x ∈ L with |x| ≥ n, there exist u, v, w ∈ Σ∗, such that

    (1) x = uvw

    (2) |uv| ≤ n

    (3) |v| ≥ 1

    (4) for all i ≥ 0: uviw ∈ L.

    x

    u v w

    L

  • THE PUMPING LEMMA

    n

    x

    Theorem. For any regular language L there exists an integer n, such that for all x ∈ L with |x| ≥ n, there exist u, v, w ∈ Σ∗, such that

    (1) x = uvw

    (2) |uv| ≤ n

    (3) |v| ≥ 1

    (4) for all i ≥ 0: uviw ∈ L.

    x u w u v w

    L

  • THE PUMPING LEMMA

    n

    x

    Theorem. For any regular language L there exists an integer n, such that for all x ∈ L with |x| ≥ n, there exist u, v, w ∈ Σ∗, such that

    (1) x = uvw

    (2) |uv| ≤ n

    (3) |v| ≥ 1

    (4) for all i ≥ 0: uviw ∈ L.

    x

    u v wv

    u w u v w

    L

  • THE PUMPING LEMMA

    n

    x

    Theorem. For any regular language L there exists an integer n, such that for all x ∈ L with |x| ≥ n, there exist u, v, w ∈ Σ∗, such that

    (1) x = uvw

    (2) |uv| ≤ n

    (3) |v| ≥ 1

    (4) for all i ≥ 0: uviw ∈ L.

    x

    u v wv

    u w u v w

    u v wv v

    L

  • PROOF OF P.L. (SKETCH)

  • PROOF OF P.L. (SKETCH)

    Let M be a DFA for L. Take n be the number of states of M plus 1.

  • PROOF OF P.L. (SKETCH)

    Let M be a DFA for L. Take n be the number of states of M plus 1.

    Take any x ∈ L with |x| ≥ n. Consider the path (from start state to an accepting state) in M that corresponds to x. The length of this path is |x| ≥ n.

  • PROOF OF P.L. (SKETCH)

    Let M be a DFA for L. Take n be the number of states of M plus 1.

    Since M has at most n − 1 states, some state must be visited twice or more in the first n steps of the path.

    Take any x ∈ L with |x| ≥ n. Consider the path (from start state to an accepting state) in M that corresponds to x. The length of this path is |x| ≥ n.

  • PROOF OF P.L. (SKETCH)

    Let M be a DFA for L. Take n be the number of states of M plus 1.

    Since M has at most n − 1 states, some state must be visited twice or more in the first n steps of the path.

    Take any x ∈ L with |x| ≥ n. Consider the path (from start state to an accepting state) in M that corresponds to x. The length of this path is |x| ≥ n.

    u

    vw

  • PROOF OF P.L. (SKETCH)

    Let M be a DFA for L. Take n be the number of states of M plus 1.

    Since M has at most n − 1 states, some state must be visited twice or more in the first n steps of the path.

    Take any x ∈ L with |x| ≥ n. Consider the path (from start state to an accepting state) in M that corresponds to x. The length of this path is |x| ≥ n.

    u

    vw x = uvw ∈ L

    uw ∈ L uvvw ∈ L uvvvw ∈ L. . .

  • L regular =⇒ L satisfies P.L. L non-regular =⇒ ? L non-regular ⇐= L doesn’t satisfy P.L.

    Negation:

    ∃ n ∈ N ∀ x ∈ L with |x| ≥ n ∃ u, v, w ∈ Σ∗ all of these hold:

    (1) x = uvw

    (2) |uv| ≤ n

    (3) |v| ≥ 1

    (4) ∀ i ≥ 0: uviw ∈ L.

    USING PUMPING LEMMA TO PROVE NON-REGULARITY

  • L regular =⇒ L satisfies P.L. L non-regular =⇒ ? L non-regular ⇐= L doesn’t satisfy P.L.

    Negation:

    ∃ n ∈ N ∀ x ∈ L with |x| ≥ n ∃ u, v, w ∈ Σ∗ all of these hold:

    (1) x = uvw

    (2) |uv| ≤ n

    (3) |v| ≥ 1

    (4) ∀ i ≥ 0: uviw ∈ L.

    USING PUMPING LEMMA TO PROVE NON-REGULARITY

  • L regular =⇒ L satisfies P.L. L non-regular =⇒ ? L non-regular ⇐= L doesn’t satisfy P.L.

    Negation:

    ∃ n ∈ N ∀ x ∈ L with |x| ≥ n ∃ u, v, w ∈ Σ∗ all of these hold:

    (1) x = uvw

    (2) |uv| ≤ n

    (3) |v| ≥ 1

    (4) ∀ i ≥ 0: uviw ∈ L.

    ∀ n ∈ N ∃ x ∈ L with |x| ≥ n ∀ u, v, w ∈ Σ∗ not all of these hold:

    (1) x = uvw

    (2) |uv| ≤ n

    (3) |v| ≥ 1

    (4) ∀ i ≥ 0: uviw ∈ L.

    USING PUMPING LEMMA TO PROVE NON-REGULARITY

  • L regular =⇒ L satisfies P.L. L non-regular =⇒ ? L non-regular ⇐= L doesn’t satisfy P.L.

    Negation:

    ∃ n ∈ N ∀ x ∈ L with |x| ≥ n ∃ u, v, w ∈ Σ∗ all of these hold:

    (1) x = uvw

    (2) |uv| ≤ n

    (3) |v| ≥ 1

    (4) ∀ i ≥ 0: uviw ∈ L.

    ∀ n ∈ N ∃ x ∈ L with |x| ≥ n ∀ u, v, w ∈ Σ∗ not all of these hold:

    (1) x = uvw

    (2) |uv| ≤ n

    (3) |v| ≥ 1

    (4) ∀ i ≥ 0: uviw ∈ L.

    Equivalently: (1) ∧ (2) ∧ (3)⇒ not(4) where not(4) is: ∃ i : uviw �∈ L

    USING PUMPING LEMMA TO PROVE NON-REGULARITY

  • EXAMPLE 1

    Prove that L = {0i1i : i ≥ 0} is NOT regular.

  • EXAMPLE 1

    Prove that L = {0i1i : i ≥ 0} is NOT regular. Proof. Show that P.L. doesn’t hold (note: showing P.L. holds doesn’t mean regularity).

  • EXAMPLE 1

    Prove that L = {0i1i : i ≥ 0} is NOT regular. Proof. Show that P.L. doesn’t hold (note: showing P.L. holds doesn’t mean regularity). If L is regular, then by P.L. ∃n such that . . .

  • EXAMPLE 1

    Prove that L = {0i1i : i ≥ 0} is NOT regular. Proof. Show that P.L. doesn’t hold (note: showing P.L. holds doesn’t mean regularity). If L is regular, then by P.L. ∃n such that . . . Now let x = 0n1n

  • EXAMPLE 1

    Prove that L = {0i1i : i ≥ 0} is NOT regular. Proof. Show that P.L. doesn’t hold (note: showing P.L. holds doesn’t mean regularity). If L is regular, then by P.L. ∃n such that . . . Now let x = 0n1n

    x ∈ L and |x| ≥ n, so by P.L. ∃u, v, w such that (1)–(4) hold.

  • EXAMPLE 1

    Prove that L = {0i1i : i ≥ 0} is NOT regular. Proof. Show that P.L. doesn’t hold (note: showing P.L. holds doesn’t mean regularity). If L is regular, then by P.L. ∃n such that . . . Now let x = 0n1n

    x ∈ L and |x| ≥ n, so by P.L. ∃u, v, w such that (1)–(4) hold. We show that ∀u, v, w (1)–(4) don’t all hold.

  • EXAMPLE 1

    Prove that L = {0i1i : i ≥ 0} is NOT regular. Proof. Show that P.L. doesn’t hold (note: showing P.L. holds doesn’t mean regularity). If L is regular, then by P.L. ∃n such that . . . Now let x = 0n1n

    x ∈ L and |x| ≥ n, so by P.L. ∃u, v, w such that (1)–(4) hold. We show that ∀u, v, w (1)–(4) don’t all hold. If (1), (2), (3) hold then x = 0n1n = uvw with |uv| ≤ n and |v| ≥ 1.

  • EXAMPLE 1

    Prove that L = {0i1i : i ≥ 0} is NOT regular. Proof. Show that P.L. doesn’t hold (note: showing P.L. holds doesn’t mean regularity). If L is regular, then by P.L. ∃n such that . . . Now let x = 0n1n

    x ∈ L and |x| ≥ n, so by P.L. ∃u, v, w such that (1)–(4) hold. We show that ∀u, v, w (1)–(4) don’t all hold. If (1), (2), (3) hold then x = 0n1n = uvw with |uv| ≤ n and |v| ≥ 1. So, u = 0s, v = 0t, w = 0p1n with

  • EXAMPLE 1

    Prove that L = {0i1i : i ≥ 0} is NOT regular. Proof. Show that P.L. doesn’t hold (note: showing P.L. holds doesn’t mean regularity). If L is regular, then by P.L. ∃n such that . . . Now let x = 0n1n

    x ∈ L and |x| ≥ n, so by P.L. ∃u, v, w such that (1)–(4) hold. We show that ∀u, v, w (1)–(4) don’t all hold. If (1), (2), (3) hold then x = 0n1n = uvw with |uv| ≤ n and |v| ≥ 1. So, u = 0s, v = 0t, w = 0p1n with

    s + t ≤ n, t ≥ 1, p ≥ 0, s + t + p = n.

  • EXAMPLE 1

    Prove that L = {0i1i : i ≥ 0} is NOT regular. Proof. Show that P.L. doesn’t hold (note: showing P.L. holds doesn’t mean regularity). If L is regular, then by P.L. ∃n such that . . . Now let x = 0n1n

    x ∈ L and |x| ≥ n, so by P.L. ∃u, v, w such that (1)–(4) hold. We show that ∀u, v, w (1)–(4) don’t all hold. If (1), (2), (3) hold then x = 0n1n = uvw with

Recommended

View more >