{"id":865,"date":"2016-01-11T11:45:07","date_gmt":"2016-01-11T10:45:07","guid":{"rendered":"http:\/\/www.mimuw.edu.pl\/~bojan\/?page_id=865"},"modified":"2016-02-19T14:00:44","modified_gmt":"2016-02-19T13:00:44","slug":"7-learning-automata","status":"publish","type":"page","link":"https:\/\/www.mimuw.edu.pl\/~bojan\/20152016-2\/jezyki-automaty-i-obliczenia-2\/7-learning-automata","title":{"rendered":"7. Learning automata"},"content":{"rendered":"<p>This lecture is about learning regular languages (of finite words). All automata here are deterministic finite automata. The setup is that there are two parties: Learner and Teacher. Teacher knows a regular language. Learner wants to learn this language, and pursues this goal by asking\u00a0two types of queries to the Teacher:<\/p>\n<p>\u2022 <strong>Membership<\/strong><em>.\u00a0<\/em>In a membership query, Learner gives\u00a0a word, and the Teacher says whether or not Teacher&#8217;s language contains that word.<\/p>\n<p>\u2022\u00a0<strong>Equivalence.\u00a0<\/strong>In an equivalence query, Learner gives regular language, represented by an automaton, and Teacher replies whether or not\u00a0the Teacher&#8217;s and Learner&#8217;s languages are equal. If yes, the protocol is finished. If no, Teacher gives a counterexample, i.e. a word where the Teacher&#8217;s and Learner&#8217;s languages disagree.<\/p>\n<p>Membership queries on their own can never be enough to ascertain the language \u2013 there are infinitely many regular languages that match any finite set of membership queries. On the other hand, given enough time, equivalence queries alone are sufficient: \u00a0Learner can\u00a0enumerate all regular languages, and ask equivalence queries until the correct language is reached, without ever using membership queries. The lecture is about a more practical solution, which was found by Dana Angluin. Angluin&#8217;s algorithm is a protocol where\u00a0Learner learns Teacher&#8217;s language in a number of queries that is polynomial in:<\/p>\n<p>\u2022 the minimal automaton\u00a0of Teacher&#8217;s language;<br \/>\n\u2022 the size of Teacher&#8217;s counterexamples.<\/p>\n<p>If Teacher provides counterexamples of minimal size, then the second parameter above is superfluous, i.e. the number of queries will be polynomial in the minimal\u00a0automaton\u00a0of Teacher&#8217;s language. As mentioned above, we only talk about deterministic automata, and therefore the minimal automaton refers to the minimal deterministic automaton.<\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<p>&nbsp;<\/p>\n<p><b>State words and test words.<\/b><\/p>\n<p>Suppose that Teacher&#8217;s language is <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-a761508c40fd598ec631e883a758a160_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#76;&#32;&#92;&#115;&#117;&#98;&#115;&#101;&#116;&#101;&#113;&#32;&#92;&#83;&#105;&#103;&#109;&#97;&#94;&#42;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"48\" style=\"vertical-align: -2px;\"\/>. We assume that the alphabet is known to both parties, but the language is only known to Teacher. At each step of the algorithm, Learner will store an approximation of the minimal automaton of <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-c2289d1b720dbeb200c7be3944b43068_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#76;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"10\" style=\"vertical-align: 0px;\"\/>, as described by two sets of words:<\/p>\n<p>\u2022 a set <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-264b93648f542ea7220ff96542665802_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#81;&#32;&#92;&#115;&#117;&#98;&#115;&#101;&#116;&#101;&#113;&#32;&#92;&#83;&#105;&#103;&#109;&#97;&#94;&#42;\" title=\"Rendered by QuickLaTeX.com\" height=\"15\" width=\"50\" style=\"vertical-align: -3px;\"\/> of\u00a0<em>state\u00a0<\/em>words, closed under prefixes;<br \/>\n\u2022 a set <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-35ddc182b491a0fd5ee8864065f56c1b_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#84;&#32;&#92;&#115;&#117;&#98;&#115;&#101;&#116;&#101;&#113;&#32;&#92;&#83;&#105;&#103;&#109;&#97;&#94;&#42;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"49\" style=\"vertical-align: -2px;\"\/> of\u00a0<em>test\u00a0<\/em>words, closed under suffixes.<\/p>\n<p>The idea is that the state words are all distinct with respect to Myhill-Nerode equivalence for Teacher&#8217;s language, and the test words are sufficient to prove this. This idea is formalised in the following definitions.<\/p>\n<p><strong>Correctness and completeness.\u00a0<\/strong>If <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-830e5dfc3b17edc16215ffb4d3fab85e_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#84;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"11\" style=\"vertical-align: 0px;\"\/> is a set of test words, we say that words\u00a0<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-d4f62ba20abd80e2f650f85fa0b817f3_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#118;&#44;&#119;&#32;&#92;&#105;&#110;&#32;&#92;&#83;&#105;&#103;&#109;&#97;&#94;&#42;\" title=\"Rendered by QuickLaTeX.com\" height=\"15\" width=\"63\" style=\"vertical-align: -3px;\"\/> are <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-830e5dfc3b17edc16215ffb4d3fab85e_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#84;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"11\" style=\"vertical-align: 0px;\"\/>-equivalent if <\/p>\n<p class=\"ql-center-displayed-equation\" style=\"line-height: 14px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-2107b2748c5e43deea235434c1021a91_l3.png\" height=\"14\" width=\"277\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#91;&#119;&#117;&#32;&#92;&#105;&#110;&#32;&#76;&#32;&#92;&#113;&#117;&#97;&#100;&#92;&#109;&#98;&#111;&#120;&#123;&#105;&#102;&#102;&#125;&#32;&#32;&#92;&#113;&#117;&#97;&#100;&#32;&#118;&#117;&#32;&#92;&#105;&#110;&#32;&#76;&#32;&#32;&#92;&#113;&#113;&#117;&#97;&#100;&#32;&#92;&#109;&#98;&#111;&#120;&#123;&#102;&#111;&#114;&#32;&#101;&#118;&#101;&#114;&#121;&#32;&#36;&#117;&#32;&#92;&#105;&#110;&#32;&#84;&#36;&#125;&#92;&#93;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>\n<p>\u00a0This is an equivalence relation, which is coarser or equal to the Myhill-Nerode equivalence relation of Teacher&#8217;s language. In terms of <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-830e5dfc3b17edc16215ffb4d3fab85e_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#84;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"11\" style=\"vertical-align: 0px;\"\/>-equivalence we define the following properties of sets <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-22f1c3051ea46f4c141be3ad803440c5_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#81;&#44;&#84;&#32;&#92;&#115;&#117;&#98;&#115;&#101;&#116;&#101;&#113;&#32;&#92;&#83;&#105;&#103;&#109;&#97;&#94;&#42;\" title=\"Rendered by QuickLaTeX.com\" height=\"15\" width=\"68\" style=\"vertical-align: -3px;\"\/> that will be used in the algorithm:<\/p>\n<p>\u2022 <strong>correctness<\/strong>: no two distinct words in <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-bed8547872890507f19a89d0b85aac65_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#81;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"12\" style=\"vertical-align: -3px;\"\/> are <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-830e5dfc3b17edc16215ffb4d3fab85e_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#84;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"11\" style=\"vertical-align: 0px;\"\/>-equivalent;<br \/>\n\u2022 <strong>completeness<\/strong>: for every <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-0991b5d6a91d915d474e3f0a453be8ab_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#113;&#32;&#92;&#105;&#110;&#32;&#81;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"39\" style=\"vertical-align: -3px;\"\/> and <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-c93137d159f5917ab3023aedf59219c8_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#97;&#32;&#92;&#105;&#110;&#32;&#92;&#83;&#105;&#103;&#109;&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"38\" style=\"vertical-align: -1px;\"\/>, there is some <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-d9bb302d8a148e575d546e3bbf6f4362_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#112;&#32;&#92;&#105;&#110;&#32;&#81;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"40\" style=\"vertical-align: -3px;\"\/> that is <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-830e5dfc3b17edc16215ffb4d3fab85e_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#84;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"11\" style=\"vertical-align: 0px;\"\/>-equivalent to <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-7de0c73aea3ff3d6ad95e4c8a501bd8a_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#113;&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"16\" style=\"vertical-align: -3px;\"\/>.<\/p>\n<p>If <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-85eaa403ec38439fd5af2a6c735ba71b_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#40;&#81;&#44;&#84;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"41\" style=\"vertical-align: -4px;\"\/> is\u00a0correct and complete, then we can define an automaton as follows. The states are <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-bed8547872890507f19a89d0b85aac65_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#81;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"12\" style=\"vertical-align: -3px;\"\/>, the initial state being the empty word. When the automaton is in state <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-0991b5d6a91d915d474e3f0a453be8ab_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#113;&#32;&#92;&#105;&#110;&#32;&#81;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"39\" style=\"vertical-align: -3px;\"\/> and reads a letter <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-b9876851baf92019e82e43590932dc73_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"8\" style=\"vertical-align: 0px;\"\/>, it goes to the state <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-80c4e54e1e3be2cd42e31542a3f54526_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#112;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"9\" style=\"vertical-align: -3px;\"\/> described in the completeness property; this state is unique by the correctness property. The accepting states are those states that are in Teacher&#8217;s language.<\/p>\n<p><b><\/b><strong>Fact 1.\u00a0<\/strong>If <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-85eaa403ec38439fd5af2a6c735ba71b_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#40;&#81;&#44;&#84;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"41\" style=\"vertical-align: -4px;\"\/> is\u00a0correct but not complete, then using a polynomial number of membership queries, Learner can find some <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-9b30fa166140369bf129d923ae629f38_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#80;&#32;&#92;&#115;&#117;&#112;&#115;&#101;&#116;&#101;&#113;&#32;&#81;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"45\" style=\"vertical-align: -3px;\"\/> such that <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-bbee170955e62e4ffd3cbfa661f681b9_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#40;&#80;&#44;&#84;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"39\" style=\"vertical-align: -4px;\"\/> is correct and complete.<\/p>\n<p><strong>Proof.\u00a0<\/strong>If <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-0991b5d6a91d915d474e3f0a453be8ab_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#113;&#32;&#92;&#105;&#110;&#32;&#81;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"39\" style=\"vertical-align: -3px;\"\/> and <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-c93137d159f5917ab3023aedf59219c8_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#97;&#32;&#92;&#105;&#110;&#32;&#92;&#83;&#105;&#103;&#109;&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"38\" style=\"vertical-align: -1px;\"\/> are such that no word in <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-bed8547872890507f19a89d0b85aac65_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#81;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"12\" style=\"vertical-align: -3px;\"\/> is <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-830e5dfc3b17edc16215ffb4d3fab85e_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#84;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"11\" style=\"vertical-align: 0px;\"\/>-equivalent to <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-7de0c73aea3ff3d6ad95e4c8a501bd8a_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#113;&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"16\" style=\"vertical-align: -3px;\"\/>, then <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-7de0c73aea3ff3d6ad95e4c8a501bd8a_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#113;&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"16\" style=\"vertical-align: -3px;\"\/> can be added to <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-bed8547872890507f19a89d0b85aac65_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#81;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"12\" style=\"vertical-align: -3px;\"\/>. The membership\u00a0queries are used to test what is <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-830e5dfc3b17edc16215ffb4d3fab85e_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#84;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"11\" style=\"vertical-align: 0px;\"\/>-equivalent to <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-7de0c73aea3ff3d6ad95e4c8a501bd8a_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#113;&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"16\" style=\"vertical-align: -3px;\"\/>. <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-b06cee67d5b1a769f0a344ace98d5692_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#66;&#111;&#120;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"11\" style=\"vertical-align: 0px;\"\/><\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<p><strong>The algorithm<\/strong><\/p>\n<p>We are now ready to describe the\u00a0algorithm.<\/p>\n<p>1. <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-62f030d7eb10e4e0327d81496d9803d2_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#81;&#61;&#84;&#61;&#32;&#92;&#115;&#101;&#116;&#123;&#92;&#101;&#112;&#115;&#105;&#108;&#111;&#110;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"86\" style=\"vertical-align: -4px;\"\/><\/p>\n<p>2. Invariant: <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-85eaa403ec38439fd5af2a6c735ba71b_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#40;&#81;&#44;&#84;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"41\" style=\"vertical-align: -4px;\"\/> is correct, not necessarily complete.<\/p>\n<p>3. Apply Fact 1, and enlarge <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-bed8547872890507f19a89d0b85aac65_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#81;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"12\" style=\"vertical-align: -3px;\"\/>, making\u00a0<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-85eaa403ec38439fd5af2a6c735ba71b_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#40;&#81;&#44;&#84;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"41\" style=\"vertical-align: -4px;\"\/>\u00a0correct and complete.<\/p>\n<p>4. Compute the automaton for <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-85eaa403ec38439fd5af2a6c735ba71b_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#40;&#81;&#44;&#84;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"41\" style=\"vertical-align: -4px;\"\/> and ask an equivalence query for\u00a0it.<\/p>\n<p>5. If the answer is yes, then the algorithm terminates with success.<\/p>\n<p>6. If the answer is no, then add the counterexample and its suffixes to <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-830e5dfc3b17edc16215ffb4d3fab85e_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#84;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"11\" style=\"vertical-align: 0px;\"\/>.<\/p>\n<p>7. Goto 2.<\/p>\n<p>&nbsp;<\/p>\n<p>Note that if <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-85eaa403ec38439fd5af2a6c735ba71b_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#40;&#81;&#44;&#84;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"41\" style=\"vertical-align: -4px;\"\/> is correct, then all words in <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-bed8547872890507f19a89d0b85aac65_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#81;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"12\" style=\"vertical-align: -3px;\"\/> correspond to different states in the minimal automaton (for Teacher&#8217;s language). Furthermore, if the size of <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-bed8547872890507f19a89d0b85aac65_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#81;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"12\" style=\"vertical-align: -3px;\"\/> reaches the size of the minimal automaton, then <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-bed8547872890507f19a89d0b85aac65_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#81;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"12\" style=\"vertical-align: -3px;\"\/> represents all states of the minimal automaton, and the transition function in the automaton for <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-85eaa403ec38439fd5af2a6c735ba71b_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#40;&#81;&#44;&#84;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"41\" style=\"vertical-align: -4px;\"\/> is the same as the transition function in the minimal automaton. Therefore, if\u00a0<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-bed8547872890507f19a89d0b85aac65_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#81;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"12\" style=\"vertical-align: -3px;\"\/> reaches the size of the minimal automaton, the equivalence query in step 4 has a positive result.<\/p>\n<p>To prove that the algorithm terminates, we show in Fact 2\u00a0below that after step 6, <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-85eaa403ec38439fd5af2a6c735ba71b_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#40;&#81;&#44;&#84;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"41\" style=\"vertical-align: -4px;\"\/> is no longer complete. This will mean that step 3 will necessarily enlarge <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-bed8547872890507f19a89d0b85aac65_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#81;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"12\" style=\"vertical-align: -3px;\"\/>, and therefore the number of times we do &#8220;Goto 2&#8221; will be bounded by the size of the minimal automaton.<\/p>\n<p><strong>Fact 2. \u00a0<\/strong>After step 6, <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-85eaa403ec38439fd5af2a6c735ba71b_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#40;&#81;&#44;&#84;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"41\" style=\"vertical-align: -4px;\"\/> is no longer complete.<\/p>\n<p><strong>Proof.\u00a0<\/strong>Let <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-85eaa403ec38439fd5af2a6c735ba71b_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#40;&#81;&#44;&#84;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"41\" style=\"vertical-align: -4px;\"\/> be the pair in step 4, and let <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-e28aacf97ca23d2be338aa4a40157c90_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#97;&#95;&#49;&#32;&#92;&#99;&#100;&#111;&#116;&#115;&#32;&#97;&#95;&#110;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"53\" style=\"vertical-align: -3px;\"\/> be the counterexample, which witnesses that the automaton for <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-85eaa403ec38439fd5af2a6c735ba71b_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#40;&#81;&#44;&#84;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"41\" style=\"vertical-align: -4px;\"\/> does not recognise Teacher&#8217;s language. Define <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-99af7316c9e4bf36e050fa7fd5c42aa8_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#84;&#39;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"15\" style=\"vertical-align: 0px;\"\/> to be <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-830e5dfc3b17edc16215ffb4d3fab85e_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#84;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"11\" style=\"vertical-align: 0px;\"\/> plus all suffixes of the counterexample, and suppose toward a contradiction that <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-54887e61a39043f1156b492c5fd5ae41_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#40;&#81;&#44;&#84;&#39;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"17\" width=\"45\" style=\"vertical-align: -4px;\"\/> is complete. It is not difficult to see that the automata for <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-85eaa403ec38439fd5af2a6c735ba71b_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#40;&#81;&#44;&#84;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"41\" style=\"vertical-align: -4px;\"\/> and <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-54887e61a39043f1156b492c5fd5ae41_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#40;&#81;&#44;&#84;&#39;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"17\" width=\"45\" style=\"vertical-align: -4px;\"\/> are the same.\u00a0Define <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-65a8488a2333385c19aa07216cef97dd_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#113;&#95;&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"11\" style=\"vertical-align: -3px;\"\/> to be the state of either of these automata after reading <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-1f13c3a266d8c14abaa6e074445deba7_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#97;&#95;&#49;&#32;&#92;&#99;&#100;&#111;&#116;&#115;&#32;&#97;&#95;&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"50\" style=\"vertical-align: -3px;\"\/>. \u00a0By construction, the state <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-c7a8886fb9c5615f88823c1c3c5f763f_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#113;&#95;&#123;&#105;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"11\" style=\"vertical-align: -3px;\"\/> is a word which is <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-99af7316c9e4bf36e050fa7fd5c42aa8_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#84;&#39;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"15\" style=\"vertical-align: 0px;\"\/>-equivalent to <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-901900a706ac1bfa59c6a396d8c72c9d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#113;&#95;&#123;&#105;&#45;&#49;&#125;&#32;&#97;&#95;&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"39\" style=\"vertical-align: -3px;\"\/>, and since <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-4d9bbaefe350a1cc320a9d72359f9a1a_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#97;&#95;&#123;&#105;&#43;&#49;&#125;&#32;&#92;&#99;&#100;&#111;&#116;&#115;&#32;&#97;&#95;&#110;&#32;&#92;&#105;&#110;&#32;&#84;&#39;\" title=\"Rendered by QuickLaTeX.com\" height=\"17\" width=\"103\" style=\"vertical-align: -4px;\"\/>, it follows that\u00a0<\/p>\n<p class=\"ql-center-displayed-equation\" style=\"line-height: 15px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-d112f36f66aa708fc98065eece6c598d_l3.png\" height=\"15\" width=\"298\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#91;&#113;&#95;&#123;&#105;&#45;&#49;&#125;&#32;&#97;&#95;&#123;&#105;&#125;&#32;&#92;&#99;&#100;&#111;&#116;&#115;&#32;&#97;&#95;&#110;&#32;&#92;&#105;&#110;&#32;&#76;&#32;&#92;&#113;&#113;&#117;&#97;&#100;&#32;&#92;&#109;&#98;&#111;&#120;&#123;&#105;&#102;&#102;&#125;&#32;&#92;&#113;&#113;&#117;&#97;&#100;&#32;&#113;&#95;&#123;&#105;&#125;&#32;&#97;&#95;&#123;&#105;&#43;&#49;&#125;&#32;&#92;&#99;&#100;&#111;&#116;&#115;&#32;&#97;&#95;&#110;&#32;&#92;&#105;&#110;&#32;&#76;&#46;&#92;&#93;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>\n<p>Since <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-8a6486cc0b4f558c9c2cc2b5eecbc434_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#113;&#95;&#48;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"13\" style=\"vertical-align: -3px;\"\/> is the empty word, the above and induction imply that<\/p>\n<p class=\"ql-center-displayed-equation\" style=\"line-height: 14px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-be57808122247a112ea832e7b1a65dd5_l3.png\" height=\"14\" width=\"204\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#91;&#97;&#95;&#49;&#32;&#92;&#99;&#100;&#111;&#116;&#115;&#32;&#97;&#95;&#110;&#32;&#92;&#105;&#110;&#32;&#76;&#32;&#92;&#113;&#113;&#117;&#97;&#100;&#32;&#92;&#109;&#98;&#111;&#120;&#123;&#105;&#102;&#102;&#125;&#32;&#92;&#113;&#113;&#117;&#97;&#100;&#32;&#113;&#95;&#110;&#32;&#92;&#105;&#110;&#32;&#76;&#92;&#93;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>\n<p>which means that the automaton gives the correct answer to the counterexample, a \u00a0contradiction. (Thank you Marcin Smulewicz for helping me with this proof!) <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-b06cee67d5b1a769f0a344ace98d5692_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#66;&#111;&#120;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"11\" style=\"vertical-align: 0px;\"\/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This lecture is about learning regular languages (of finite words). All automata here are deterministic finite automata. The setup is that there are two parties: Learner and Teacher. Teacher knows a regular language. Learner wants to learn this language, and pursues this goal by asking\u00a0two types of queries to the Teacher: \u2022 Membership.\u00a0In a membership [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":535,"menu_order":7,"comment_status":"open","ping_status":"open","template":"","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"class_list":["post-865","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/pages\/865"}],"collection":[{"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/comments?post=865"}],"version-history":[{"count":63,"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/pages\/865\/revisions"}],"predecessor-version":[{"id":1036,"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/pages\/865\/revisions\/1036"}],"up":[{"embeddable":true,"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/pages\/535"}],"wp:attachment":[{"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/media?parent=865"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}