1 / 19

Distinguishing strings

[Section 3.4]. Distinguishing strings. Let L be a language over  , and let x 2  * . Let L/x = { z 2  * | xz 2 L } Two strings x,y 2  * are distinguishable with respect to L if L/x  L/y. [Section 3.4]. Distinguishing strings. Thm :

dcueva
Télécharger la présentation

Distinguishing strings

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. [Section 3.4] Distinguishing strings Let L be a language over , and let x 2 *. Let L/x = { z 2 * | xz 2 L } Two strings x,y 2 * are distinguishable with respect to L if L/x  L/y.

  2. [Section 3.4] Distinguishing strings Thm: Let L be a language over . Suppose that there are n strings that are pairwise distinguishable wrt L. Then every FA for L needs at least n states.

  3. [Section 5.1] Myhill-Nerode Let L be a language over . We define the indistinguishability relation IL on * as follows: For every x,y 2*: x IL y iff L/x = L/y Claim : IL is an equivalence relation. Thm (Myhill-Nerode) : L is regular iff the set of equivalence classes of IL is finite.

  4. [Section 5.1] Using Myhill-Nerode Thm (Myhill-Nerode) : L is regular iff the set of equivalence classes of IL is finite. Is abpal = { w 2 {a,b}* | w is a palindrome } regular ?

  5. [Section 5.1] Using Myhill-Nerode Thm (Myhill-Nerode) : L is regular iff the set of equivalence classes of IL is finite. Is { w 2 {a,b}* | number of a’s in w is divisible by 3 } regular ?

  6. [Section 5.1] Proving Myhill-Nerode Claim : If the set of equivalence classes of IL is finite, we can construct a finite automaton recognizing L. Notice : This FA is “minimal” for L, i.e. its number of states is the smallest possible.

  7. [Section 5.2] Minimizing FA We know that we can find a minimal FA for a language L from the equivalence classes of IL. What if L is given by an FA ? a b b b a b b a a a a a b a a b b b

  8. [Section 5.2] Minimizing FA • Algorithm for identifying equivalent states : • List all pairs of different states. • Cross out all pairs with exactly one accepting state. • Cross out every pair (p,q) such that there exists 2 such that the pair ((p,),(q,)) is crossed out. • Repeat step 3 until no more new pairs are crossed out. • Remaining pairs form equivalent states. b b b a a a b b b a a a b

  9. [Section 5.3] Pumping Lemma for Regular Lang. Let M be an FA with n states. Consider the computation of M on a string x with |x|>n.

  10. [Section 5.3] Pumping Lemma for Regular Lang. Thm (The Pumping Lemma for Regular Languages) : Let L be a regular language. Then there exists an integer n such that for every x 2 L with |x|¸ n there are strings u,v,w such that 1. x = uvw, 2. |uv| · n, 3. |v| > 0, and 4. for every m ¸ 0, uvmw 2 L. Answer these questions : Can we use the pumping lemma to prove that a language is nonregular ? Can we use the pumping lemma to prove that a language is regular ?

  11. [Section 5.3] Using the Pumping Lemma Is L = { akb2k | k ¸ 0 } regular ?

  12. [Section 5.3] Using the Pumping Lemma Is L = { ak | k is a square } regular ?

  13. [Section 5.4] Decision Problems for Regular Lang. • A decision problem : answer is YES or NO. • Give algorithms for the following decision problems : • Given an FA (NFA, NFA-) M, is L(M) = ; ?

  14. [Section 5.4] Decision Problems for Regular Lang. • A decision problem : answer is YES or NO. • Give algorithms for the following decision problems : • Given an FA (NFA, NFA-) M, is L(M) = ; ? • Given an FA M, is L(M) finite ?

  15. [Section 5.4] Decision Problems for Regular Lang. • A decision problem : answer is YES or NO. • Give algorithms for the following decision problems : • Given an FA (NFA, NFA-) M, is L(M) = ; ? • Given an FA M, is L(M) finite ? • Given two FA’s M1 and M2, is L(M1) Å L(M2) = ; ?

  16. [Section 5.4] Decision Problems for Regular Lang. • A decision problem : answer is YES or NO. • Give algorithms for the following decision problems : • Given an FA (NFA, NFA-) M, is L(M) = ; ? • Given an FA M, is L(M) finite ? • Given two FA’s M1 and M2, is L(M1) Å L(M2) = ; ? • Given two FA’s M1 and M2, is L(M1) = L(M2)

  17. [Section 5.4] Decision Problems for Regular Lang. • A decision problem : answer is YES or NO. • Give algorithms for the following decision problems : • Given an FA (NFA, NFA-) M, is L(M) = ; ? • Given an FA M, is L(M) finite ? • Given two FA’s M1 and M2, is L(M1) Å L(M2) = ; ? • Given two FA’s M1 and M2, is L(M1) = L(M2) • Given two FA’s M1 and M2, is L(M1) µ L(M2) ?

  18. [Section 5.4] Decision Problems for Regular Lang. • A decision problem : answer is YES or NO. • Give algorithms for the following decision problems : • Given an FA (NFA, NFA-) M, is L(M) = ; ? • Given an FA M, is L(M) finite ? • Given two FA’s M1 and M2, is L(M1) Å L(M2) = ; ? • Given two FA’s M1 and M2, is L(M1) = L(M2) • Given two FA’s M1 and M2, is L(M1) µ L(M2) ? • Given two regular expressions, do they correspond to the same language ?

  19. [Section 5.4] Decision Problems for Regular Lang. • A decision problem : answer is YES or NO. • Give algorithms for the following decision problems : • Given an FA (NFA, NFA-) M, is L(M) = ; ? • Given an FA M, is L(M) finite ? • Given two FA’s M1 and M2, is L(M1) Å L(M2) = ; ? • Given two FA’s M1 and M2, is L(M1) = L(M2) • Given two FA’s M1 and M2, is L(M1) µ L(M2) ? • Given two regular expressions, do they correspond to the same language ? • Given an FA M, is it minimal ?

More Related