How does one use the Nerode-Myhill theorem to prove that a language is regular?












1












$begingroup$


Showing that a language is not regular is straight-forward, because all one needs to do is find an infinite set of inputs which has an injective mapping to the set of equivalence classes which compose that language.



How does one show that the set of equivalence classes of $L$ is finite? For instance, how would one show that the simple language $L = {s: |s| equiv 0 mod 2}$ has a finite number of equivalence classes?



I think that showing that there is a surjective mapping is not sufficient, because the image may still be of infinite size.










share|cite|improve this question









$endgroup$

















    1












    $begingroup$


    Showing that a language is not regular is straight-forward, because all one needs to do is find an infinite set of inputs which has an injective mapping to the set of equivalence classes which compose that language.



    How does one show that the set of equivalence classes of $L$ is finite? For instance, how would one show that the simple language $L = {s: |s| equiv 0 mod 2}$ has a finite number of equivalence classes?



    I think that showing that there is a surjective mapping is not sufficient, because the image may still be of infinite size.










    share|cite|improve this question









    $endgroup$















      1












      1








      1





      $begingroup$


      Showing that a language is not regular is straight-forward, because all one needs to do is find an infinite set of inputs which has an injective mapping to the set of equivalence classes which compose that language.



      How does one show that the set of equivalence classes of $L$ is finite? For instance, how would one show that the simple language $L = {s: |s| equiv 0 mod 2}$ has a finite number of equivalence classes?



      I think that showing that there is a surjective mapping is not sufficient, because the image may still be of infinite size.










      share|cite|improve this question









      $endgroup$




      Showing that a language is not regular is straight-forward, because all one needs to do is find an infinite set of inputs which has an injective mapping to the set of equivalence classes which compose that language.



      How does one show that the set of equivalence classes of $L$ is finite? For instance, how would one show that the simple language $L = {s: |s| equiv 0 mod 2}$ has a finite number of equivalence classes?



      I think that showing that there is a surjective mapping is not sufficient, because the image may still be of infinite size.







      complexity-theory computability regular-languages






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked 7 hours ago









      AleksandrAleksandr

      153




      153






















          1 Answer
          1






          active

          oldest

          votes


















          3












          $begingroup$

          It is just as straightforward to show a language is regular using Nerod-Myhill theorem as to show a language is not regular using that theorem since Nerode-Myhill theorem characterizes when a language is a regular.



          For example, let us take the simple language $L={s: |s|equiv 0 text{ (mod 2)}}$. There are two equivalent classes of $L$, assuming $a$ is a letter in the alphabet.




          • $left[epsilonright]_{equiv_{L}}=left{s: |s|equiv 0text{ (mod 2)}right}$

          • $left[aright]_{equiv_{L}}=left{s: |s|equiv 1text{ (mod 2)}right}$


          It should be easy for you to show that the above two classes are well-defined equivalence classes of $L$. There are no other equivalence class of $L$, since every word belongs to one of two classes. If a word is of even length, it belongs to class $left[epsilonright]_{equiv_{L}}$; otherwise, it belongs to class $left[aright]_{equiv_{L}}$.



          Hence, there are two equivalence classes of $L$ in total. That is, the number of equivalence classes of $L$ is finite. According to the Nerode-Myhill theorem, $L$ must be regular.




          I think that showing that there is a surjective mapping is not sufficient, because the image may still be of infinite size.




          I am not sure which surjective mapping you are talking about.



          As you can see from the example above, it is enough to show that the union of the finitely many equivalence classes you have found contains all words. Why? If we have another equivalence class $E,$ let $win E$. Then $w$ must belong to $F$, one of the equivalence classes you have found. Since $E$ and $F$ share one word, they are the same equivalence class. That is, $E$ has been found.



          You may want to check a few related questions and answers such as finding separating words (Nerode) and how I can find all equivalence classes by Myhill-Nerode?.






          share|cite|improve this answer











          $endgroup$













            Your Answer





            StackExchange.ifUsing("editor", function () {
            return StackExchange.using("mathjaxEditing", function () {
            StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
            StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
            });
            });
            }, "mathjax-editing");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "419"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcs.stackexchange.com%2fquestions%2f104571%2fhow-does-one-use-the-nerode-myhill-theorem-to-prove-that-a-language-is-regular%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            3












            $begingroup$

            It is just as straightforward to show a language is regular using Nerod-Myhill theorem as to show a language is not regular using that theorem since Nerode-Myhill theorem characterizes when a language is a regular.



            For example, let us take the simple language $L={s: |s|equiv 0 text{ (mod 2)}}$. There are two equivalent classes of $L$, assuming $a$ is a letter in the alphabet.




            • $left[epsilonright]_{equiv_{L}}=left{s: |s|equiv 0text{ (mod 2)}right}$

            • $left[aright]_{equiv_{L}}=left{s: |s|equiv 1text{ (mod 2)}right}$


            It should be easy for you to show that the above two classes are well-defined equivalence classes of $L$. There are no other equivalence class of $L$, since every word belongs to one of two classes. If a word is of even length, it belongs to class $left[epsilonright]_{equiv_{L}}$; otherwise, it belongs to class $left[aright]_{equiv_{L}}$.



            Hence, there are two equivalence classes of $L$ in total. That is, the number of equivalence classes of $L$ is finite. According to the Nerode-Myhill theorem, $L$ must be regular.




            I think that showing that there is a surjective mapping is not sufficient, because the image may still be of infinite size.




            I am not sure which surjective mapping you are talking about.



            As you can see from the example above, it is enough to show that the union of the finitely many equivalence classes you have found contains all words. Why? If we have another equivalence class $E,$ let $win E$. Then $w$ must belong to $F$, one of the equivalence classes you have found. Since $E$ and $F$ share one word, they are the same equivalence class. That is, $E$ has been found.



            You may want to check a few related questions and answers such as finding separating words (Nerode) and how I can find all equivalence classes by Myhill-Nerode?.






            share|cite|improve this answer











            $endgroup$


















              3












              $begingroup$

              It is just as straightforward to show a language is regular using Nerod-Myhill theorem as to show a language is not regular using that theorem since Nerode-Myhill theorem characterizes when a language is a regular.



              For example, let us take the simple language $L={s: |s|equiv 0 text{ (mod 2)}}$. There are two equivalent classes of $L$, assuming $a$ is a letter in the alphabet.




              • $left[epsilonright]_{equiv_{L}}=left{s: |s|equiv 0text{ (mod 2)}right}$

              • $left[aright]_{equiv_{L}}=left{s: |s|equiv 1text{ (mod 2)}right}$


              It should be easy for you to show that the above two classes are well-defined equivalence classes of $L$. There are no other equivalence class of $L$, since every word belongs to one of two classes. If a word is of even length, it belongs to class $left[epsilonright]_{equiv_{L}}$; otherwise, it belongs to class $left[aright]_{equiv_{L}}$.



              Hence, there are two equivalence classes of $L$ in total. That is, the number of equivalence classes of $L$ is finite. According to the Nerode-Myhill theorem, $L$ must be regular.




              I think that showing that there is a surjective mapping is not sufficient, because the image may still be of infinite size.




              I am not sure which surjective mapping you are talking about.



              As you can see from the example above, it is enough to show that the union of the finitely many equivalence classes you have found contains all words. Why? If we have another equivalence class $E,$ let $win E$. Then $w$ must belong to $F$, one of the equivalence classes you have found. Since $E$ and $F$ share one word, they are the same equivalence class. That is, $E$ has been found.



              You may want to check a few related questions and answers such as finding separating words (Nerode) and how I can find all equivalence classes by Myhill-Nerode?.






              share|cite|improve this answer











              $endgroup$
















                3












                3








                3





                $begingroup$

                It is just as straightforward to show a language is regular using Nerod-Myhill theorem as to show a language is not regular using that theorem since Nerode-Myhill theorem characterizes when a language is a regular.



                For example, let us take the simple language $L={s: |s|equiv 0 text{ (mod 2)}}$. There are two equivalent classes of $L$, assuming $a$ is a letter in the alphabet.




                • $left[epsilonright]_{equiv_{L}}=left{s: |s|equiv 0text{ (mod 2)}right}$

                • $left[aright]_{equiv_{L}}=left{s: |s|equiv 1text{ (mod 2)}right}$


                It should be easy for you to show that the above two classes are well-defined equivalence classes of $L$. There are no other equivalence class of $L$, since every word belongs to one of two classes. If a word is of even length, it belongs to class $left[epsilonright]_{equiv_{L}}$; otherwise, it belongs to class $left[aright]_{equiv_{L}}$.



                Hence, there are two equivalence classes of $L$ in total. That is, the number of equivalence classes of $L$ is finite. According to the Nerode-Myhill theorem, $L$ must be regular.




                I think that showing that there is a surjective mapping is not sufficient, because the image may still be of infinite size.




                I am not sure which surjective mapping you are talking about.



                As you can see from the example above, it is enough to show that the union of the finitely many equivalence classes you have found contains all words. Why? If we have another equivalence class $E,$ let $win E$. Then $w$ must belong to $F$, one of the equivalence classes you have found. Since $E$ and $F$ share one word, they are the same equivalence class. That is, $E$ has been found.



                You may want to check a few related questions and answers such as finding separating words (Nerode) and how I can find all equivalence classes by Myhill-Nerode?.






                share|cite|improve this answer











                $endgroup$



                It is just as straightforward to show a language is regular using Nerod-Myhill theorem as to show a language is not regular using that theorem since Nerode-Myhill theorem characterizes when a language is a regular.



                For example, let us take the simple language $L={s: |s|equiv 0 text{ (mod 2)}}$. There are two equivalent classes of $L$, assuming $a$ is a letter in the alphabet.




                • $left[epsilonright]_{equiv_{L}}=left{s: |s|equiv 0text{ (mod 2)}right}$

                • $left[aright]_{equiv_{L}}=left{s: |s|equiv 1text{ (mod 2)}right}$


                It should be easy for you to show that the above two classes are well-defined equivalence classes of $L$. There are no other equivalence class of $L$, since every word belongs to one of two classes. If a word is of even length, it belongs to class $left[epsilonright]_{equiv_{L}}$; otherwise, it belongs to class $left[aright]_{equiv_{L}}$.



                Hence, there are two equivalence classes of $L$ in total. That is, the number of equivalence classes of $L$ is finite. According to the Nerode-Myhill theorem, $L$ must be regular.




                I think that showing that there is a surjective mapping is not sufficient, because the image may still be of infinite size.




                I am not sure which surjective mapping you are talking about.



                As you can see from the example above, it is enough to show that the union of the finitely many equivalence classes you have found contains all words. Why? If we have another equivalence class $E,$ let $win E$. Then $w$ must belong to $F$, one of the equivalence classes you have found. Since $E$ and $F$ share one word, they are the same equivalence class. That is, $E$ has been found.



                You may want to check a few related questions and answers such as finding separating words (Nerode) and how I can find all equivalence classes by Myhill-Nerode?.







                share|cite|improve this answer














                share|cite|improve this answer



                share|cite|improve this answer








                edited 5 hours ago

























                answered 7 hours ago









                Apass.JackApass.Jack

                11k1939




                11k1939






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Computer Science Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    Use MathJax to format equations. MathJax reference.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcs.stackexchange.com%2fquestions%2f104571%2fhow-does-one-use-the-nerode-myhill-theorem-to-prove-that-a-language-is-regular%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

                    Alcedinidae

                    Origin of the phrase “under your belt”?