110 likes | 237 Views
[Problem 1.52, pages 91, 97-8]. Myhill-Nerode Thm. Def: Let x,y be strings and L be a language. We say that x and y are indistinguishable by L if there for every z the following holds: xz 2 L iff yz 2 L. We write x ´ L y. Note: this is an equivalence relation.
E N D
[Problem 1.52, pages 91, 97-8] Myhill-Nerode Thm Def: Let x,y be strings and L be a language. We say that x and y are indistinguishable by L if there for every z the following holds: xz 2 L iff yz 2 L. We write x ´L y. Note: this is an equivalence relation. Examples: find the equivalence classes of ´L: L1 = { 0w | w2{0,1}* } L2 = { w2{0,1}* | sum of digits of w is divisible by 3 } L3 = { 0k1k | k > 0 }
[Problem 1.52, pages 91, 97-8] Myhill-Nerode Thm Consider a DFA accepting L. Suppose that x and y end in the same state q. What can we say about x,y? Claim: If L is accepted by a DFA with · k states, then ´L has ___________ equivalence classes.
[Problem 1.52, pages 91, 97-8] Myhill-Nerode Thm Claim: If ´L has k equivalence classes, then L can be accepted by a DFA with k states.
[Problem 1.52, pages 91, 97-8] Myhill-Nerode Thm Thm [Myhill-Nerode]: L is regular iff the number of equivalence classes of ´L is finite. Using Myhill-Nerode to prove nonregularity: L3 = { 0k1k | k > 0 } L4 = { wwR | w2{0,1}* }
[Problem 7.40, page 299] Minimimal DFA Claim: a DFA is minimal iff its number of states is the same as the number of equivalence classes of its language.
[Problem 7.40, page 299] a b b b a b b a a a a a b a a b b b Minimimal DFA Suppose we have a DFA – how to construct a corresponding minimal DFA ?
[Problem 7.40, page 299] Minimimal DFA Suppose we have a DFA – how to construct a corresponding minimal DFA ? • Remove unreachable states. b b a a a a b a a b b b
[Problem 7.40, page 299] Minimimal DFA • Remove unreachable states. • Identify equivalent states (and merge them): • construct graph with vertices = states • place edges between every accept and nonaccept state b b a a a a b a a b b b
[Problem 7.40, page 299] Minimimal DFA • Remove unreachable states. • Identify equivalent states (and merge them): • construct graph with vertices = states • place edges between every accept and nonaccept state • continue placing edges as follows while can: for q,r2 Q, qr, place edge (q,r) if there exists a2§ s.t. (±(q,a),±(r,a)) is an edge. b b a a a a b a a b b b
[Problem 7.40, page 299] Minimimal DFA • Remove unreachable states. • Identify equivalent states (and merge them): • construct graph with vertices = states • place edges between every accept and nonaccept state • continue placing edges as follows while can: • merge all states that do not have edges between them into a single state for q,r2 Q, qr, place edge (q,r) if there exists a2§ s.t. (±(q,a),±(r,a)) is an edge. b b a a a a b a a b b b