• No results found

CS310 : Automata Theory 2020

N/A
N/A
Protected

Academic year: 2022

Share "CS310 : Automata Theory 2020"

Copied!
43
0
0

Loading.... (view fulltext now)

Full text

(1)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 1

CS310 : Automata Theory 2020

Lecture 5: NFA to DFA: blowup and more

Instructor: S. Akshay

IIT Bombay, India

21-01-2020

(2)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 2

Logistics

Course material online

https://www.cse.iitb.ac.in/~akshayss/courses/cs310-2020/

Discussions

I For online discussions: Piazza

I Problem solving session: Next Tuesday at 7pm.

I Quiz 1 Timing: Friday 31st Jan at 7.15pm

I Office hours for doubt clearance: Today at 7.30pm at CC 504.

(3)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 2

Logistics

Course material online

https://www.cse.iitb.ac.in/~akshayss/courses/cs310-2020/

Discussions

I For online discussions: Piazza

I Problem solving session: Next Tuesday at 7pm.

I Quiz 1 Timing: Friday 31st Jan at 7.15pm

I Office hours for doubt clearance: Today at 7.30pm at CC 504.

(4)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 3

Recap

I Deterministic finite state automata

I Formal definition, run, accepting run, (extended) transition relation I Closure under Union, intersection and complementation

I Non-deterministic finite state automata I From NFA to DFA: The Subset construction

(5)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 4

Power of NFA

Theorem

For each NFA A, there exists a DFAA0 such thatL(A) =L(A0).

Proof:

1. Let A= (Q,Σ, δ,q0,F) be the given NFA.

2. Construction: we define a DFA A0= (P(Q),Σ,δ0,{q0},F0) where I for eachS Q,δ0(S,a) :=q∈Sδ(q,a)

I F0 :={S Q|SF6=∅}, i.e., all subsets ofQ that have some state fromF.

3. Proof of correctness: we need to show that L(A0) =L(A).

(6)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 4

Power of NFA

Theorem

For each NFA A, there exists a DFAA0 such thatL(A) =L(A0).

Proof:

1. Let A= (Q,Σ, δ,q0,F) be the given NFA.

2. Construction: we define a DFA A0= (P(Q),Σ,δ0,{q0},F0) where I for eachS Q,δ0(S,a) :=q∈Sδ(q,a)

I F0 :={S Q|SF6=∅}, i.e., all subsets ofQ that have some state fromF.

3. Proof of correctness: we need to show that L(A0) =L(A).

(7)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 4

Power of NFA

Theorem

For each NFA A, there exists a DFAA0 such thatL(A) =L(A0).

Proof:

1. Let A= (Q,Σ, δ,q0,F) be the given NFA.

2. Construction: we define a DFA A0= (P(Q),Σ,δ0,{q0},F0) where I for eachS Q,δ0(S,a) :=q∈Sδ(q,a)

I F0 :={S Q|SF6=∅}, i.e., all subsets ofQ that have some state fromF.

3. Proof of correctness: we need to show that L(A0) =L(A).

(8)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 4

Power of NFA

Theorem

For each NFA A, there exists a DFAA0 such thatL(A) =L(A0).

Proof:

1. Let A= (Q,Σ, δ,q0,F) be the given NFA.

2. Construction: we define a DFA A0= (P(Q),Σ,δ0,{q0},F0) where I for eachS Q,δ0(S,a) :=q∈Sδ(q,a)

I F0 :={S Q|SF6=∅}, i.e., all subsets ofQ that have some state fromF.

3. Proof of correctness: we need to show thatL(A0) =L(A).

(9)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 5

Proof of subset construction continued

Lemma: for all w ∈Σ, ˆδ(q0,w) = ˆδ0({q0},w)

Proof:

1. By induction of|w|.

2. Base case: |w|= 0, w =, ˆδ(q0, ) ={q0}= ˆδ0({q0}, ). 3. Induction step: let w =xa for x ∈Σ,a∈Σ.

3.1 By induction hypothesis, ˆδ(q0,x) = ˆδ0({q0},x) =S, say. 3.2 By definition of ˆδ, ˆδ(q0,xa) =q∈Sδ(q,a).

3.3 By definition of ˆδ0, ˆδ0({q0},xa) =δ0(S,a) =q∈Sδ(q,a). 3.4 Therefore, ˆδ(q0,xa) = ˆδ0({q0},xa).

3.5 By induction, the proof is complete.

(10)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 5

Proof of subset construction continued

Lemma: for all w ∈Σ, ˆδ(q0,w) = ˆδ0({q0},w) Proof:

1. By induction of|w|.

2. Base case: |w|= 0, w =, ˆδ(q0, ) ={q0}= ˆδ0({q0}, ). 3. Induction step: let w =xa for x ∈Σ,a∈Σ.

3.1 By induction hypothesis, ˆδ(q0,x) = ˆδ0({q0},x) =S, say. 3.2 By definition of ˆδ, ˆδ(q0,xa) =q∈Sδ(q,a).

3.3 By definition of ˆδ0, ˆδ0({q0},xa) =δ0(S,a) =q∈Sδ(q,a). 3.4 Therefore, ˆδ(q0,xa) = ˆδ0({q0},xa).

3.5 By induction, the proof is complete.

(11)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 5

Proof of subset construction continued

Lemma: for all w ∈Σ, ˆδ(q0,w) = ˆδ0({q0},w) Proof:

1. By induction of|w|.

2. Base case: |w|= 0,

w =, ˆδ(q0, ) ={q0}= ˆδ0({q0}, ). 3. Induction step: let w =xa for x ∈Σ,a∈Σ.

3.1 By induction hypothesis, ˆδ(q0,x) = ˆδ0({q0},x) =S, say. 3.2 By definition of ˆδ, ˆδ(q0,xa) =q∈Sδ(q,a).

3.3 By definition of ˆδ0, ˆδ0({q0},xa) =δ0(S,a) =q∈Sδ(q,a). 3.4 Therefore, ˆδ(q0,xa) = ˆδ0({q0},xa).

3.5 By induction, the proof is complete.

(12)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 5

Proof of subset construction continued

Lemma: for all w ∈Σ, ˆδ(q0,w) = ˆδ0({q0},w) Proof:

1. By induction of|w|.

2. Base case: |w|= 0, w =,

δ(qˆ 0, ) ={q0}= ˆδ0({q0}, ). 3. Induction step: let w =xa for x ∈Σ,a∈Σ.

3.1 By induction hypothesis, ˆδ(q0,x) = ˆδ0({q0},x) =S, say. 3.2 By definition of ˆδ, ˆδ(q0,xa) =q∈Sδ(q,a).

3.3 By definition of ˆδ0, ˆδ0({q0},xa) =δ0(S,a) =q∈Sδ(q,a). 3.4 Therefore, ˆδ(q0,xa) = ˆδ0({q0},xa).

3.5 By induction, the proof is complete.

(13)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 5

Proof of subset construction continued

Lemma: for all w ∈Σ, ˆδ(q0,w) = ˆδ0({q0},w) Proof:

1. By induction of|w|.

2. Base case: |w|= 0, w =, ˆδ(q0, ) ={q0}= ˆδ0({q0}, ).

3. Induction step: let w =xa for x ∈Σ,a∈Σ.

3.1 By induction hypothesis, ˆδ(q0,x) = ˆδ0({q0},x) =S, say. 3.2 By definition of ˆδ, ˆδ(q0,xa) =q∈Sδ(q,a).

3.3 By definition of ˆδ0, ˆδ0({q0},xa) =δ0(S,a) =q∈Sδ(q,a). 3.4 Therefore, ˆδ(q0,xa) = ˆδ0({q0},xa).

3.5 By induction, the proof is complete.

(14)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 5

Proof of subset construction continued

Lemma: for all w ∈Σ, ˆδ(q0,w) = ˆδ0({q0},w) Proof:

1. By induction of|w|.

2. Base case: |w|= 0, w =, ˆδ(q0, ) ={q0}= ˆδ0({q0}, ).

3. Induction step: let w =xa for x ∈Σ,a∈Σ.

3.1 By induction hypothesis, ˆδ(q0,x) = ˆδ0({q0},x) =S, say. 3.2 By definition of ˆδ, ˆδ(q0,xa) =q∈Sδ(q,a).

3.3 By definition of ˆδ0, ˆδ0({q0},xa) =δ0(S,a) =q∈Sδ(q,a). 3.4 Therefore, ˆδ(q0,xa) = ˆδ0({q0},xa).

3.5 By induction, the proof is complete.

(15)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 5

Proof of subset construction continued

Lemma: for all w ∈Σ, ˆδ(q0,w) = ˆδ0({q0},w) Proof:

1. By induction of|w|.

2. Base case: |w|= 0, w =, ˆδ(q0, ) ={q0}= ˆδ0({q0}, ).

3. Induction step: let w =xa for x ∈Σ,a∈Σ.

3.1 By induction hypothesis, ˆδ(q0,x) = ˆδ0({q0},x) =S, say.

3.2 By definition of ˆδ, ˆδ(q0,xa) =q∈Sδ(q,a).

3.3 By definition of ˆδ0, ˆδ0({q0},xa) =δ0(S,a) =q∈Sδ(q,a). 3.4 Therefore, ˆδ(q0,xa) = ˆδ0({q0},xa).

3.5 By induction, the proof is complete.

(16)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 5

Proof of subset construction continued

Lemma: for all w ∈Σ, ˆδ(q0,w) = ˆδ0({q0},w) Proof:

1. By induction of|w|.

2. Base case: |w|= 0, w =, ˆδ(q0, ) ={q0}= ˆδ0({q0}, ).

3. Induction step: let w =xa for x ∈Σ,a∈Σ.

3.1 By induction hypothesis, ˆδ(q0,x) = ˆδ0({q0},x) =S, say.

3.2 By definition of ˆδ, ˆδ(q0,xa) =q∈Sδ(q,a).

3.3 By definition of ˆδ0, ˆδ0({q0},xa) =δ0(S,a) =q∈Sδ(q,a). 3.4 Therefore, ˆδ(q0,xa) = ˆδ0({q0},xa).

3.5 By induction, the proof is complete.

(17)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 5

Proof of subset construction continued

Lemma: for all w ∈Σ, ˆδ(q0,w) = ˆδ0({q0},w) Proof:

1. By induction of|w|.

2. Base case: |w|= 0, w =, ˆδ(q0, ) ={q0}= ˆδ0({q0}, ).

3. Induction step: let w =xa for x ∈Σ,a∈Σ.

3.1 By induction hypothesis, ˆδ(q0,x) = ˆδ0({q0},x) =S, say.

3.2 By definition of ˆδ, ˆδ(q0,xa) =q∈Sδ(q,a).

3.3 By definition of ˆδ0, ˆδ0({q0},xa) =δ0(S,a) =q∈Sδ(q,a).

3.4 Therefore, ˆδ(q0,xa) = ˆδ0({q0},xa). 3.5 By induction, the proof is complete.

(18)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 5

Proof of subset construction continued

Lemma: for all w ∈Σ, ˆδ(q0,w) = ˆδ0({q0},w) Proof:

1. By induction of|w|.

2. Base case: |w|= 0, w =, ˆδ(q0, ) ={q0}= ˆδ0({q0}, ).

3. Induction step: let w =xa for x ∈Σ,a∈Σ.

3.1 By induction hypothesis, ˆδ(q0,x) = ˆδ0({q0},x) =S, say.

3.2 By definition of ˆδ, ˆδ(q0,xa) =q∈Sδ(q,a).

3.3 By definition of ˆδ0, ˆδ0({q0},xa) =δ0(S,a) =q∈Sδ(q,a).

3.4 Therefore, ˆδ(q0,xa) = ˆδ0({q0},xa).

3.5 By induction, the proof is complete.

(19)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 5

Proof of subset construction continued

Lemma: for all w ∈Σ, ˆδ(q0,w) = ˆδ0({q0},w) Proof:

1. By induction of|w|.

2. Base case: |w|= 0, w =, ˆδ(q0, ) ={q0}= ˆδ0({q0}, ).

3. Induction step: let w =xa for x ∈Σ,a∈Σ.

3.1 By induction hypothesis, ˆδ(q0,x) = ˆδ0({q0},x) =S, say.

3.2 By definition of ˆδ, ˆδ(q0,xa) =q∈Sδ(q,a).

3.3 By definition of ˆδ0, ˆδ0({q0},xa) =δ0(S,a) =q∈Sδ(q,a).

3.4 Therefore, ˆδ(q0,xa) = ˆδ0({q0},xa).

3.5 By induction, the proof is complete.

(20)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 6

Proof of correctness of the subset construction

Theorem

For each NFA A, there exists a DFAA0 such thatL(A) =L(A0).

Proof:

1. Let A= (Q,Σ, δ,q0,F) be the given NFA.

2. Construction: we define a DFA A0= (P(Q),Σ,δ0,{q0},F0) where I for eachS Q,δ0(S,a) :=q∈Sδ(q,a)

I F0 :={S Q|SF6=∅}, i.e., all subsets ofQ that have some state fromF.

3. Proof of correctness: To show that L(A0) =L(A).

3.1 From Lemma, we have for allw Σ, ˆδ(q0,w) = ˆδ0({q0},w). 3.2 Hence, for allw, ˆδ(q0,w)F 6=iff ˆδ0({q0},w)F0. 3.3 Thus,w is accepted byAiffw is accepted byA0. 3.4 Therefore,L(A0) =L(A), which completes the proof.

(21)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 6

Proof of correctness of the subset construction

Theorem

For each NFA A, there exists a DFAA0 such thatL(A) =L(A0).

Proof:

1. Let A= (Q,Σ, δ,q0,F) be the given NFA.

2. Construction: we define a DFA A0= (P(Q),Σ,δ0,{q0},F0) where I for eachS Q,δ0(S,a) :=q∈Sδ(q,a)

I F0 :={S Q|SF6=∅}, i.e., all subsets ofQ that have some state fromF.

3. Proof of correctness: To show that L(A0) =L(A).

3.1 From Lemma, we have for allw Σ, ˆδ(q0,w) = ˆδ0({q0},w). 3.2 Hence, for allw, ˆδ(q0,w)F 6=iff ˆδ0({q0},w)F0. 3.3 Thus,w is accepted byAiffw is accepted byA0. 3.4 Therefore,L(A0) =L(A), which completes the proof.

(22)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 6

Proof of correctness of the subset construction

Theorem

For each NFA A, there exists a DFAA0 such thatL(A) =L(A0).

Proof:

1. Let A= (Q,Σ, δ,q0,F) be the given NFA.

2. Construction: we define a DFA A0= (P(Q),Σ,δ0,{q0},F0) where I for eachS Q,δ0(S,a) :=q∈Sδ(q,a)

I F0 :={S Q|SF6=∅}, i.e., all subsets ofQ that have some state fromF.

3. Proof of correctness: To show that L(A0) =L(A).

3.1 From Lemma, we have for allw Σ, ˆδ(q0,w) = ˆδ0({q0},w).

3.2 Hence, for allw, ˆδ(q0,w)F 6=iff ˆδ0({q0},w)F0. 3.3 Thus,w is accepted byAiffw is accepted byA0. 3.4 Therefore,L(A0) =L(A), which completes the proof.

(23)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 6

Proof of correctness of the subset construction

Theorem

For each NFA A, there exists a DFAA0 such thatL(A) =L(A0).

Proof:

1. Let A= (Q,Σ, δ,q0,F) be the given NFA.

2. Construction: we define a DFA A0= (P(Q),Σ,δ0,{q0},F0) where I for eachS Q,δ0(S,a) :=q∈Sδ(q,a)

I F0 :={S Q|SF6=∅}, i.e., all subsets ofQ that have some state fromF.

3. Proof of correctness: To show that L(A0) =L(A).

3.1 From Lemma, we have for allw Σ, ˆδ(q0,w) = ˆδ0({q0},w).

3.2 Hence, for allw, ˆδ(q0,w)F 6=iff ˆδ0({q0},w)F0.

3.3 Thus,w is accepted byAiffw is accepted byA0. 3.4 Therefore,L(A0) =L(A), which completes the proof.

(24)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 6

Proof of correctness of the subset construction

Theorem

For each NFA A, there exists a DFAA0 such thatL(A) =L(A0).

Proof:

1. Let A= (Q,Σ, δ,q0,F) be the given NFA.

2. Construction: we define a DFA A0= (P(Q),Σ,δ0,{q0},F0) where I for eachS Q,δ0(S,a) :=q∈Sδ(q,a)

I F0 :={S Q|SF6=∅}, i.e., all subsets ofQ that have some state fromF.

3. Proof of correctness: To show that L(A0) =L(A).

3.1 From Lemma, we have for allw Σ, ˆδ(q0,w) = ˆδ0({q0},w).

3.2 Hence, for allw, ˆδ(q0,w)F 6=iff ˆδ0({q0},w)F0. 3.3 Thus,w is accepted byAiffw is accepted byA0. 3.4 Therefore,L(A0) =L(A), which completes the proof.

(25)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 7

Complexity of subset construction

I if NFA has n states, then DFA has

2n states. I But not all these states need to be reachable!

Two questions

1. Does this blowup really occur when only considering reachable states? 2. On examples where it does not occur can we have a subset construction

that is efficient?

(26)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 7

Complexity of subset construction

I if NFA has n states, then DFA has 2n states.

I But not all these states need to be reachable!

Two questions

1. Does this blowup really occur when only considering reachable states? 2. On examples where it does not occur can we have a subset construction

that is efficient?

(27)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 7

Complexity of subset construction

I if NFA has n states, then DFA has 2n states.

I But not all these states need to be reachable!

Two questions

1. Does this blowup really occur when only considering reachable states? 2. On examples where it does not occur can we have a subset construction

that is efficient?

(28)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 7

Complexity of subset construction

I if NFA has n states, then DFA has 2n states.

I But not all these states need to be reachable!

Two questions

1. Does this blowup really occur when only considering reachable states?

2. On examples where it does not occur can we have a subset construction that is efficient?

(29)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 8

Worst case blowup of subset construction

I Is one NFA enough?

A family of examples such that for eachn there is an example NFA parametrized by n.

I For each example in family show that if a smaller DFA than 2n exists, there is a contradiction.

An exponential blowup

I For eachn∈N, letLn={w ∈ {0,1}|nth symbol from the end is a 1} I Exercise: give an NFA for An which acceptsLn. How many states does

it have?

I CanLn be accepted by a DFA with less than 2n states?

(30)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 8

Worst case blowup of subset construction

I Is one NFA enough? A family of examples such that for each n there is an example NFA parametrized by n.

I For each example in family show that if a smaller DFA than 2n exists, there is a contradiction.

An exponential blowup

I For eachn∈N, letLn={w ∈ {0,1}|nth symbol from the end is a 1} I Exercise: give an NFA for An which acceptsLn. How many states does

it have?

I CanLn be accepted by a DFA with less than 2n states?

(31)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 8

Worst case blowup of subset construction

I Is one NFA enough? A family of examples such that for each n there is an example NFA parametrized by n.

I For each example in family show that if a smaller DFA than 2nexists, there is a contradiction.

An exponential blowup

I For eachn∈N, letLn={w ∈ {0,1}|nth symbol from the end is a 1} I Exercise: give an NFA for An which acceptsLn. How many states does

it have?

I CanLn be accepted by a DFA with less than 2n states?

(32)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 8

Worst case blowup of subset construction

I Is one NFA enough? A family of examples such that for each n there is an example NFA parametrized by n.

I For each example in family show that if a smaller DFA than 2nexists, there is a contradiction.

An exponential blowup

I For eachn∈N, letLn={w ∈ {0,1}|nth symbol from the end is a 1}

I Exercise: give an NFA for An which acceptsLn. How many states does it have?

I CanLn be accepted by a DFA with less than 2n states?

(33)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 8

Worst case blowup of subset construction

I Is one NFA enough? A family of examples such that for each n there is an example NFA parametrized by n.

I For each example in family show that if a smaller DFA than 2nexists, there is a contradiction.

An exponential blowup

I For eachn∈N, letLn={w ∈ {0,1}|nth symbol from the end is a 1}

I Exercise: give an NFA for An which acceptsLn. How many states does it have?

I CanLn be accepted by a DFA with less than 2n states?

(34)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 8

Worst case blowup of subset construction

I Is one NFA enough? A family of examples such that for each n there is an example NFA parametrized by n.

I For each example in family show that if a smaller DFA than 2nexists, there is a contradiction.

An exponential blowup

I For eachn∈N, letLn={w ∈ {0,1}|nth symbol from the end is a 1}

I Exercise: give an NFA for An which acceptsLn. How many states does it have?

I CanLn be accepted by a DFA with less than 2n states?

(35)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 9

Exponential blowup of the subset construction

Theorem

For all n ∈N, every DFA accepting Lnhas at least 2n states.

(36)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 9

Exponential blowup of the subset construction

Theorem

For all n ∈N, every DFA accepting Lnhas at least 2n states.

Proof.

1. Suppose not.

(37)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 9

Exponential blowup of the subset construction

Theorem

For all n ∈N, every DFA accepting Lnhas at least 2n states.

Proof.

1. Suppose not. For some n∈N letLn be accepted by DFAAwith less than 2nstates.

(38)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 9

Exponential blowup of the subset construction

Theorem

For all n ∈N, every DFA accepting Lnhas at least 2n states.

Proof.

1. Suppose not. For some n∈N letLn be accepted by DFAAwith less than 2nstates.

2. Then, there exist a1. . .an andb1. . .bn that must both end in the same state q. why?

(39)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 9

Exponential blowup of the subset construction

Theorem

For all n ∈N, every DFA accepting Lnhas at least 2n states.

Proof.

1. Suppose not. For some n∈N letLn be accepted by DFAAwith less than 2nstates.

2. Then, there exist a1. . .an andb1. . .bn that must both end in the same state q.

I Pigeon-hole principle. Number of words of lengthnis 2n, hence two words must fall in the same box.

(40)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 9

Exponential blowup of the subset construction

Theorem

For all n ∈N, every DFA accepting Lnhas at least 2n states.

Proof.

1. Suppose not. For some n∈N letLn be accepted by DFAAwith less than 2nstates.

2. Then, there exist a1. . .an andb1. . .bn that must both end in the same state q.

3. Supposeai andbi are different and wlog letai = 1,bi = 0.

(41)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 9

Exponential blowup of the subset construction

Theorem

For all n ∈N, every DFA accepting Lnhas at least 2n states.

Proof.

1. Suppose not. For some n∈N letLn be accepted by DFAAwith less than 2nstates.

2. Then, there exist a1. . .an andb1. . .bn that must both end in the same state q.

3. Supposeai andbi are different and wlog letai = 1,bi = 0.

4. Consider words

I w =a1. . .ai. . .an0i−1 I w0=b1. . .bi. . .bn0i−1

(42)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 9

Exponential blowup of the subset construction

Theorem

For all n ∈N, every DFA accepting Lnhas at least 2n states.

Proof.

1. Suppose not. For some n∈N letLn be accepted by DFAAwith less than 2nstates.

2. Then, there exist a1. . .an andb1. . .bn that must both end in the same state q.

3. Supposeai andbi are different and wlog letai = 1,bi = 0.

4. Consider words

I w =a1. . .ai. . .an0i−1Ln

I w0=b1. . .bi. . .bn0i−16∈Ln

(43)

CS310 : Automata Theory 2020 Instructor: S. Akshay IIT Bombay, India 9

Exponential blowup of the subset construction

Theorem

For all n ∈N, every DFA accepting Lnhas at least 2n states.

Proof.

1. Suppose not. For some n∈N letLn be accepted by DFAAwith less than 2nstates.

2. Then, there exist a1. . .an andb1. . .bn that must both end in the same state q.

3. Supposeai andbi are different and wlog letai = 1,bi = 0.

4. Consider words

I w =a1. . .ai. . .an0i−1Ln

I w0=b1. . .bi. . .bn0i−16∈Ln

5. But Ais a DFA, so starting from q on reading 0i−1 we reach the same state! HenceA will either accept bothw andw0 or reject both.

Contradiction!

References

Related documents

I Applications: text search using automata, regular expressions in GREP, emacs, python etc.. I Properties and limitations of

I Applications: text search using automata, regular expressions in GREP, emacs, python etc.. I Properties and limitations of

I Weekly problem solving session: 1 hour per week (To be fixed by TAs). I Office hours: by email appointment/weekly

If L is the language accepted of P by empty stack , there exists PDA P 0 such that its language accepted by final state is L..

I Text processing: Given input as English alphabet, output can be capitalized words. I Translation: Given input in English, output can be

cbna CS310 : Automata Theory 2019 Instructor: Ashutosh Gupta IITB, India 10.. CFGs

Push non-deterministically one of the strings in the right hand side of the rule generated from the current variable on the

I Non-deterministic finite state automata (NFA): the Subset construction, worst-case exponential blowup.. I Applications 1: text search