Bijection between ${0,1}^*$ and the natural numbers.












3












$begingroup$


So the tasks is to show that ${0,1}^*$ is countable.



So the idea that i am having is that each number can be mapped to it's own in decimal.



$f(1001)= 9$



$f(101)=5$



But what happens with all the string which start with zeros.



For example: $f(01001)=$? $f(001001)=$? $f(00000000001001)=$?.



Is my idea completely wrong? Any tips?










share|cite|improve this question











$endgroup$








  • 1




    $begingroup$
    What exactly is ${0,1}^{*}$ ?
    $endgroup$
    – Peter Melech
    Dec 29 '18 at 14:14












  • $begingroup$
    The set of all strings with the symbols 0 and 1
    $endgroup$
    – Angeld55
    Dec 29 '18 at 14:16






  • 2




    $begingroup$
    en.wikipedia.org/wiki/Bijective_numeration
    $endgroup$
    – r.e.s.
    Dec 29 '18 at 14:17
















3












$begingroup$


So the tasks is to show that ${0,1}^*$ is countable.



So the idea that i am having is that each number can be mapped to it's own in decimal.



$f(1001)= 9$



$f(101)=5$



But what happens with all the string which start with zeros.



For example: $f(01001)=$? $f(001001)=$? $f(00000000001001)=$?.



Is my idea completely wrong? Any tips?










share|cite|improve this question











$endgroup$








  • 1




    $begingroup$
    What exactly is ${0,1}^{*}$ ?
    $endgroup$
    – Peter Melech
    Dec 29 '18 at 14:14












  • $begingroup$
    The set of all strings with the symbols 0 and 1
    $endgroup$
    – Angeld55
    Dec 29 '18 at 14:16






  • 2




    $begingroup$
    en.wikipedia.org/wiki/Bijective_numeration
    $endgroup$
    – r.e.s.
    Dec 29 '18 at 14:17














3












3








3





$begingroup$


So the tasks is to show that ${0,1}^*$ is countable.



So the idea that i am having is that each number can be mapped to it's own in decimal.



$f(1001)= 9$



$f(101)=5$



But what happens with all the string which start with zeros.



For example: $f(01001)=$? $f(001001)=$? $f(00000000001001)=$?.



Is my idea completely wrong? Any tips?










share|cite|improve this question











$endgroup$




So the tasks is to show that ${0,1}^*$ is countable.



So the idea that i am having is that each number can be mapped to it's own in decimal.



$f(1001)= 9$



$f(101)=5$



But what happens with all the string which start with zeros.



For example: $f(01001)=$? $f(001001)=$? $f(00000000001001)=$?.



Is my idea completely wrong? Any tips?







elementary-set-theory formal-languages natural-numbers






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Dec 29 '18 at 14:15







Angeld55

















asked Dec 29 '18 at 14:11









Angeld55Angeld55

565




565








  • 1




    $begingroup$
    What exactly is ${0,1}^{*}$ ?
    $endgroup$
    – Peter Melech
    Dec 29 '18 at 14:14












  • $begingroup$
    The set of all strings with the symbols 0 and 1
    $endgroup$
    – Angeld55
    Dec 29 '18 at 14:16






  • 2




    $begingroup$
    en.wikipedia.org/wiki/Bijective_numeration
    $endgroup$
    – r.e.s.
    Dec 29 '18 at 14:17














  • 1




    $begingroup$
    What exactly is ${0,1}^{*}$ ?
    $endgroup$
    – Peter Melech
    Dec 29 '18 at 14:14












  • $begingroup$
    The set of all strings with the symbols 0 and 1
    $endgroup$
    – Angeld55
    Dec 29 '18 at 14:16






  • 2




    $begingroup$
    en.wikipedia.org/wiki/Bijective_numeration
    $endgroup$
    – r.e.s.
    Dec 29 '18 at 14:17








1




1




$begingroup$
What exactly is ${0,1}^{*}$ ?
$endgroup$
– Peter Melech
Dec 29 '18 at 14:14






$begingroup$
What exactly is ${0,1}^{*}$ ?
$endgroup$
– Peter Melech
Dec 29 '18 at 14:14














$begingroup$
The set of all strings with the symbols 0 and 1
$endgroup$
– Angeld55
Dec 29 '18 at 14:16




$begingroup$
The set of all strings with the symbols 0 and 1
$endgroup$
– Angeld55
Dec 29 '18 at 14:16




2




2




$begingroup$
en.wikipedia.org/wiki/Bijective_numeration
$endgroup$
– r.e.s.
Dec 29 '18 at 14:17




$begingroup$
en.wikipedia.org/wiki/Bijective_numeration
$endgroup$
– r.e.s.
Dec 29 '18 at 14:17










2 Answers
2






active

oldest

votes


















5












$begingroup$

Hint: Consider the map ${0,1}^* to mathbb N$ given by $w mapsto (1w)_2$.



This assumes that $0 notin mathbb N$. If $0 in mathbb N$, use $w mapsto (1w)_2-1$.






share|cite|improve this answer









$endgroup$





















    0












    $begingroup$

    You can do this trick. Instead of sending each sequence in ${0,1}^star$ to it's decimal try to first add the digit $1$ at the beginning and then send it to it's decimal (i.e. if you begin with 01 you change it to 101 which is 5 in decimal). That's how you will overcome the zeros problem.






    share|cite|improve this answer









    $endgroup$














      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "69"
      };
      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: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      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
      },
      noCode: true, onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3055881%2fbijection-between-0-1-and-the-natural-numbers%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      5












      $begingroup$

      Hint: Consider the map ${0,1}^* to mathbb N$ given by $w mapsto (1w)_2$.



      This assumes that $0 notin mathbb N$. If $0 in mathbb N$, use $w mapsto (1w)_2-1$.






      share|cite|improve this answer









      $endgroup$


















        5












        $begingroup$

        Hint: Consider the map ${0,1}^* to mathbb N$ given by $w mapsto (1w)_2$.



        This assumes that $0 notin mathbb N$. If $0 in mathbb N$, use $w mapsto (1w)_2-1$.






        share|cite|improve this answer









        $endgroup$
















          5












          5








          5





          $begingroup$

          Hint: Consider the map ${0,1}^* to mathbb N$ given by $w mapsto (1w)_2$.



          This assumes that $0 notin mathbb N$. If $0 in mathbb N$, use $w mapsto (1w)_2-1$.






          share|cite|improve this answer









          $endgroup$



          Hint: Consider the map ${0,1}^* to mathbb N$ given by $w mapsto (1w)_2$.



          This assumes that $0 notin mathbb N$. If $0 in mathbb N$, use $w mapsto (1w)_2-1$.







          share|cite|improve this answer












          share|cite|improve this answer



          share|cite|improve this answer










          answered Dec 29 '18 at 14:17









          lhflhf

          168k11172404




          168k11172404























              0












              $begingroup$

              You can do this trick. Instead of sending each sequence in ${0,1}^star$ to it's decimal try to first add the digit $1$ at the beginning and then send it to it's decimal (i.e. if you begin with 01 you change it to 101 which is 5 in decimal). That's how you will overcome the zeros problem.






              share|cite|improve this answer









              $endgroup$


















                0












                $begingroup$

                You can do this trick. Instead of sending each sequence in ${0,1}^star$ to it's decimal try to first add the digit $1$ at the beginning and then send it to it's decimal (i.e. if you begin with 01 you change it to 101 which is 5 in decimal). That's how you will overcome the zeros problem.






                share|cite|improve this answer









                $endgroup$
















                  0












                  0








                  0





                  $begingroup$

                  You can do this trick. Instead of sending each sequence in ${0,1}^star$ to it's decimal try to first add the digit $1$ at the beginning and then send it to it's decimal (i.e. if you begin with 01 you change it to 101 which is 5 in decimal). That's how you will overcome the zeros problem.






                  share|cite|improve this answer









                  $endgroup$



                  You can do this trick. Instead of sending each sequence in ${0,1}^star$ to it's decimal try to first add the digit $1$ at the beginning and then send it to it's decimal (i.e. if you begin with 01 you change it to 101 which is 5 in decimal). That's how you will overcome the zeros problem.







                  share|cite|improve this answer












                  share|cite|improve this answer



                  share|cite|improve this answer










                  answered Dec 29 '18 at 14:48









                  YankoYanko

                  8,4692830




                  8,4692830






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Mathematics 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%2fmath.stackexchange.com%2fquestions%2f3055881%2fbijection-between-0-1-and-the-natural-numbers%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

                      Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

                      ComboBox Display Member on multiple fields

                      Is it possible to collect Nectar points via Trainline?