Find the language an NFA recognizes

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
4
down vote

favorite
1












For example, I have an NFA $A_n$ with alphabet $Sigma = 0, 1$.



NFA A_n



The language recognized by this NFA is known to be $v$.



I was unable to get the answer on my own. What got me stuck was that there is a $1$ between $s$ and $q_1$, plus the $q_n$ toward $s$. I know without the edge $q_n rightarrow s$, the answer should be $0,1^* cdot 1 cdot 0,1^n-1$, which is exactly the solution our lecturer provides. Why doesn't the "go back to start" edge matter?










share|cite|improve this question







New contributor




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



















  • Try to trace the automaton with n = 2 and input string 11111. You might get something that why that edge doesn't matter.
    – Deep Joshi
    6 hours ago










  • Thanks for the reply but I still don't see why :(
    – John
    6 hours ago










  • Do you see multiple finite controls of automaton in the same state at any point?
    – Deep Joshi
    6 hours ago










  • I'm not sure what you meant by "multiple finite controls of automaton" (sorry, English is not my native language). But I do see that with n=2 and input=11111, there are two ways the NFA can be recognized: $s s s s q_1 q_2$ or $s q_1 q_2 s q_1 q_2$. I get it now the $1v$ part in $u1v$ - the suffix of strings in the language doesn't change with/without that extra edge, but I don't understand why there is no restrictions in the $u$ part.
    – John
    6 hours ago











  • What else I have observed is that if the input starts with 0, ensuring that the first step is $ss$, then there's only one way the input can be recognized - looping the $ss$ for the entire $u$ part, until there are $n$ letters left. The "go back to start" edge will be ignored in this case.
    – John
    6 hours ago














up vote
4
down vote

favorite
1












For example, I have an NFA $A_n$ with alphabet $Sigma = 0, 1$.



NFA A_n



The language recognized by this NFA is known to be $v$.



I was unable to get the answer on my own. What got me stuck was that there is a $1$ between $s$ and $q_1$, plus the $q_n$ toward $s$. I know without the edge $q_n rightarrow s$, the answer should be $0,1^* cdot 1 cdot 0,1^n-1$, which is exactly the solution our lecturer provides. Why doesn't the "go back to start" edge matter?










share|cite|improve this question







New contributor




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



















  • Try to trace the automaton with n = 2 and input string 11111. You might get something that why that edge doesn't matter.
    – Deep Joshi
    6 hours ago










  • Thanks for the reply but I still don't see why :(
    – John
    6 hours ago










  • Do you see multiple finite controls of automaton in the same state at any point?
    – Deep Joshi
    6 hours ago










  • I'm not sure what you meant by "multiple finite controls of automaton" (sorry, English is not my native language). But I do see that with n=2 and input=11111, there are two ways the NFA can be recognized: $s s s s q_1 q_2$ or $s q_1 q_2 s q_1 q_2$. I get it now the $1v$ part in $u1v$ - the suffix of strings in the language doesn't change with/without that extra edge, but I don't understand why there is no restrictions in the $u$ part.
    – John
    6 hours ago











  • What else I have observed is that if the input starts with 0, ensuring that the first step is $ss$, then there's only one way the input can be recognized - looping the $ss$ for the entire $u$ part, until there are $n$ letters left. The "go back to start" edge will be ignored in this case.
    – John
    6 hours ago












up vote
4
down vote

favorite
1









up vote
4
down vote

favorite
1






1





For example, I have an NFA $A_n$ with alphabet $Sigma = 0, 1$.



NFA A_n



The language recognized by this NFA is known to be $v$.



I was unable to get the answer on my own. What got me stuck was that there is a $1$ between $s$ and $q_1$, plus the $q_n$ toward $s$. I know without the edge $q_n rightarrow s$, the answer should be $0,1^* cdot 1 cdot 0,1^n-1$, which is exactly the solution our lecturer provides. Why doesn't the "go back to start" edge matter?










share|cite|improve this question







New contributor




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











For example, I have an NFA $A_n$ with alphabet $Sigma = 0, 1$.



NFA A_n



The language recognized by this NFA is known to be $v$.



I was unable to get the answer on my own. What got me stuck was that there is a $1$ between $s$ and $q_1$, plus the $q_n$ toward $s$. I know without the edge $q_n rightarrow s$, the answer should be $0,1^* cdot 1 cdot 0,1^n-1$, which is exactly the solution our lecturer provides. Why doesn't the "go back to start" edge matter?







automata regular-languages finite-automata






share|cite|improve this question







New contributor




John 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




John 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






New contributor




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









asked 7 hours ago









John

233




233




New contributor




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





New contributor





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






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











  • Try to trace the automaton with n = 2 and input string 11111. You might get something that why that edge doesn't matter.
    – Deep Joshi
    6 hours ago










  • Thanks for the reply but I still don't see why :(
    – John
    6 hours ago










  • Do you see multiple finite controls of automaton in the same state at any point?
    – Deep Joshi
    6 hours ago










  • I'm not sure what you meant by "multiple finite controls of automaton" (sorry, English is not my native language). But I do see that with n=2 and input=11111, there are two ways the NFA can be recognized: $s s s s q_1 q_2$ or $s q_1 q_2 s q_1 q_2$. I get it now the $1v$ part in $u1v$ - the suffix of strings in the language doesn't change with/without that extra edge, but I don't understand why there is no restrictions in the $u$ part.
    – John
    6 hours ago











  • What else I have observed is that if the input starts with 0, ensuring that the first step is $ss$, then there's only one way the input can be recognized - looping the $ss$ for the entire $u$ part, until there are $n$ letters left. The "go back to start" edge will be ignored in this case.
    – John
    6 hours ago
















  • Try to trace the automaton with n = 2 and input string 11111. You might get something that why that edge doesn't matter.
    – Deep Joshi
    6 hours ago










  • Thanks for the reply but I still don't see why :(
    – John
    6 hours ago










  • Do you see multiple finite controls of automaton in the same state at any point?
    – Deep Joshi
    6 hours ago










  • I'm not sure what you meant by "multiple finite controls of automaton" (sorry, English is not my native language). But I do see that with n=2 and input=11111, there are two ways the NFA can be recognized: $s s s s q_1 q_2$ or $s q_1 q_2 s q_1 q_2$. I get it now the $1v$ part in $u1v$ - the suffix of strings in the language doesn't change with/without that extra edge, but I don't understand why there is no restrictions in the $u$ part.
    – John
    6 hours ago











  • What else I have observed is that if the input starts with 0, ensuring that the first step is $ss$, then there's only one way the input can be recognized - looping the $ss$ for the entire $u$ part, until there are $n$ letters left. The "go back to start" edge will be ignored in this case.
    – John
    6 hours ago















Try to trace the automaton with n = 2 and input string 11111. You might get something that why that edge doesn't matter.
– Deep Joshi
6 hours ago




Try to trace the automaton with n = 2 and input string 11111. You might get something that why that edge doesn't matter.
– Deep Joshi
6 hours ago












Thanks for the reply but I still don't see why :(
– John
6 hours ago




Thanks for the reply but I still don't see why :(
– John
6 hours ago












Do you see multiple finite controls of automaton in the same state at any point?
– Deep Joshi
6 hours ago




Do you see multiple finite controls of automaton in the same state at any point?
– Deep Joshi
6 hours ago












I'm not sure what you meant by "multiple finite controls of automaton" (sorry, English is not my native language). But I do see that with n=2 and input=11111, there are two ways the NFA can be recognized: $s s s s q_1 q_2$ or $s q_1 q_2 s q_1 q_2$. I get it now the $1v$ part in $u1v$ - the suffix of strings in the language doesn't change with/without that extra edge, but I don't understand why there is no restrictions in the $u$ part.
– John
6 hours ago





I'm not sure what you meant by "multiple finite controls of automaton" (sorry, English is not my native language). But I do see that with n=2 and input=11111, there are two ways the NFA can be recognized: $s s s s q_1 q_2$ or $s q_1 q_2 s q_1 q_2$. I get it now the $1v$ part in $u1v$ - the suffix of strings in the language doesn't change with/without that extra edge, but I don't understand why there is no restrictions in the $u$ part.
– John
6 hours ago













What else I have observed is that if the input starts with 0, ensuring that the first step is $ss$, then there's only one way the input can be recognized - looping the $ss$ for the entire $u$ part, until there are $n$ letters left. The "go back to start" edge will be ignored in this case.
– John
6 hours ago




What else I have observed is that if the input starts with 0, ensuring that the first step is $ss$, then there's only one way the input can be recognized - looping the $ss$ for the entire $u$ part, until there are $n$ letters left. The "go back to start" edge will be ignored in this case.
– John
6 hours ago










2 Answers
2






active

oldest

votes

















up vote
2
down vote



accepted










Let $r=0,1^*.1.0,1^n-1$, be the RegularExpression representing the path $s$ to $q_n$.

Now including the transition from $q_n$ to $s$, $r$ becomes, $R=r.(0,1.r)^*$. In $r$, the starting $0,1^*$ is the superset of $r$'s ending $0,1^n-1$.


That is, $0,1^n-1 in 0,1^*, forall n ge 1$
$0,1 = 0,1^2-1 space implies 0,1 in 0,1^*$.


This means that in $R$, ending of the every $r$ concatenates with $0,1$ inside the brackets of $R$ to becomes $0,1^n$. Now this overlaps with $0,1^*$ from the start of $r$ to become $0,1^*$. This becomes recursive and eats up the entire regular expression.

$implies space R = r space and space R=R.(0,1.R)^*$

Hence, $R=0,1^*.1.0,1^n-1$.

Note
You can alternatively prove this by expanding and rearranging $R=r.(0,1.r)^*$.






share|cite








New contributor




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

















  • Thanks! Didn't realize I can see this problem from the perspective of RE.
    – John
    1 hour ago

















up vote
2
down vote













The "go back to start" edge doesn't matter because of nondeterminism and the fact that you can read any string at all while staying in state $s$. Any string that the automaton accepts has an accepting run that doesn't use the "go back to start" edge.






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: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );






    John 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%2f97311%2ffind-the-language-an-nfa-recognizes%23new-answer', 'question_page');

    );

    Post as a guest






























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    2
    down vote



    accepted










    Let $r=0,1^*.1.0,1^n-1$, be the RegularExpression representing the path $s$ to $q_n$.

    Now including the transition from $q_n$ to $s$, $r$ becomes, $R=r.(0,1.r)^*$. In $r$, the starting $0,1^*$ is the superset of $r$'s ending $0,1^n-1$.


    That is, $0,1^n-1 in 0,1^*, forall n ge 1$
    $0,1 = 0,1^2-1 space implies 0,1 in 0,1^*$.


    This means that in $R$, ending of the every $r$ concatenates with $0,1$ inside the brackets of $R$ to becomes $0,1^n$. Now this overlaps with $0,1^*$ from the start of $r$ to become $0,1^*$. This becomes recursive and eats up the entire regular expression.

    $implies space R = r space and space R=R.(0,1.R)^*$

    Hence, $R=0,1^*.1.0,1^n-1$.

    Note
    You can alternatively prove this by expanding and rearranging $R=r.(0,1.r)^*$.






    share|cite








    New contributor




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

















    • Thanks! Didn't realize I can see this problem from the perspective of RE.
      – John
      1 hour ago














    up vote
    2
    down vote



    accepted










    Let $r=0,1^*.1.0,1^n-1$, be the RegularExpression representing the path $s$ to $q_n$.

    Now including the transition from $q_n$ to $s$, $r$ becomes, $R=r.(0,1.r)^*$. In $r$, the starting $0,1^*$ is the superset of $r$'s ending $0,1^n-1$.


    That is, $0,1^n-1 in 0,1^*, forall n ge 1$
    $0,1 = 0,1^2-1 space implies 0,1 in 0,1^*$.


    This means that in $R$, ending of the every $r$ concatenates with $0,1$ inside the brackets of $R$ to becomes $0,1^n$. Now this overlaps with $0,1^*$ from the start of $r$ to become $0,1^*$. This becomes recursive and eats up the entire regular expression.

    $implies space R = r space and space R=R.(0,1.R)^*$

    Hence, $R=0,1^*.1.0,1^n-1$.

    Note
    You can alternatively prove this by expanding and rearranging $R=r.(0,1.r)^*$.






    share|cite








    New contributor




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

















    • Thanks! Didn't realize I can see this problem from the perspective of RE.
      – John
      1 hour ago












    up vote
    2
    down vote



    accepted







    up vote
    2
    down vote



    accepted






    Let $r=0,1^*.1.0,1^n-1$, be the RegularExpression representing the path $s$ to $q_n$.

    Now including the transition from $q_n$ to $s$, $r$ becomes, $R=r.(0,1.r)^*$. In $r$, the starting $0,1^*$ is the superset of $r$'s ending $0,1^n-1$.


    That is, $0,1^n-1 in 0,1^*, forall n ge 1$
    $0,1 = 0,1^2-1 space implies 0,1 in 0,1^*$.


    This means that in $R$, ending of the every $r$ concatenates with $0,1$ inside the brackets of $R$ to becomes $0,1^n$. Now this overlaps with $0,1^*$ from the start of $r$ to become $0,1^*$. This becomes recursive and eats up the entire regular expression.

    $implies space R = r space and space R=R.(0,1.R)^*$

    Hence, $R=0,1^*.1.0,1^n-1$.

    Note
    You can alternatively prove this by expanding and rearranging $R=r.(0,1.r)^*$.






    share|cite








    New contributor




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









    Let $r=0,1^*.1.0,1^n-1$, be the RegularExpression representing the path $s$ to $q_n$.

    Now including the transition from $q_n$ to $s$, $r$ becomes, $R=r.(0,1.r)^*$. In $r$, the starting $0,1^*$ is the superset of $r$'s ending $0,1^n-1$.


    That is, $0,1^n-1 in 0,1^*, forall n ge 1$
    $0,1 = 0,1^2-1 space implies 0,1 in 0,1^*$.


    This means that in $R$, ending of the every $r$ concatenates with $0,1$ inside the brackets of $R$ to becomes $0,1^n$. Now this overlaps with $0,1^*$ from the start of $r$ to become $0,1^*$. This becomes recursive and eats up the entire regular expression.

    $implies space R = r space and space R=R.(0,1.R)^*$

    Hence, $R=0,1^*.1.0,1^n-1$.

    Note
    You can alternatively prove this by expanding and rearranging $R=r.(0,1.r)^*$.







    share|cite








    New contributor




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









    share|cite



    share|cite






    New contributor




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









    answered 2 hours ago









    RandomPerfectHashFunction

    563




    563




    New contributor




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





    New contributor





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






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











    • Thanks! Didn't realize I can see this problem from the perspective of RE.
      – John
      1 hour ago
















    • Thanks! Didn't realize I can see this problem from the perspective of RE.
      – John
      1 hour ago















    Thanks! Didn't realize I can see this problem from the perspective of RE.
    – John
    1 hour ago




    Thanks! Didn't realize I can see this problem from the perspective of RE.
    – John
    1 hour ago










    up vote
    2
    down vote













    The "go back to start" edge doesn't matter because of nondeterminism and the fact that you can read any string at all while staying in state $s$. Any string that the automaton accepts has an accepting run that doesn't use the "go back to start" edge.






    share|cite|improve this answer
























      up vote
      2
      down vote













      The "go back to start" edge doesn't matter because of nondeterminism and the fact that you can read any string at all while staying in state $s$. Any string that the automaton accepts has an accepting run that doesn't use the "go back to start" edge.






      share|cite|improve this answer






















        up vote
        2
        down vote










        up vote
        2
        down vote









        The "go back to start" edge doesn't matter because of nondeterminism and the fact that you can read any string at all while staying in state $s$. Any string that the automaton accepts has an accepting run that doesn't use the "go back to start" edge.






        share|cite|improve this answer












        The "go back to start" edge doesn't matter because of nondeterminism and the fact that you can read any string at all while staying in state $s$. Any string that the automaton accepts has an accepting run that doesn't use the "go back to start" edge.







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered 48 mins ago









        David Richerby

        61.5k1594179




        61.5k1594179




















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









             

            draft saved


            draft discarded


















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












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











            John 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%2f97311%2ffind-the-language-an-nfa-recognizes%23new-answer', 'question_page');

            );

            Post as a guest













































































            Comments

            Popular posts from this blog

            Long meetings (6-7 hours a day): Being “babysat” by supervisor

            Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

            Confectionery