Why is this basic language not a regular language? The 2019 Stack Overflow Developer Survey Results Are InBinary regular language?Is the language that accepts strings concatenated with their reverse regular?Definition of a regular languageRegular language concatenation with supersetGenerators of families of langauges?Can the definition of regular languages be simplified?Prove language is regularProve a language is regular - Regular language of 0's and 1'sDoes this proof work for infinite regular languagesProving that language is regular or not

Scaling a graph of a circle and the standard parabola in TikZ

Why isn't the circumferential light around the M87 black hole's event horizon symmetric?

I see my dog run

What are the motivations for publishing new editions of an existing textbook, beyond new discoveries in a field?

How to answer pointed "are you quitting" questioning when I don't want them to suspect

Worn-tile Scrabble

Why isn't airport relocation done gradually?

What is the accessibility of a package's `Private` context variables?

If I score a critical hit on an 18 or higher, what are my chances of getting a critical hit if I roll 3d20?

Are there incongruent pythagorean triangles with the same perimeter and same area?

Can a rogue use sneak attack with weapons that have the thrown property even if they are not thrown?

Earliest use of the term "Galois extension"?

What do the Banks children have against barley water?

Multiply Two Integer Polynomials

Time travel alters history but people keep saying nothing's changed

Is a "Democratic" Oligarchy-Style System Possible?

What could be the right powersource for 15 seconds lifespan disposable giant chainsaw?

How can I autofill dates in Excel excluding Sunday?

What does "fetching by region is not available for SAM files" means?

Why do UK politicians seemingly ignore opinion polls on Brexit?

Identify boardgame from Big movie

Is flight data recorder erased after every flight?

One word riddle: Vowel in the middle

Do these rules for Critical Successes and Critical Failures seem Fair?



Why is this basic language not a regular language?



The 2019 Stack Overflow Developer Survey Results Are InBinary regular language?Is the language that accepts strings concatenated with their reverse regular?Definition of a regular languageRegular language concatenation with supersetGenerators of families of langauges?Can the definition of regular languages be simplified?Prove language is regularProve a language is regular - Regular language of 0's and 1'sDoes this proof work for infinite regular languagesProving that language is regular or not










1












$begingroup$


L = x has an equal number of 0s & 1s



Based on the recursive definition of regular languages, isn't it possible to form a single regular language set over the binary alphabet 0,1 by doing the following?



  1. concatenating 0's and 1's to form each of the binary strings satisfying the condition, resulting in a regular language consisting of that single string

  2. union all the single-string regular languages together into one single regular language









share|cite|improve this question







New contributor




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







$endgroup$











  • $begingroup$
    There must be something wrong with your proof attempt, since it would apply to any language and there are surely some non-regular languages. The answers explain what.
    $endgroup$
    – David Richerby
    Apr 6 at 19:47
















1












$begingroup$


L = x has an equal number of 0s & 1s



Based on the recursive definition of regular languages, isn't it possible to form a single regular language set over the binary alphabet 0,1 by doing the following?



  1. concatenating 0's and 1's to form each of the binary strings satisfying the condition, resulting in a regular language consisting of that single string

  2. union all the single-string regular languages together into one single regular language









share|cite|improve this question







New contributor




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







$endgroup$











  • $begingroup$
    There must be something wrong with your proof attempt, since it would apply to any language and there are surely some non-regular languages. The answers explain what.
    $endgroup$
    – David Richerby
    Apr 6 at 19:47














1












1








1





$begingroup$


L = x has an equal number of 0s & 1s



Based on the recursive definition of regular languages, isn't it possible to form a single regular language set over the binary alphabet 0,1 by doing the following?



  1. concatenating 0's and 1's to form each of the binary strings satisfying the condition, resulting in a regular language consisting of that single string

  2. union all the single-string regular languages together into one single regular language









share|cite|improve this question







New contributor




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







$endgroup$




L = x has an equal number of 0s & 1s



Based on the recursive definition of regular languages, isn't it possible to form a single regular language set over the binary alphabet 0,1 by doing the following?



  1. concatenating 0's and 1's to form each of the binary strings satisfying the condition, resulting in a regular language consisting of that single string

  2. union all the single-string regular languages together into one single regular language






regular-languages






share|cite|improve this question







New contributor




Shukie 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




Shukie 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




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









asked Apr 6 at 10:45









ShukieShukie

61




61




New contributor




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





New contributor





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






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











  • $begingroup$
    There must be something wrong with your proof attempt, since it would apply to any language and there are surely some non-regular languages. The answers explain what.
    $endgroup$
    – David Richerby
    Apr 6 at 19:47

















  • $begingroup$
    There must be something wrong with your proof attempt, since it would apply to any language and there are surely some non-regular languages. The answers explain what.
    $endgroup$
    – David Richerby
    Apr 6 at 19:47
















$begingroup$
There must be something wrong with your proof attempt, since it would apply to any language and there are surely some non-regular languages. The answers explain what.
$endgroup$
– David Richerby
Apr 6 at 19:47





$begingroup$
There must be something wrong with your proof attempt, since it would apply to any language and there are surely some non-regular languages. The answers explain what.
$endgroup$
– David Richerby
Apr 6 at 19:47











3 Answers
3






active

oldest

votes


















3












$begingroup$

Every language is the union of regular languages:
$$
L = bigcup_x in L x .
$$

However, the set of regular languages is not closed under infinite unions. It isn't even closed under countably infinite unions, as your example demonstrates.



You can prove that your language is not regular in many ways. For example, if your language were regular, then so would its intersection with $0^*1^*$ be; yet this language is $ 0^n 1^n : n geq 0 $, the classical example of a non-regular language. You can also prove non-regularity of your language directly, using either the pumping lemma or Myhill–Nerode theory.






share|cite|improve this answer









$endgroup$












  • $begingroup$
    Thank you very much!
    $endgroup$
    – Shukie
    Apr 7 at 8:55


















1












$begingroup$

You're on the right track! There's just one thing you're missing.



The "build all the strings and union them together" approach works great—if you have a finite number of strings. There's a theorem that says "a union of finitely many regular languages is regular", but the key is the finitely many.



In this case, there are infinitely many strings in the language, so the union-them-all trick no longer works.



If you want to prove that the language is not regular (as opposed to just failing to prove that it is regular), try a fooling set proof:



  • Let $F$ be the language $1^*$. It's clearly infinite.

  • Let $x$ and $y$ be two distinct strings in $F$. These can be written as $1^i$ and $1^j$ with $i neq j$.

  • Now, let $z$ be $0^i$. From the definition of your language, we can see that $xz$ is in the language, but $yz$ is not.

  • Therefore, all the different strings in $F$ are distinguishable as prefixes. Since the language has infinitely many distinguishable prefixes, it cannot be regular.





share|cite|improve this answer









$endgroup$












  • $begingroup$
    Thank you very much! That finite part wasn't mentioned in my lecture notes unfortunately.
    $endgroup$
    – Shukie
    Apr 7 at 8:56










  • $begingroup$
    @Shukie It's an unfortunate fact that many lecturers gloss over the "fine print" in the proofs. Often that works just fine, and then you run into one of the cases like this where the fine print matters! (In other words, it's a good question to ask!)
    $endgroup$
    – Draconis
    Apr 7 at 16:11


















1












$begingroup$

After you process n zeroes, the set of following strings leading to an accept state are all those with n 1’s more than 0’s. All these sets are different. And each set is roughly the same as a state in a state machine - so you can’t have a state machine with finite number of states.






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
    );



    );






    Shukie 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%2f106556%2fwhy-is-this-basic-language-not-a-regular-language%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









    3












    $begingroup$

    Every language is the union of regular languages:
    $$
    L = bigcup_x in L x .
    $$

    However, the set of regular languages is not closed under infinite unions. It isn't even closed under countably infinite unions, as your example demonstrates.



    You can prove that your language is not regular in many ways. For example, if your language were regular, then so would its intersection with $0^*1^*$ be; yet this language is $ 0^n 1^n : n geq 0 $, the classical example of a non-regular language. You can also prove non-regularity of your language directly, using either the pumping lemma or Myhill–Nerode theory.






    share|cite|improve this answer









    $endgroup$












    • $begingroup$
      Thank you very much!
      $endgroup$
      – Shukie
      Apr 7 at 8:55















    3












    $begingroup$

    Every language is the union of regular languages:
    $$
    L = bigcup_x in L x .
    $$

    However, the set of regular languages is not closed under infinite unions. It isn't even closed under countably infinite unions, as your example demonstrates.



    You can prove that your language is not regular in many ways. For example, if your language were regular, then so would its intersection with $0^*1^*$ be; yet this language is $ 0^n 1^n : n geq 0 $, the classical example of a non-regular language. You can also prove non-regularity of your language directly, using either the pumping lemma or Myhill–Nerode theory.






    share|cite|improve this answer









    $endgroup$












    • $begingroup$
      Thank you very much!
      $endgroup$
      – Shukie
      Apr 7 at 8:55













    3












    3








    3





    $begingroup$

    Every language is the union of regular languages:
    $$
    L = bigcup_x in L x .
    $$

    However, the set of regular languages is not closed under infinite unions. It isn't even closed under countably infinite unions, as your example demonstrates.



    You can prove that your language is not regular in many ways. For example, if your language were regular, then so would its intersection with $0^*1^*$ be; yet this language is $ 0^n 1^n : n geq 0 $, the classical example of a non-regular language. You can also prove non-regularity of your language directly, using either the pumping lemma or Myhill–Nerode theory.






    share|cite|improve this answer









    $endgroup$



    Every language is the union of regular languages:
    $$
    L = bigcup_x in L x .
    $$

    However, the set of regular languages is not closed under infinite unions. It isn't even closed under countably infinite unions, as your example demonstrates.



    You can prove that your language is not regular in many ways. For example, if your language were regular, then so would its intersection with $0^*1^*$ be; yet this language is $ 0^n 1^n : n geq 0 $, the classical example of a non-regular language. You can also prove non-regularity of your language directly, using either the pumping lemma or Myhill–Nerode theory.







    share|cite|improve this answer












    share|cite|improve this answer



    share|cite|improve this answer










    answered Apr 6 at 12:00









    Yuval FilmusYuval Filmus

    196k15185349




    196k15185349











    • $begingroup$
      Thank you very much!
      $endgroup$
      – Shukie
      Apr 7 at 8:55
















    • $begingroup$
      Thank you very much!
      $endgroup$
      – Shukie
      Apr 7 at 8:55















    $begingroup$
    Thank you very much!
    $endgroup$
    – Shukie
    Apr 7 at 8:55




    $begingroup$
    Thank you very much!
    $endgroup$
    – Shukie
    Apr 7 at 8:55











    1












    $begingroup$

    You're on the right track! There's just one thing you're missing.



    The "build all the strings and union them together" approach works great—if you have a finite number of strings. There's a theorem that says "a union of finitely many regular languages is regular", but the key is the finitely many.



    In this case, there are infinitely many strings in the language, so the union-them-all trick no longer works.



    If you want to prove that the language is not regular (as opposed to just failing to prove that it is regular), try a fooling set proof:



    • Let $F$ be the language $1^*$. It's clearly infinite.

    • Let $x$ and $y$ be two distinct strings in $F$. These can be written as $1^i$ and $1^j$ with $i neq j$.

    • Now, let $z$ be $0^i$. From the definition of your language, we can see that $xz$ is in the language, but $yz$ is not.

    • Therefore, all the different strings in $F$ are distinguishable as prefixes. Since the language has infinitely many distinguishable prefixes, it cannot be regular.





    share|cite|improve this answer









    $endgroup$












    • $begingroup$
      Thank you very much! That finite part wasn't mentioned in my lecture notes unfortunately.
      $endgroup$
      – Shukie
      Apr 7 at 8:56










    • $begingroup$
      @Shukie It's an unfortunate fact that many lecturers gloss over the "fine print" in the proofs. Often that works just fine, and then you run into one of the cases like this where the fine print matters! (In other words, it's a good question to ask!)
      $endgroup$
      – Draconis
      Apr 7 at 16:11















    1












    $begingroup$

    You're on the right track! There's just one thing you're missing.



    The "build all the strings and union them together" approach works great—if you have a finite number of strings. There's a theorem that says "a union of finitely many regular languages is regular", but the key is the finitely many.



    In this case, there are infinitely many strings in the language, so the union-them-all trick no longer works.



    If you want to prove that the language is not regular (as opposed to just failing to prove that it is regular), try a fooling set proof:



    • Let $F$ be the language $1^*$. It's clearly infinite.

    • Let $x$ and $y$ be two distinct strings in $F$. These can be written as $1^i$ and $1^j$ with $i neq j$.

    • Now, let $z$ be $0^i$. From the definition of your language, we can see that $xz$ is in the language, but $yz$ is not.

    • Therefore, all the different strings in $F$ are distinguishable as prefixes. Since the language has infinitely many distinguishable prefixes, it cannot be regular.





    share|cite|improve this answer









    $endgroup$












    • $begingroup$
      Thank you very much! That finite part wasn't mentioned in my lecture notes unfortunately.
      $endgroup$
      – Shukie
      Apr 7 at 8:56










    • $begingroup$
      @Shukie It's an unfortunate fact that many lecturers gloss over the "fine print" in the proofs. Often that works just fine, and then you run into one of the cases like this where the fine print matters! (In other words, it's a good question to ask!)
      $endgroup$
      – Draconis
      Apr 7 at 16:11













    1












    1








    1





    $begingroup$

    You're on the right track! There's just one thing you're missing.



    The "build all the strings and union them together" approach works great—if you have a finite number of strings. There's a theorem that says "a union of finitely many regular languages is regular", but the key is the finitely many.



    In this case, there are infinitely many strings in the language, so the union-them-all trick no longer works.



    If you want to prove that the language is not regular (as opposed to just failing to prove that it is regular), try a fooling set proof:



    • Let $F$ be the language $1^*$. It's clearly infinite.

    • Let $x$ and $y$ be two distinct strings in $F$. These can be written as $1^i$ and $1^j$ with $i neq j$.

    • Now, let $z$ be $0^i$. From the definition of your language, we can see that $xz$ is in the language, but $yz$ is not.

    • Therefore, all the different strings in $F$ are distinguishable as prefixes. Since the language has infinitely many distinguishable prefixes, it cannot be regular.





    share|cite|improve this answer









    $endgroup$



    You're on the right track! There's just one thing you're missing.



    The "build all the strings and union them together" approach works great—if you have a finite number of strings. There's a theorem that says "a union of finitely many regular languages is regular", but the key is the finitely many.



    In this case, there are infinitely many strings in the language, so the union-them-all trick no longer works.



    If you want to prove that the language is not regular (as opposed to just failing to prove that it is regular), try a fooling set proof:



    • Let $F$ be the language $1^*$. It's clearly infinite.

    • Let $x$ and $y$ be two distinct strings in $F$. These can be written as $1^i$ and $1^j$ with $i neq j$.

    • Now, let $z$ be $0^i$. From the definition of your language, we can see that $xz$ is in the language, but $yz$ is not.

    • Therefore, all the different strings in $F$ are distinguishable as prefixes. Since the language has infinitely many distinguishable prefixes, it cannot be regular.






    share|cite|improve this answer












    share|cite|improve this answer



    share|cite|improve this answer










    answered Apr 6 at 16:17









    DraconisDraconis

    5,762921




    5,762921











    • $begingroup$
      Thank you very much! That finite part wasn't mentioned in my lecture notes unfortunately.
      $endgroup$
      – Shukie
      Apr 7 at 8:56










    • $begingroup$
      @Shukie It's an unfortunate fact that many lecturers gloss over the "fine print" in the proofs. Often that works just fine, and then you run into one of the cases like this where the fine print matters! (In other words, it's a good question to ask!)
      $endgroup$
      – Draconis
      Apr 7 at 16:11
















    • $begingroup$
      Thank you very much! That finite part wasn't mentioned in my lecture notes unfortunately.
      $endgroup$
      – Shukie
      Apr 7 at 8:56










    • $begingroup$
      @Shukie It's an unfortunate fact that many lecturers gloss over the "fine print" in the proofs. Often that works just fine, and then you run into one of the cases like this where the fine print matters! (In other words, it's a good question to ask!)
      $endgroup$
      – Draconis
      Apr 7 at 16:11















    $begingroup$
    Thank you very much! That finite part wasn't mentioned in my lecture notes unfortunately.
    $endgroup$
    – Shukie
    Apr 7 at 8:56




    $begingroup$
    Thank you very much! That finite part wasn't mentioned in my lecture notes unfortunately.
    $endgroup$
    – Shukie
    Apr 7 at 8:56












    $begingroup$
    @Shukie It's an unfortunate fact that many lecturers gloss over the "fine print" in the proofs. Often that works just fine, and then you run into one of the cases like this where the fine print matters! (In other words, it's a good question to ask!)
    $endgroup$
    – Draconis
    Apr 7 at 16:11




    $begingroup$
    @Shukie It's an unfortunate fact that many lecturers gloss over the "fine print" in the proofs. Often that works just fine, and then you run into one of the cases like this where the fine print matters! (In other words, it's a good question to ask!)
    $endgroup$
    – Draconis
    Apr 7 at 16:11











    1












    $begingroup$

    After you process n zeroes, the set of following strings leading to an accept state are all those with n 1’s more than 0’s. All these sets are different. And each set is roughly the same as a state in a state machine - so you can’t have a state machine with finite number of states.






    share|cite|improve this answer









    $endgroup$

















      1












      $begingroup$

      After you process n zeroes, the set of following strings leading to an accept state are all those with n 1’s more than 0’s. All these sets are different. And each set is roughly the same as a state in a state machine - so you can’t have a state machine with finite number of states.






      share|cite|improve this answer









      $endgroup$















        1












        1








        1





        $begingroup$

        After you process n zeroes, the set of following strings leading to an accept state are all those with n 1’s more than 0’s. All these sets are different. And each set is roughly the same as a state in a state machine - so you can’t have a state machine with finite number of states.






        share|cite|improve this answer









        $endgroup$



        After you process n zeroes, the set of following strings leading to an accept state are all those with n 1’s more than 0’s. All these sets are different. And each set is roughly the same as a state in a state machine - so you can’t have a state machine with finite number of states.







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Apr 7 at 11:22









        gnasher729gnasher729

        11.8k1218




        11.8k1218




















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









            draft saved

            draft discarded


















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












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











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




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcs.stackexchange.com%2fquestions%2f106556%2fwhy-is-this-basic-language-not-a-regular-language%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 does it mean to find percent difference when two values are equivalent? The 2019 Stack Overflow Developer Survey Results Are InWhat does “percent of change” mean?Find what percent X is between two numbers?Unable to determine 'original amount' in simple percentage problemsWhat is the correct percent difference formula?How does proportionality hold when quantities are high? And the percentage increase formulaprofit and loss GRE questionProfitability calculationWhat is the difference between $xtimes 0.8$ and $x div 1.2 ? $Finding the percent probability of completing BUDs trainingCalculating Percent Difference with zero and near zero values

            Why did some early computer designers eschew integers?What register size did early computers use?What other computers used this floating-point format?Why did so many early microcomputers use the MOS 6502 and variants?Why were early computers named “Mark”?Why did expert systems fall?Why were early personal computer monitors not green?When did “Zen” in computer programming become a thing?History of advanced hardwareWere there any working computers using residue number systems?Why did some CPUs use two Read/Write lines, and others just one?

            How to avoid repetitive long generic constraints in Rust The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceIs it possible to automatically implement a trait for any tuple that is made up of types that all implement the trait?Is there a constraint that restricts my generic method to numeric types?How can foreign key constraints be temporarily disabled using T-SQL?How do I use reflection to call a generic method?How to create a generic array in Java?How to get a class instance of generics type THow is `last` allowed to be called for an Args value?How to implement a trait for a parameterized traitAvoiding PhantomData in a struct to enforce type constraintsIs it possible to return part of a struct by reference?Associated References types as Value Types