Can product DFA for intersection of two disjoint languages be minimal?











up vote
3
down vote

favorite
1












I know that it isn't necessary that cross product automaton for two minimal DFAs be minimal, but according to my analysis, if two DFAs do not have any common string then their cross product of minimal DFAs would be minimal. What should I do to prove this?










share|cite|improve this question









New contributor




Amisha Bansal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
























    up vote
    3
    down vote

    favorite
    1












    I know that it isn't necessary that cross product automaton for two minimal DFAs be minimal, but according to my analysis, if two DFAs do not have any common string then their cross product of minimal DFAs would be minimal. What should I do to prove this?










    share|cite|improve this question









    New contributor




    Amisha Bansal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      up vote
      3
      down vote

      favorite
      1









      up vote
      3
      down vote

      favorite
      1






      1





      I know that it isn't necessary that cross product automaton for two minimal DFAs be minimal, but according to my analysis, if two DFAs do not have any common string then their cross product of minimal DFAs would be minimal. What should I do to prove this?










      share|cite|improve this question









      New contributor




      Amisha Bansal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I know that it isn't necessary that cross product automaton for two minimal DFAs be minimal, but according to my analysis, if two DFAs do not have any common string then their cross product of minimal DFAs would be minimal. What should I do to prove this?







      finite-automata






      share|cite|improve this question









      New contributor




      Amisha Bansal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|cite|improve this question









      New contributor




      Amisha Bansal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|cite|improve this question




      share|cite|improve this question








      edited 32 mins ago









      Yuval Filmus

      188k12177339




      188k12177339






      New contributor




      Amisha Bansal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 4 hours ago









      Amisha Bansal

      162




      162




      New contributor




      Amisha Bansal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Amisha Bansal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Amisha Bansal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          3 Answers
          3






          active

          oldest

          votes

















          up vote
          2
          down vote













          No.



          Counterexample:



          Let alphabet $Sigma = left{ 0, 1 right}$, languages $L_1 = left{ w0 ,middle|, w in Sigma^ast right}$ (i.e. the last digit is $0$), $L_2 = left{ w1 ,middle|, w in Sigma^ast right}$ (i.e. the last digit is $1$). Note that $L_1 cap L_2 = emptyset$.



          Then the following DFAs $M_1$ and $M_2$ are minimal for $L_1$ and $L_2$ respectively:



          2-state DFA M_1



          2-state DFA M_2



          And the cross product of $M_1$ and $M_2$ (for the intersection of languages) is:



          complex DFA which recognizes the empty language



          But this is not minimal for the empty language. A minimal DFA for the language is:



          DFA which recognizes the empty language



          In fact, cross-product DFA of $M_1$ and $M_2$ recognizes an intersection of languages $L(M_1) cap L(M_2)$ (if a state of cross-product DFA is accepting when the original two states are both accepting on original DFAs). So in this case a generated cross-product DFA always recognizes the empty language. Since a minimal DFA for the empty language has only one state and cross-product DFA has ((#states of $M_1$) × (#states of $M_2$)) states, almost all cross-product DFAs are non-minimal.



          Also, even though if you define a state of cross-product DFA is accepting when either of the original two states is accepting, the above $(L_1, L_2)$ is a counterexample. Since $L_1 cup L_2 = Sigma^ast$, the minimal DFA has only one state.






          share|cite|improve this answer






























            up vote
            1
            down vote













            No, the Cartesian product (a.k.a. cross product in the question) of two minimal automaton may not be minimal.



            Here are two simple counterexamples.



            Note that a DFA with only one state will either accept all words if its start state is also an accept state or accept no words otherwise.



            Let alphabet $Sigma = left{ aright}$. Let $E$ be a minimal DFA such that $L(E)$ is not empty nor all words. The number of states in $E$ must be greater than 1. Let $O$ be a minimal DFA such that $L(O)$ is the complement of $L(E)$. The number of states in $O$ must be greater than 1.



            An automaton $P$ which is an Cartesian product automaton of $E$ and $O$ must have at least 2x2=4 states.



            Suppose $P$ is constructed for the intersection of $L(E)$ and $L(O)$, i.e. the empty language. Its equivalent minimal DFA has 1 state, the start state, which is not an accept state.



            Suppose $P$ is constructed for the union of $L(E)$ and $L(O)$, i.e., ${a}^*$. its equivalent minimal DFA has 1 state, the start state, which is also an accept state.





            Please note the Cartesian product automaton of two DFA is not defined uniquely usually since it is allowed to choose different sets of accept states. This is the implicit view as in the book Introduction to the theory of computation by Michael Sipser.






            share|cite|improve this answer






























              up vote
              0
              down vote













              Let $Q_A,Q_B$ be the number of states in $A,B$, respectively. The number of states in the product automaton is $Q_A Q_B$. Since $L(A) cap L(B) = emptyset$, the minimal automaton for $L(A) cap L(B) = emptyset$ contains a single state. This can only happen if $Q_A = Q_B = 1$, in which case $A,B in { emptyset, Sigma^* }$. We conclude that the product automaton is minimal exactly in the following three cases:





              1. $A = B = emptyset$.


              2. $A = emptyset$, $B = Sigma^*$.


              3. $A = Sigma^*$, $B = emptyset$.






              share|cite|improve this answer





















                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',
                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
                });


                }
                });






                Amisha Bansal is a new contributor. Be nice, and check out our Code of Conduct.










                draft saved

                draft discarded


















                StackExchange.ready(
                function () {
                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcs.stackexchange.com%2fquestions%2f101421%2fcan-product-dfa-for-intersection-of-two-disjoint-languages-be-minimal%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown

























                3 Answers
                3






                active

                oldest

                votes








                3 Answers
                3






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes








                up vote
                2
                down vote













                No.



                Counterexample:



                Let alphabet $Sigma = left{ 0, 1 right}$, languages $L_1 = left{ w0 ,middle|, w in Sigma^ast right}$ (i.e. the last digit is $0$), $L_2 = left{ w1 ,middle|, w in Sigma^ast right}$ (i.e. the last digit is $1$). Note that $L_1 cap L_2 = emptyset$.



                Then the following DFAs $M_1$ and $M_2$ are minimal for $L_1$ and $L_2$ respectively:



                2-state DFA M_1



                2-state DFA M_2



                And the cross product of $M_1$ and $M_2$ (for the intersection of languages) is:



                complex DFA which recognizes the empty language



                But this is not minimal for the empty language. A minimal DFA for the language is:



                DFA which recognizes the empty language



                In fact, cross-product DFA of $M_1$ and $M_2$ recognizes an intersection of languages $L(M_1) cap L(M_2)$ (if a state of cross-product DFA is accepting when the original two states are both accepting on original DFAs). So in this case a generated cross-product DFA always recognizes the empty language. Since a minimal DFA for the empty language has only one state and cross-product DFA has ((#states of $M_1$) × (#states of $M_2$)) states, almost all cross-product DFAs are non-minimal.



                Also, even though if you define a state of cross-product DFA is accepting when either of the original two states is accepting, the above $(L_1, L_2)$ is a counterexample. Since $L_1 cup L_2 = Sigma^ast$, the minimal DFA has only one state.






                share|cite|improve this answer



























                  up vote
                  2
                  down vote













                  No.



                  Counterexample:



                  Let alphabet $Sigma = left{ 0, 1 right}$, languages $L_1 = left{ w0 ,middle|, w in Sigma^ast right}$ (i.e. the last digit is $0$), $L_2 = left{ w1 ,middle|, w in Sigma^ast right}$ (i.e. the last digit is $1$). Note that $L_1 cap L_2 = emptyset$.



                  Then the following DFAs $M_1$ and $M_2$ are minimal for $L_1$ and $L_2$ respectively:



                  2-state DFA M_1



                  2-state DFA M_2



                  And the cross product of $M_1$ and $M_2$ (for the intersection of languages) is:



                  complex DFA which recognizes the empty language



                  But this is not minimal for the empty language. A minimal DFA for the language is:



                  DFA which recognizes the empty language



                  In fact, cross-product DFA of $M_1$ and $M_2$ recognizes an intersection of languages $L(M_1) cap L(M_2)$ (if a state of cross-product DFA is accepting when the original two states are both accepting on original DFAs). So in this case a generated cross-product DFA always recognizes the empty language. Since a minimal DFA for the empty language has only one state and cross-product DFA has ((#states of $M_1$) × (#states of $M_2$)) states, almost all cross-product DFAs are non-minimal.



                  Also, even though if you define a state of cross-product DFA is accepting when either of the original two states is accepting, the above $(L_1, L_2)$ is a counterexample. Since $L_1 cup L_2 = Sigma^ast$, the minimal DFA has only one state.






                  share|cite|improve this answer

























                    up vote
                    2
                    down vote










                    up vote
                    2
                    down vote









                    No.



                    Counterexample:



                    Let alphabet $Sigma = left{ 0, 1 right}$, languages $L_1 = left{ w0 ,middle|, w in Sigma^ast right}$ (i.e. the last digit is $0$), $L_2 = left{ w1 ,middle|, w in Sigma^ast right}$ (i.e. the last digit is $1$). Note that $L_1 cap L_2 = emptyset$.



                    Then the following DFAs $M_1$ and $M_2$ are minimal for $L_1$ and $L_2$ respectively:



                    2-state DFA M_1



                    2-state DFA M_2



                    And the cross product of $M_1$ and $M_2$ (for the intersection of languages) is:



                    complex DFA which recognizes the empty language



                    But this is not minimal for the empty language. A minimal DFA for the language is:



                    DFA which recognizes the empty language



                    In fact, cross-product DFA of $M_1$ and $M_2$ recognizes an intersection of languages $L(M_1) cap L(M_2)$ (if a state of cross-product DFA is accepting when the original two states are both accepting on original DFAs). So in this case a generated cross-product DFA always recognizes the empty language. Since a minimal DFA for the empty language has only one state and cross-product DFA has ((#states of $M_1$) × (#states of $M_2$)) states, almost all cross-product DFAs are non-minimal.



                    Also, even though if you define a state of cross-product DFA is accepting when either of the original two states is accepting, the above $(L_1, L_2)$ is a counterexample. Since $L_1 cup L_2 = Sigma^ast$, the minimal DFA has only one state.






                    share|cite|improve this answer














                    No.



                    Counterexample:



                    Let alphabet $Sigma = left{ 0, 1 right}$, languages $L_1 = left{ w0 ,middle|, w in Sigma^ast right}$ (i.e. the last digit is $0$), $L_2 = left{ w1 ,middle|, w in Sigma^ast right}$ (i.e. the last digit is $1$). Note that $L_1 cap L_2 = emptyset$.



                    Then the following DFAs $M_1$ and $M_2$ are minimal for $L_1$ and $L_2$ respectively:



                    2-state DFA M_1



                    2-state DFA M_2



                    And the cross product of $M_1$ and $M_2$ (for the intersection of languages) is:



                    complex DFA which recognizes the empty language



                    But this is not minimal for the empty language. A minimal DFA for the language is:



                    DFA which recognizes the empty language



                    In fact, cross-product DFA of $M_1$ and $M_2$ recognizes an intersection of languages $L(M_1) cap L(M_2)$ (if a state of cross-product DFA is accepting when the original two states are both accepting on original DFAs). So in this case a generated cross-product DFA always recognizes the empty language. Since a minimal DFA for the empty language has only one state and cross-product DFA has ((#states of $M_1$) × (#states of $M_2$)) states, almost all cross-product DFAs are non-minimal.



                    Also, even though if you define a state of cross-product DFA is accepting when either of the original two states is accepting, the above $(L_1, L_2)$ is a counterexample. Since $L_1 cup L_2 = Sigma^ast$, the minimal DFA has only one state.







                    share|cite|improve this answer














                    share|cite|improve this answer



                    share|cite|improve this answer








                    edited 1 hour ago

























                    answered 3 hours ago









                    nekketsuuu

                    672413




                    672413






















                        up vote
                        1
                        down vote













                        No, the Cartesian product (a.k.a. cross product in the question) of two minimal automaton may not be minimal.



                        Here are two simple counterexamples.



                        Note that a DFA with only one state will either accept all words if its start state is also an accept state or accept no words otherwise.



                        Let alphabet $Sigma = left{ aright}$. Let $E$ be a minimal DFA such that $L(E)$ is not empty nor all words. The number of states in $E$ must be greater than 1. Let $O$ be a minimal DFA such that $L(O)$ is the complement of $L(E)$. The number of states in $O$ must be greater than 1.



                        An automaton $P$ which is an Cartesian product automaton of $E$ and $O$ must have at least 2x2=4 states.



                        Suppose $P$ is constructed for the intersection of $L(E)$ and $L(O)$, i.e. the empty language. Its equivalent minimal DFA has 1 state, the start state, which is not an accept state.



                        Suppose $P$ is constructed for the union of $L(E)$ and $L(O)$, i.e., ${a}^*$. its equivalent minimal DFA has 1 state, the start state, which is also an accept state.





                        Please note the Cartesian product automaton of two DFA is not defined uniquely usually since it is allowed to choose different sets of accept states. This is the implicit view as in the book Introduction to the theory of computation by Michael Sipser.






                        share|cite|improve this answer



























                          up vote
                          1
                          down vote













                          No, the Cartesian product (a.k.a. cross product in the question) of two minimal automaton may not be minimal.



                          Here are two simple counterexamples.



                          Note that a DFA with only one state will either accept all words if its start state is also an accept state or accept no words otherwise.



                          Let alphabet $Sigma = left{ aright}$. Let $E$ be a minimal DFA such that $L(E)$ is not empty nor all words. The number of states in $E$ must be greater than 1. Let $O$ be a minimal DFA such that $L(O)$ is the complement of $L(E)$. The number of states in $O$ must be greater than 1.



                          An automaton $P$ which is an Cartesian product automaton of $E$ and $O$ must have at least 2x2=4 states.



                          Suppose $P$ is constructed for the intersection of $L(E)$ and $L(O)$, i.e. the empty language. Its equivalent minimal DFA has 1 state, the start state, which is not an accept state.



                          Suppose $P$ is constructed for the union of $L(E)$ and $L(O)$, i.e., ${a}^*$. its equivalent minimal DFA has 1 state, the start state, which is also an accept state.





                          Please note the Cartesian product automaton of two DFA is not defined uniquely usually since it is allowed to choose different sets of accept states. This is the implicit view as in the book Introduction to the theory of computation by Michael Sipser.






                          share|cite|improve this answer

























                            up vote
                            1
                            down vote










                            up vote
                            1
                            down vote









                            No, the Cartesian product (a.k.a. cross product in the question) of two minimal automaton may not be minimal.



                            Here are two simple counterexamples.



                            Note that a DFA with only one state will either accept all words if its start state is also an accept state or accept no words otherwise.



                            Let alphabet $Sigma = left{ aright}$. Let $E$ be a minimal DFA such that $L(E)$ is not empty nor all words. The number of states in $E$ must be greater than 1. Let $O$ be a minimal DFA such that $L(O)$ is the complement of $L(E)$. The number of states in $O$ must be greater than 1.



                            An automaton $P$ which is an Cartesian product automaton of $E$ and $O$ must have at least 2x2=4 states.



                            Suppose $P$ is constructed for the intersection of $L(E)$ and $L(O)$, i.e. the empty language. Its equivalent minimal DFA has 1 state, the start state, which is not an accept state.



                            Suppose $P$ is constructed for the union of $L(E)$ and $L(O)$, i.e., ${a}^*$. its equivalent minimal DFA has 1 state, the start state, which is also an accept state.





                            Please note the Cartesian product automaton of two DFA is not defined uniquely usually since it is allowed to choose different sets of accept states. This is the implicit view as in the book Introduction to the theory of computation by Michael Sipser.






                            share|cite|improve this answer














                            No, the Cartesian product (a.k.a. cross product in the question) of two minimal automaton may not be minimal.



                            Here are two simple counterexamples.



                            Note that a DFA with only one state will either accept all words if its start state is also an accept state or accept no words otherwise.



                            Let alphabet $Sigma = left{ aright}$. Let $E$ be a minimal DFA such that $L(E)$ is not empty nor all words. The number of states in $E$ must be greater than 1. Let $O$ be a minimal DFA such that $L(O)$ is the complement of $L(E)$. The number of states in $O$ must be greater than 1.



                            An automaton $P$ which is an Cartesian product automaton of $E$ and $O$ must have at least 2x2=4 states.



                            Suppose $P$ is constructed for the intersection of $L(E)$ and $L(O)$, i.e. the empty language. Its equivalent minimal DFA has 1 state, the start state, which is not an accept state.



                            Suppose $P$ is constructed for the union of $L(E)$ and $L(O)$, i.e., ${a}^*$. its equivalent minimal DFA has 1 state, the start state, which is also an accept state.





                            Please note the Cartesian product automaton of two DFA is not defined uniquely usually since it is allowed to choose different sets of accept states. This is the implicit view as in the book Introduction to the theory of computation by Michael Sipser.







                            share|cite|improve this answer














                            share|cite|improve this answer



                            share|cite|improve this answer








                            edited 1 hour ago

























                            answered 1 hour ago









                            Apass.Jack

                            5,7581531




                            5,7581531






















                                up vote
                                0
                                down vote













                                Let $Q_A,Q_B$ be the number of states in $A,B$, respectively. The number of states in the product automaton is $Q_A Q_B$. Since $L(A) cap L(B) = emptyset$, the minimal automaton for $L(A) cap L(B) = emptyset$ contains a single state. This can only happen if $Q_A = Q_B = 1$, in which case $A,B in { emptyset, Sigma^* }$. We conclude that the product automaton is minimal exactly in the following three cases:





                                1. $A = B = emptyset$.


                                2. $A = emptyset$, $B = Sigma^*$.


                                3. $A = Sigma^*$, $B = emptyset$.






                                share|cite|improve this answer

























                                  up vote
                                  0
                                  down vote













                                  Let $Q_A,Q_B$ be the number of states in $A,B$, respectively. The number of states in the product automaton is $Q_A Q_B$. Since $L(A) cap L(B) = emptyset$, the minimal automaton for $L(A) cap L(B) = emptyset$ contains a single state. This can only happen if $Q_A = Q_B = 1$, in which case $A,B in { emptyset, Sigma^* }$. We conclude that the product automaton is minimal exactly in the following three cases:





                                  1. $A = B = emptyset$.


                                  2. $A = emptyset$, $B = Sigma^*$.


                                  3. $A = Sigma^*$, $B = emptyset$.






                                  share|cite|improve this answer























                                    up vote
                                    0
                                    down vote










                                    up vote
                                    0
                                    down vote









                                    Let $Q_A,Q_B$ be the number of states in $A,B$, respectively. The number of states in the product automaton is $Q_A Q_B$. Since $L(A) cap L(B) = emptyset$, the minimal automaton for $L(A) cap L(B) = emptyset$ contains a single state. This can only happen if $Q_A = Q_B = 1$, in which case $A,B in { emptyset, Sigma^* }$. We conclude that the product automaton is minimal exactly in the following three cases:





                                    1. $A = B = emptyset$.


                                    2. $A = emptyset$, $B = Sigma^*$.


                                    3. $A = Sigma^*$, $B = emptyset$.






                                    share|cite|improve this answer












                                    Let $Q_A,Q_B$ be the number of states in $A,B$, respectively. The number of states in the product automaton is $Q_A Q_B$. Since $L(A) cap L(B) = emptyset$, the minimal automaton for $L(A) cap L(B) = emptyset$ contains a single state. This can only happen if $Q_A = Q_B = 1$, in which case $A,B in { emptyset, Sigma^* }$. We conclude that the product automaton is minimal exactly in the following three cases:





                                    1. $A = B = emptyset$.


                                    2. $A = emptyset$, $B = Sigma^*$.


                                    3. $A = Sigma^*$, $B = emptyset$.







                                    share|cite|improve this answer












                                    share|cite|improve this answer



                                    share|cite|improve this answer










                                    answered 34 mins ago









                                    Yuval Filmus

                                    188k12177339




                                    188k12177339






















                                        Amisha Bansal is a new contributor. Be nice, and check out our Code of Conduct.










                                        draft saved

                                        draft discarded


















                                        Amisha Bansal is a new contributor. Be nice, and check out our Code of Conduct.













                                        Amisha Bansal is a new contributor. Be nice, and check out our Code of Conduct.












                                        Amisha Bansal is a new contributor. Be nice, and check out our Code of Conduct.
















                                        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.





                                        Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                        Please pay close attention to the following guidance:


                                        • 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.


                                        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%2f101421%2fcan-product-dfa-for-intersection-of-two-disjoint-languages-be-minimal%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

                                        What visual should I use to simply compare current year value vs last year in Power BI desktop

                                        How to ignore python UserWarning in pytest?

                                        Alexandru Averescu