Cardinality of the set of algorithms










15












$begingroup$


Someone in a discussion brought up that (he reckons) there can be at least continuum number of strategies to approach a specific problem. The specific problem was trading strategies (not algorithms but strategies) but I think thats beside the point for my question.



This got me thinking about the cardinality of the set of algorithms. I have been searching around a bit but have come up with nothing. I've been thinking that, since turing machines operate with a finite set of alphabet and the tape has to be indexable thus countable, it's impossible to have uncountable number of algorithms. My set theory is admittedly rusty so I am not certain at all my reasoning is valid and I probably wouldn't be able to prove it, but it's an interesting thought.



What is the cardinality of the set of algorithms?










share|cite|improve this question











$endgroup$







  • 1




    $begingroup$
    As Yuval Filmus mentioned, there are countably many Turing machines. But there are continuum many non-uniform families of boolean circuits, as they can compute any boolean-valued function. But that's probably not what you meant by "algorithm".
    $endgroup$
    – Solomonoff's Secret
    Aug 27 '18 at 17:40















15












$begingroup$


Someone in a discussion brought up that (he reckons) there can be at least continuum number of strategies to approach a specific problem. The specific problem was trading strategies (not algorithms but strategies) but I think thats beside the point for my question.



This got me thinking about the cardinality of the set of algorithms. I have been searching around a bit but have come up with nothing. I've been thinking that, since turing machines operate with a finite set of alphabet and the tape has to be indexable thus countable, it's impossible to have uncountable number of algorithms. My set theory is admittedly rusty so I am not certain at all my reasoning is valid and I probably wouldn't be able to prove it, but it's an interesting thought.



What is the cardinality of the set of algorithms?










share|cite|improve this question











$endgroup$







  • 1




    $begingroup$
    As Yuval Filmus mentioned, there are countably many Turing machines. But there are continuum many non-uniform families of boolean circuits, as they can compute any boolean-valued function. But that's probably not what you meant by "algorithm".
    $endgroup$
    – Solomonoff's Secret
    Aug 27 '18 at 17:40













15












15








15


3



$begingroup$


Someone in a discussion brought up that (he reckons) there can be at least continuum number of strategies to approach a specific problem. The specific problem was trading strategies (not algorithms but strategies) but I think thats beside the point for my question.



This got me thinking about the cardinality of the set of algorithms. I have been searching around a bit but have come up with nothing. I've been thinking that, since turing machines operate with a finite set of alphabet and the tape has to be indexable thus countable, it's impossible to have uncountable number of algorithms. My set theory is admittedly rusty so I am not certain at all my reasoning is valid and I probably wouldn't be able to prove it, but it's an interesting thought.



What is the cardinality of the set of algorithms?










share|cite|improve this question











$endgroup$




Someone in a discussion brought up that (he reckons) there can be at least continuum number of strategies to approach a specific problem. The specific problem was trading strategies (not algorithms but strategies) but I think thats beside the point for my question.



This got me thinking about the cardinality of the set of algorithms. I have been searching around a bit but have come up with nothing. I've been thinking that, since turing machines operate with a finite set of alphabet and the tape has to be indexable thus countable, it's impossible to have uncountable number of algorithms. My set theory is admittedly rusty so I am not certain at all my reasoning is valid and I probably wouldn't be able to prove it, but it's an interesting thought.



What is the cardinality of the set of algorithms?







algorithms turing-machines combinatorics






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Aug 28 '18 at 13:59









Raphael

57.8k24142317




57.8k24142317










asked Aug 27 '18 at 16:04









qwe2qwe2

1785




1785







  • 1




    $begingroup$
    As Yuval Filmus mentioned, there are countably many Turing machines. But there are continuum many non-uniform families of boolean circuits, as they can compute any boolean-valued function. But that's probably not what you meant by "algorithm".
    $endgroup$
    – Solomonoff's Secret
    Aug 27 '18 at 17:40












  • 1




    $begingroup$
    As Yuval Filmus mentioned, there are countably many Turing machines. But there are continuum many non-uniform families of boolean circuits, as they can compute any boolean-valued function. But that's probably not what you meant by "algorithm".
    $endgroup$
    – Solomonoff's Secret
    Aug 27 '18 at 17:40







1




1




$begingroup$
As Yuval Filmus mentioned, there are countably many Turing machines. But there are continuum many non-uniform families of boolean circuits, as they can compute any boolean-valued function. But that's probably not what you meant by "algorithm".
$endgroup$
– Solomonoff's Secret
Aug 27 '18 at 17:40




$begingroup$
As Yuval Filmus mentioned, there are countably many Turing machines. But there are continuum many non-uniform families of boolean circuits, as they can compute any boolean-valued function. But that's probably not what you meant by "algorithm".
$endgroup$
– Solomonoff's Secret
Aug 27 '18 at 17:40










8 Answers
8






active

oldest

votes


















27












$begingroup$

An algorithm is informally described as a finite sequence of written instructions for accomplishing some task. More formally, they're identified as Turing machines, though you could equally well describe them as computer programs.



The precise formalism you use doesn't much matter but the fundamental point is that each algorithm can be written down as a finite sequence of characters, where the characters are chosen from some finite set, e.g., roman letters, ASCII or zeroes and ones. For simplicity, let's assume zeroes and ones. Any sequence of zeroes and ones is just a natural number written in binary. That means there are at most a countable infinity of algorithms, since every algorithm can be represented as a natural number.



For full credit, you should be worried that some natural numbers might not code valid programs, so there might be fewer algorithms than natural numbers. (For bonus credit, you might also be wondering if it's possible that two different natural numbers represent the same algorithm.) However, print 1, print 2, print 3 and so on are all algorithms and all different, so there are at least countably infinitely many algorithms.



So we conclude that the set of algorithms is countably infinite.






share|cite|improve this answer











$endgroup$












  • $begingroup$
    Comments are not for extended discussion; this conversation has been moved to chat.
    $endgroup$
    – Gilles
    Aug 28 '18 at 21:19


















10












$begingroup$

The set of algorithms is countably infinite. This is because each algorithm has a finite description, say as a Turing machine.



The fact that an algorithm has finite description allows us to input one algorithm into another, and this is the basis of computability theory. It allows us to formulate the halting problem, for example.






share|cite|improve this answer









$endgroup$




















    7












    $begingroup$


    at least continuum number of strategies to approach a specific problem




    "Continuum" is probably supposed to mean the real numbers... using "at least" together with that word is absurdly over the top. To be a bit tongue-in-mouth: countably infinite is pretty large, but uncountably infinite is... larger than large. Hugely more so. Unfathomably.



    So let's throw that out of the window. To see what kind of infinity we are dealing with is dead simple (and intuitive, even if your friend has never heard of any theoretical computer science):



    • Any algorithm can be implemented with any turing-complete language; pick your favourite poison of real-world languages (Java, C, ...) to de-mystify this a bit. All of these are equivalent with the theoretical set of algorithms anyone could ever come up with. Note that every algorithm is in itself finite, i.e., there are no algorithms which would take infinitely many symbols to write down.

    • Don't think about complicated Turing Machines. Your language of choice uses simple files to store its source code. Every file is a collection of little numbers (a.k.a., bytes). The important thing is that these numbers are most definitely integer, not continuous. (If you are a purist and want to stay in the theoretical regime, replace the word "byte" with "symbol", it doesn't change anything.) If you are afraid about large programs that are distributed across multiple files (and libraries, and other stuff), then just zip them up into a single compressed archive (i.e., a single file).

    • Now, you can assign a single integer number to every file out there, bijectively. We simply write the whole mess of bits/bytes of the file one after another, and end up with a very huge number expressed in binary. In the distant past, people actually did that: they printed compiled binary programms as long lists of hex numbers in magazines; you would type them in, but never see them as anything than numbers (often grouped conveniently in 8- or 16-digit sets to make the typing easier).

    • So: every program can be represented by an integer number, albeit an arbitrarily large one. The other way round works as well - every integer can immediately and trivially be transferred into a file and thrown at a compiler (obviously, only a small part of those will be valid programs, but that does not matter to us now).

    • In the end, programs, and thus algorithms, are a subset of the integers; hence, only countably many can exist.

    • N.B., the fact that there are many different implementations of a single algorithm is in our favour, that is, many of those integers condense into (different representations of) the same algorithm. So if the countable infinity was not the smallest kind of infinity already, we would have to worry about the number of algorithms being even smaller, but certainly not larger (i.e., uncountable).


    The specific problem was trading strategies (not algorithms but strategies)




    I don't know what your friend means with "strategy"; I assume he means something which is kind of like an algorithm, but not quite formulated in enough detail to hack it into a computer? Or which somehow depends on human "intuition" during execution? If so, then these are just irrelevant details. Humanity has not yet found any kind of description of processes that is more powerful or larger than "algorithms" in the sense that we use in CS.






    share|cite|improve this answer











    $endgroup$








    • 3




      $begingroup$
      Re: "'Continuum' is probably supposed to mean the real numbers... using 'at least' together with that word is absurdly over the top": There is nothing "over the top" about it, let alone "absurdly" so. There are more sets of real numbers than there are real numbers, so it's quite normal to talk about sets that are larger than the continuum.
      $endgroup$
      – ruakh
      Aug 28 '18 at 18:49


















    6












    $begingroup$

    See Gödel Numbering, it is a basic fact in computer science that algorithms are countable, as are by extension recursively enumerable sets.



    Algorithms being countable, it is easy to show that there doesn't exist an algorithm to verify every set in a formal system (assign a truth value to a problem). This would be equivalent to assigning an algorithm to every function mapping the set of problems to boolean values. The set of these functions is however uncountable (trivially of same cardinality as the power set of the set of problems, therefore uncountable).



    I hope this gives some intuition as to why algorithms have to be "less powerful" than just any function, an thus countable (let's ignore the continuum hypothesis here).






    share|cite|improve this answer











    $endgroup$




















      2












      $begingroup$

      If one does not start out with the requirement that a strategy needs to be implementable with an algorithm, and ignores real-life discretization effects, one could for example accept the following as a parameterized trading strategy:



      Take two real number parameters $a$, $b$. Buy if the price of the commodity falls below $a$, sell if it rises above $b$.



      Of such strategies, there are clearly continuumsly many. However, of those only countably many can be implemented by an algorithm. The reason is that if $a$ is not lower-computable and $b$ is not upper-computable, then we cannot detect that the conditions are true.






      share|cite|improve this answer









      $endgroup$




















        0












        $begingroup$

        If we conceive of algorithms as computer programs written in binary*, then the number of algorithms is the number of (integer) binary numbers. Thus the cardinality of algorithms is the cardinality of the integers.



        *A proof that turing machines can run all algorithms, and that computers can run any program turing machines, would make this answer unnecessarily long. The former may depend on the definition of an algorithm, but I don't think you're using uncomputable trading strategies.






        share|cite|improve this answer









        $endgroup$








        • 1




          $begingroup$
          What does this add to the existing answers?
          $endgroup$
          – David Richerby
          Aug 28 '18 at 10:44










        • $begingroup$
          "A proof that turing machines can run all algorithms ... would make this answer unnecessarily long". It would make the answer impossible, since you can't really prove the Church-Turing Thesis
          $endgroup$
          – John Coleman
          Aug 29 '18 at 14:41










        • $begingroup$
          @DavidRicherby It adds brevity.
          $endgroup$
          – user558317
          Aug 30 '18 at 21:20







        • 1




          $begingroup$
          @JohnColeman Asserting the impossibility of a proof, without a proof? I meant that a) the OP probably wouldn't care, since b) it's a matter of definition. The question seems to contain the assumption: "since turing machines operate with a finite set of alphabet and the tape has to be indexable thus countable, it's impossible to have uncountable number of algorithms."
          $endgroup$
          – user558317
          Aug 30 '18 at 21:30


















        0












        $begingroup$

        The other answers have already explained that in the standard model of computation (Turing machines, lambda calculus, etc.) the set of algorithms is countably infinite.



        However, there are other theoretical models of computation in which the set of algorithms is uncountably infinite. For example, Blum–Shub–Smale machines have an uncountably infinite instruction set1, so their set of algorithms also is uncountably infinite.





        1 To be precise, the instruction set itself is finite, but it is parameterized using an uncountably infinite set (the rational functions).




        share|cite|improve this answer









        $endgroup$












        • $begingroup$
          Aren't the rational functions countable?
          $endgroup$
          – Ben Millwood
          Aug 28 '18 at 15:10










        • $begingroup$
          @BenMillwood Can you briefly sketch a proof of why this might be the case?
          $endgroup$
          – Mark C
          Aug 29 '18 at 7:41










        • $begingroup$
          @BenMillwood For each $x_0 in mathbbR$, the constant function $f: x mapsto x_0$ is a rational function.
          $endgroup$
          – Florian Brucker
          Aug 29 '18 at 14:55











        • $begingroup$
          Oh, I was assuming the constants also had to be rational. Never mind then.
          $endgroup$
          – Ben Millwood
          Sep 5 '18 at 14:40


















        -1












        $begingroup$


        since turing machines operate with a finite set of alphabet and the tape has to be indexable thus countable




        Given a particular size, there are finitely many Turing machines, and there are countably many sizes. A countable set of numbers, as long which are finite, is countable. The size of the alphabet is a factor in the number of Turing machines, but the size of the tape isn't. If the alphabet were allowed to have countably many characters, then there would be uncountably many machines (each real number could be encoded as a sequence of symbols).



        If "algorithm" you merely mean a correspondence between input and output, and not a Turing machine or otherwise something that is the normal sense of "computation", then clearly if there a countably many different inputs, then there are uncountably many algorithms: for each real number, we could define an "algorithm" that takes a natural number as input, and outputs that decimal place. For instance, giving the input "3" to the $sqrt.5$ algorithm would give the output of "7". (Note that while it is possible to design a Turing machine that gives the nth digit of $sqrt.5$, it is not possible to do so for all real numbers; only countably many real numbers are computable).






        share|cite|improve this answer











        $endgroup$












        • $begingroup$
          I don't understand what you're trying to do, here. The question is about the number of algorithms, and the algorithm is the Turing machine, not the input. Allowing infinitely many non-blank characters on the tape at the start wouldn't affect the number of algorithms and, in any case, any terminating run would only be able to read a finite prefix of the input. Meanwhile, your second paragraph is confusing algorithms with mathematical functions. For all but countably many reals, there is no algorithm that can tell you the $n$th digit in the decimal expansion.
          $endgroup$
          – David Richerby
          Aug 27 '18 at 21:38











        • $begingroup$
          And what would it mean to have uncountably many algorithms, anyway? You can only write down countably many. In what sense is something that you can't write down an algorithm?
          $endgroup$
          – David Richerby
          Aug 27 '18 at 21:39










        • $begingroup$
          @DavidRicherby Yeah, I got a few things mixed up. But one can use "algorithm" in a general sense to refer to a sequence of choices. And in that sense, choosing a digit based on the input is an "algorithm", albeit not a computable one.
          $endgroup$
          – Acccumulation
          Aug 27 '18 at 22:29










        • $begingroup$
          In computer science, "algorithm" and "computable" are the same thing. An algorithm is a Turing machine.
          $endgroup$
          – David Richerby
          Aug 27 '18 at 22:33










        Your Answer





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

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

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

        else
        createEditor();

        );

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



        );













        draft saved

        draft discarded


















        StackExchange.ready(
        function ()
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcs.stackexchange.com%2fquestions%2f96679%2fcardinality-of-the-set-of-algorithms%23new-answer', 'question_page');

        );

        Post as a guest















        Required, but never shown

























        8 Answers
        8






        active

        oldest

        votes








        8 Answers
        8






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        27












        $begingroup$

        An algorithm is informally described as a finite sequence of written instructions for accomplishing some task. More formally, they're identified as Turing machines, though you could equally well describe them as computer programs.



        The precise formalism you use doesn't much matter but the fundamental point is that each algorithm can be written down as a finite sequence of characters, where the characters are chosen from some finite set, e.g., roman letters, ASCII or zeroes and ones. For simplicity, let's assume zeroes and ones. Any sequence of zeroes and ones is just a natural number written in binary. That means there are at most a countable infinity of algorithms, since every algorithm can be represented as a natural number.



        For full credit, you should be worried that some natural numbers might not code valid programs, so there might be fewer algorithms than natural numbers. (For bonus credit, you might also be wondering if it's possible that two different natural numbers represent the same algorithm.) However, print 1, print 2, print 3 and so on are all algorithms and all different, so there are at least countably infinitely many algorithms.



        So we conclude that the set of algorithms is countably infinite.






        share|cite|improve this answer











        $endgroup$












        • $begingroup$
          Comments are not for extended discussion; this conversation has been moved to chat.
          $endgroup$
          – Gilles
          Aug 28 '18 at 21:19















        27












        $begingroup$

        An algorithm is informally described as a finite sequence of written instructions for accomplishing some task. More formally, they're identified as Turing machines, though you could equally well describe them as computer programs.



        The precise formalism you use doesn't much matter but the fundamental point is that each algorithm can be written down as a finite sequence of characters, where the characters are chosen from some finite set, e.g., roman letters, ASCII or zeroes and ones. For simplicity, let's assume zeroes and ones. Any sequence of zeroes and ones is just a natural number written in binary. That means there are at most a countable infinity of algorithms, since every algorithm can be represented as a natural number.



        For full credit, you should be worried that some natural numbers might not code valid programs, so there might be fewer algorithms than natural numbers. (For bonus credit, you might also be wondering if it's possible that two different natural numbers represent the same algorithm.) However, print 1, print 2, print 3 and so on are all algorithms and all different, so there are at least countably infinitely many algorithms.



        So we conclude that the set of algorithms is countably infinite.






        share|cite|improve this answer











        $endgroup$












        • $begingroup$
          Comments are not for extended discussion; this conversation has been moved to chat.
          $endgroup$
          – Gilles
          Aug 28 '18 at 21:19













        27












        27








        27





        $begingroup$

        An algorithm is informally described as a finite sequence of written instructions for accomplishing some task. More formally, they're identified as Turing machines, though you could equally well describe them as computer programs.



        The precise formalism you use doesn't much matter but the fundamental point is that each algorithm can be written down as a finite sequence of characters, where the characters are chosen from some finite set, e.g., roman letters, ASCII or zeroes and ones. For simplicity, let's assume zeroes and ones. Any sequence of zeroes and ones is just a natural number written in binary. That means there are at most a countable infinity of algorithms, since every algorithm can be represented as a natural number.



        For full credit, you should be worried that some natural numbers might not code valid programs, so there might be fewer algorithms than natural numbers. (For bonus credit, you might also be wondering if it's possible that two different natural numbers represent the same algorithm.) However, print 1, print 2, print 3 and so on are all algorithms and all different, so there are at least countably infinitely many algorithms.



        So we conclude that the set of algorithms is countably infinite.






        share|cite|improve this answer











        $endgroup$



        An algorithm is informally described as a finite sequence of written instructions for accomplishing some task. More formally, they're identified as Turing machines, though you could equally well describe them as computer programs.



        The precise formalism you use doesn't much matter but the fundamental point is that each algorithm can be written down as a finite sequence of characters, where the characters are chosen from some finite set, e.g., roman letters, ASCII or zeroes and ones. For simplicity, let's assume zeroes and ones. Any sequence of zeroes and ones is just a natural number written in binary. That means there are at most a countable infinity of algorithms, since every algorithm can be represented as a natural number.



        For full credit, you should be worried that some natural numbers might not code valid programs, so there might be fewer algorithms than natural numbers. (For bonus credit, you might also be wondering if it's possible that two different natural numbers represent the same algorithm.) However, print 1, print 2, print 3 and so on are all algorithms and all different, so there are at least countably infinitely many algorithms.



        So we conclude that the set of algorithms is countably infinite.







        share|cite|improve this answer














        share|cite|improve this answer



        share|cite|improve this answer








        edited Aug 29 '18 at 7:55

























        answered Aug 27 '18 at 18:21









        David RicherbyDavid Richerby

        68.1k15103194




        68.1k15103194











        • $begingroup$
          Comments are not for extended discussion; this conversation has been moved to chat.
          $endgroup$
          – Gilles
          Aug 28 '18 at 21:19
















        • $begingroup$
          Comments are not for extended discussion; this conversation has been moved to chat.
          $endgroup$
          – Gilles
          Aug 28 '18 at 21:19















        $begingroup$
        Comments are not for extended discussion; this conversation has been moved to chat.
        $endgroup$
        – Gilles
        Aug 28 '18 at 21:19




        $begingroup$
        Comments are not for extended discussion; this conversation has been moved to chat.
        $endgroup$
        – Gilles
        Aug 28 '18 at 21:19











        10












        $begingroup$

        The set of algorithms is countably infinite. This is because each algorithm has a finite description, say as a Turing machine.



        The fact that an algorithm has finite description allows us to input one algorithm into another, and this is the basis of computability theory. It allows us to formulate the halting problem, for example.






        share|cite|improve this answer









        $endgroup$

















          10












          $begingroup$

          The set of algorithms is countably infinite. This is because each algorithm has a finite description, say as a Turing machine.



          The fact that an algorithm has finite description allows us to input one algorithm into another, and this is the basis of computability theory. It allows us to formulate the halting problem, for example.






          share|cite|improve this answer









          $endgroup$















            10












            10








            10





            $begingroup$

            The set of algorithms is countably infinite. This is because each algorithm has a finite description, say as a Turing machine.



            The fact that an algorithm has finite description allows us to input one algorithm into another, and this is the basis of computability theory. It allows us to formulate the halting problem, for example.






            share|cite|improve this answer









            $endgroup$



            The set of algorithms is countably infinite. This is because each algorithm has a finite description, say as a Turing machine.



            The fact that an algorithm has finite description allows us to input one algorithm into another, and this is the basis of computability theory. It allows us to formulate the halting problem, for example.







            share|cite|improve this answer












            share|cite|improve this answer



            share|cite|improve this answer










            answered Aug 27 '18 at 16:18









            Yuval FilmusYuval Filmus

            194k14183347




            194k14183347





















                7












                $begingroup$


                at least continuum number of strategies to approach a specific problem




                "Continuum" is probably supposed to mean the real numbers... using "at least" together with that word is absurdly over the top. To be a bit tongue-in-mouth: countably infinite is pretty large, but uncountably infinite is... larger than large. Hugely more so. Unfathomably.



                So let's throw that out of the window. To see what kind of infinity we are dealing with is dead simple (and intuitive, even if your friend has never heard of any theoretical computer science):



                • Any algorithm can be implemented with any turing-complete language; pick your favourite poison of real-world languages (Java, C, ...) to de-mystify this a bit. All of these are equivalent with the theoretical set of algorithms anyone could ever come up with. Note that every algorithm is in itself finite, i.e., there are no algorithms which would take infinitely many symbols to write down.

                • Don't think about complicated Turing Machines. Your language of choice uses simple files to store its source code. Every file is a collection of little numbers (a.k.a., bytes). The important thing is that these numbers are most definitely integer, not continuous. (If you are a purist and want to stay in the theoretical regime, replace the word "byte" with "symbol", it doesn't change anything.) If you are afraid about large programs that are distributed across multiple files (and libraries, and other stuff), then just zip them up into a single compressed archive (i.e., a single file).

                • Now, you can assign a single integer number to every file out there, bijectively. We simply write the whole mess of bits/bytes of the file one after another, and end up with a very huge number expressed in binary. In the distant past, people actually did that: they printed compiled binary programms as long lists of hex numbers in magazines; you would type them in, but never see them as anything than numbers (often grouped conveniently in 8- or 16-digit sets to make the typing easier).

                • So: every program can be represented by an integer number, albeit an arbitrarily large one. The other way round works as well - every integer can immediately and trivially be transferred into a file and thrown at a compiler (obviously, only a small part of those will be valid programs, but that does not matter to us now).

                • In the end, programs, and thus algorithms, are a subset of the integers; hence, only countably many can exist.

                • N.B., the fact that there are many different implementations of a single algorithm is in our favour, that is, many of those integers condense into (different representations of) the same algorithm. So if the countable infinity was not the smallest kind of infinity already, we would have to worry about the number of algorithms being even smaller, but certainly not larger (i.e., uncountable).


                The specific problem was trading strategies (not algorithms but strategies)




                I don't know what your friend means with "strategy"; I assume he means something which is kind of like an algorithm, but not quite formulated in enough detail to hack it into a computer? Or which somehow depends on human "intuition" during execution? If so, then these are just irrelevant details. Humanity has not yet found any kind of description of processes that is more powerful or larger than "algorithms" in the sense that we use in CS.






                share|cite|improve this answer











                $endgroup$








                • 3




                  $begingroup$
                  Re: "'Continuum' is probably supposed to mean the real numbers... using 'at least' together with that word is absurdly over the top": There is nothing "over the top" about it, let alone "absurdly" so. There are more sets of real numbers than there are real numbers, so it's quite normal to talk about sets that are larger than the continuum.
                  $endgroup$
                  – ruakh
                  Aug 28 '18 at 18:49















                7












                $begingroup$


                at least continuum number of strategies to approach a specific problem




                "Continuum" is probably supposed to mean the real numbers... using "at least" together with that word is absurdly over the top. To be a bit tongue-in-mouth: countably infinite is pretty large, but uncountably infinite is... larger than large. Hugely more so. Unfathomably.



                So let's throw that out of the window. To see what kind of infinity we are dealing with is dead simple (and intuitive, even if your friend has never heard of any theoretical computer science):



                • Any algorithm can be implemented with any turing-complete language; pick your favourite poison of real-world languages (Java, C, ...) to de-mystify this a bit. All of these are equivalent with the theoretical set of algorithms anyone could ever come up with. Note that every algorithm is in itself finite, i.e., there are no algorithms which would take infinitely many symbols to write down.

                • Don't think about complicated Turing Machines. Your language of choice uses simple files to store its source code. Every file is a collection of little numbers (a.k.a., bytes). The important thing is that these numbers are most definitely integer, not continuous. (If you are a purist and want to stay in the theoretical regime, replace the word "byte" with "symbol", it doesn't change anything.) If you are afraid about large programs that are distributed across multiple files (and libraries, and other stuff), then just zip them up into a single compressed archive (i.e., a single file).

                • Now, you can assign a single integer number to every file out there, bijectively. We simply write the whole mess of bits/bytes of the file one after another, and end up with a very huge number expressed in binary. In the distant past, people actually did that: they printed compiled binary programms as long lists of hex numbers in magazines; you would type them in, but never see them as anything than numbers (often grouped conveniently in 8- or 16-digit sets to make the typing easier).

                • So: every program can be represented by an integer number, albeit an arbitrarily large one. The other way round works as well - every integer can immediately and trivially be transferred into a file and thrown at a compiler (obviously, only a small part of those will be valid programs, but that does not matter to us now).

                • In the end, programs, and thus algorithms, are a subset of the integers; hence, only countably many can exist.

                • N.B., the fact that there are many different implementations of a single algorithm is in our favour, that is, many of those integers condense into (different representations of) the same algorithm. So if the countable infinity was not the smallest kind of infinity already, we would have to worry about the number of algorithms being even smaller, but certainly not larger (i.e., uncountable).


                The specific problem was trading strategies (not algorithms but strategies)




                I don't know what your friend means with "strategy"; I assume he means something which is kind of like an algorithm, but not quite formulated in enough detail to hack it into a computer? Or which somehow depends on human "intuition" during execution? If so, then these are just irrelevant details. Humanity has not yet found any kind of description of processes that is more powerful or larger than "algorithms" in the sense that we use in CS.






                share|cite|improve this answer











                $endgroup$








                • 3




                  $begingroup$
                  Re: "'Continuum' is probably supposed to mean the real numbers... using 'at least' together with that word is absurdly over the top": There is nothing "over the top" about it, let alone "absurdly" so. There are more sets of real numbers than there are real numbers, so it's quite normal to talk about sets that are larger than the continuum.
                  $endgroup$
                  – ruakh
                  Aug 28 '18 at 18:49













                7












                7








                7





                $begingroup$


                at least continuum number of strategies to approach a specific problem




                "Continuum" is probably supposed to mean the real numbers... using "at least" together with that word is absurdly over the top. To be a bit tongue-in-mouth: countably infinite is pretty large, but uncountably infinite is... larger than large. Hugely more so. Unfathomably.



                So let's throw that out of the window. To see what kind of infinity we are dealing with is dead simple (and intuitive, even if your friend has never heard of any theoretical computer science):



                • Any algorithm can be implemented with any turing-complete language; pick your favourite poison of real-world languages (Java, C, ...) to de-mystify this a bit. All of these are equivalent with the theoretical set of algorithms anyone could ever come up with. Note that every algorithm is in itself finite, i.e., there are no algorithms which would take infinitely many symbols to write down.

                • Don't think about complicated Turing Machines. Your language of choice uses simple files to store its source code. Every file is a collection of little numbers (a.k.a., bytes). The important thing is that these numbers are most definitely integer, not continuous. (If you are a purist and want to stay in the theoretical regime, replace the word "byte" with "symbol", it doesn't change anything.) If you are afraid about large programs that are distributed across multiple files (and libraries, and other stuff), then just zip them up into a single compressed archive (i.e., a single file).

                • Now, you can assign a single integer number to every file out there, bijectively. We simply write the whole mess of bits/bytes of the file one after another, and end up with a very huge number expressed in binary. In the distant past, people actually did that: they printed compiled binary programms as long lists of hex numbers in magazines; you would type them in, but never see them as anything than numbers (often grouped conveniently in 8- or 16-digit sets to make the typing easier).

                • So: every program can be represented by an integer number, albeit an arbitrarily large one. The other way round works as well - every integer can immediately and trivially be transferred into a file and thrown at a compiler (obviously, only a small part of those will be valid programs, but that does not matter to us now).

                • In the end, programs, and thus algorithms, are a subset of the integers; hence, only countably many can exist.

                • N.B., the fact that there are many different implementations of a single algorithm is in our favour, that is, many of those integers condense into (different representations of) the same algorithm. So if the countable infinity was not the smallest kind of infinity already, we would have to worry about the number of algorithms being even smaller, but certainly not larger (i.e., uncountable).


                The specific problem was trading strategies (not algorithms but strategies)




                I don't know what your friend means with "strategy"; I assume he means something which is kind of like an algorithm, but not quite formulated in enough detail to hack it into a computer? Or which somehow depends on human "intuition" during execution? If so, then these are just irrelevant details. Humanity has not yet found any kind of description of processes that is more powerful or larger than "algorithms" in the sense that we use in CS.






                share|cite|improve this answer











                $endgroup$




                at least continuum number of strategies to approach a specific problem




                "Continuum" is probably supposed to mean the real numbers... using "at least" together with that word is absurdly over the top. To be a bit tongue-in-mouth: countably infinite is pretty large, but uncountably infinite is... larger than large. Hugely more so. Unfathomably.



                So let's throw that out of the window. To see what kind of infinity we are dealing with is dead simple (and intuitive, even if your friend has never heard of any theoretical computer science):



                • Any algorithm can be implemented with any turing-complete language; pick your favourite poison of real-world languages (Java, C, ...) to de-mystify this a bit. All of these are equivalent with the theoretical set of algorithms anyone could ever come up with. Note that every algorithm is in itself finite, i.e., there are no algorithms which would take infinitely many symbols to write down.

                • Don't think about complicated Turing Machines. Your language of choice uses simple files to store its source code. Every file is a collection of little numbers (a.k.a., bytes). The important thing is that these numbers are most definitely integer, not continuous. (If you are a purist and want to stay in the theoretical regime, replace the word "byte" with "symbol", it doesn't change anything.) If you are afraid about large programs that are distributed across multiple files (and libraries, and other stuff), then just zip them up into a single compressed archive (i.e., a single file).

                • Now, you can assign a single integer number to every file out there, bijectively. We simply write the whole mess of bits/bytes of the file one after another, and end up with a very huge number expressed in binary. In the distant past, people actually did that: they printed compiled binary programms as long lists of hex numbers in magazines; you would type them in, but never see them as anything than numbers (often grouped conveniently in 8- or 16-digit sets to make the typing easier).

                • So: every program can be represented by an integer number, albeit an arbitrarily large one. The other way round works as well - every integer can immediately and trivially be transferred into a file and thrown at a compiler (obviously, only a small part of those will be valid programs, but that does not matter to us now).

                • In the end, programs, and thus algorithms, are a subset of the integers; hence, only countably many can exist.

                • N.B., the fact that there are many different implementations of a single algorithm is in our favour, that is, many of those integers condense into (different representations of) the same algorithm. So if the countable infinity was not the smallest kind of infinity already, we would have to worry about the number of algorithms being even smaller, but certainly not larger (i.e., uncountable).


                The specific problem was trading strategies (not algorithms but strategies)




                I don't know what your friend means with "strategy"; I assume he means something which is kind of like an algorithm, but not quite formulated in enough detail to hack it into a computer? Or which somehow depends on human "intuition" during execution? If so, then these are just irrelevant details. Humanity has not yet found any kind of description of processes that is more powerful or larger than "algorithms" in the sense that we use in CS.







                share|cite|improve this answer














                share|cite|improve this answer



                share|cite|improve this answer








                edited Aug 28 '18 at 9:04

























                answered Aug 27 '18 at 20:26









                AnoEAnoE

                1,02849




                1,02849







                • 3




                  $begingroup$
                  Re: "'Continuum' is probably supposed to mean the real numbers... using 'at least' together with that word is absurdly over the top": There is nothing "over the top" about it, let alone "absurdly" so. There are more sets of real numbers than there are real numbers, so it's quite normal to talk about sets that are larger than the continuum.
                  $endgroup$
                  – ruakh
                  Aug 28 '18 at 18:49












                • 3




                  $begingroup$
                  Re: "'Continuum' is probably supposed to mean the real numbers... using 'at least' together with that word is absurdly over the top": There is nothing "over the top" about it, let alone "absurdly" so. There are more sets of real numbers than there are real numbers, so it's quite normal to talk about sets that are larger than the continuum.
                  $endgroup$
                  – ruakh
                  Aug 28 '18 at 18:49







                3




                3




                $begingroup$
                Re: "'Continuum' is probably supposed to mean the real numbers... using 'at least' together with that word is absurdly over the top": There is nothing "over the top" about it, let alone "absurdly" so. There are more sets of real numbers than there are real numbers, so it's quite normal to talk about sets that are larger than the continuum.
                $endgroup$
                – ruakh
                Aug 28 '18 at 18:49




                $begingroup$
                Re: "'Continuum' is probably supposed to mean the real numbers... using 'at least' together with that word is absurdly over the top": There is nothing "over the top" about it, let alone "absurdly" so. There are more sets of real numbers than there are real numbers, so it's quite normal to talk about sets that are larger than the continuum.
                $endgroup$
                – ruakh
                Aug 28 '18 at 18:49











                6












                $begingroup$

                See Gödel Numbering, it is a basic fact in computer science that algorithms are countable, as are by extension recursively enumerable sets.



                Algorithms being countable, it is easy to show that there doesn't exist an algorithm to verify every set in a formal system (assign a truth value to a problem). This would be equivalent to assigning an algorithm to every function mapping the set of problems to boolean values. The set of these functions is however uncountable (trivially of same cardinality as the power set of the set of problems, therefore uncountable).



                I hope this gives some intuition as to why algorithms have to be "less powerful" than just any function, an thus countable (let's ignore the continuum hypothesis here).






                share|cite|improve this answer











                $endgroup$

















                  6












                  $begingroup$

                  See Gödel Numbering, it is a basic fact in computer science that algorithms are countable, as are by extension recursively enumerable sets.



                  Algorithms being countable, it is easy to show that there doesn't exist an algorithm to verify every set in a formal system (assign a truth value to a problem). This would be equivalent to assigning an algorithm to every function mapping the set of problems to boolean values. The set of these functions is however uncountable (trivially of same cardinality as the power set of the set of problems, therefore uncountable).



                  I hope this gives some intuition as to why algorithms have to be "less powerful" than just any function, an thus countable (let's ignore the continuum hypothesis here).






                  share|cite|improve this answer











                  $endgroup$















                    6












                    6








                    6





                    $begingroup$

                    See Gödel Numbering, it is a basic fact in computer science that algorithms are countable, as are by extension recursively enumerable sets.



                    Algorithms being countable, it is easy to show that there doesn't exist an algorithm to verify every set in a formal system (assign a truth value to a problem). This would be equivalent to assigning an algorithm to every function mapping the set of problems to boolean values. The set of these functions is however uncountable (trivially of same cardinality as the power set of the set of problems, therefore uncountable).



                    I hope this gives some intuition as to why algorithms have to be "less powerful" than just any function, an thus countable (let's ignore the continuum hypothesis here).






                    share|cite|improve this answer











                    $endgroup$



                    See Gödel Numbering, it is a basic fact in computer science that algorithms are countable, as are by extension recursively enumerable sets.



                    Algorithms being countable, it is easy to show that there doesn't exist an algorithm to verify every set in a formal system (assign a truth value to a problem). This would be equivalent to assigning an algorithm to every function mapping the set of problems to boolean values. The set of these functions is however uncountable (trivially of same cardinality as the power set of the set of problems, therefore uncountable).



                    I hope this gives some intuition as to why algorithms have to be "less powerful" than just any function, an thus countable (let's ignore the continuum hypothesis here).







                    share|cite|improve this answer














                    share|cite|improve this answer



                    share|cite|improve this answer








                    edited Aug 28 '18 at 12:54









                    David Richerby

                    68.1k15103194




                    68.1k15103194










                    answered Aug 27 '18 at 21:45









                    drilowdrilow

                    1611




                    1611





















                        2












                        $begingroup$

                        If one does not start out with the requirement that a strategy needs to be implementable with an algorithm, and ignores real-life discretization effects, one could for example accept the following as a parameterized trading strategy:



                        Take two real number parameters $a$, $b$. Buy if the price of the commodity falls below $a$, sell if it rises above $b$.



                        Of such strategies, there are clearly continuumsly many. However, of those only countably many can be implemented by an algorithm. The reason is that if $a$ is not lower-computable and $b$ is not upper-computable, then we cannot detect that the conditions are true.






                        share|cite|improve this answer









                        $endgroup$

















                          2












                          $begingroup$

                          If one does not start out with the requirement that a strategy needs to be implementable with an algorithm, and ignores real-life discretization effects, one could for example accept the following as a parameterized trading strategy:



                          Take two real number parameters $a$, $b$. Buy if the price of the commodity falls below $a$, sell if it rises above $b$.



                          Of such strategies, there are clearly continuumsly many. However, of those only countably many can be implemented by an algorithm. The reason is that if $a$ is not lower-computable and $b$ is not upper-computable, then we cannot detect that the conditions are true.






                          share|cite|improve this answer









                          $endgroup$















                            2












                            2








                            2





                            $begingroup$

                            If one does not start out with the requirement that a strategy needs to be implementable with an algorithm, and ignores real-life discretization effects, one could for example accept the following as a parameterized trading strategy:



                            Take two real number parameters $a$, $b$. Buy if the price of the commodity falls below $a$, sell if it rises above $b$.



                            Of such strategies, there are clearly continuumsly many. However, of those only countably many can be implemented by an algorithm. The reason is that if $a$ is not lower-computable and $b$ is not upper-computable, then we cannot detect that the conditions are true.






                            share|cite|improve this answer









                            $endgroup$



                            If one does not start out with the requirement that a strategy needs to be implementable with an algorithm, and ignores real-life discretization effects, one could for example accept the following as a parameterized trading strategy:



                            Take two real number parameters $a$, $b$. Buy if the price of the commodity falls below $a$, sell if it rises above $b$.



                            Of such strategies, there are clearly continuumsly many. However, of those only countably many can be implemented by an algorithm. The reason is that if $a$ is not lower-computable and $b$ is not upper-computable, then we cannot detect that the conditions are true.







                            share|cite|improve this answer












                            share|cite|improve this answer



                            share|cite|improve this answer










                            answered Aug 27 '18 at 21:58









                            ArnoArno

                            52116




                            52116





















                                0












                                $begingroup$

                                If we conceive of algorithms as computer programs written in binary*, then the number of algorithms is the number of (integer) binary numbers. Thus the cardinality of algorithms is the cardinality of the integers.



                                *A proof that turing machines can run all algorithms, and that computers can run any program turing machines, would make this answer unnecessarily long. The former may depend on the definition of an algorithm, but I don't think you're using uncomputable trading strategies.






                                share|cite|improve this answer









                                $endgroup$








                                • 1




                                  $begingroup$
                                  What does this add to the existing answers?
                                  $endgroup$
                                  – David Richerby
                                  Aug 28 '18 at 10:44










                                • $begingroup$
                                  "A proof that turing machines can run all algorithms ... would make this answer unnecessarily long". It would make the answer impossible, since you can't really prove the Church-Turing Thesis
                                  $endgroup$
                                  – John Coleman
                                  Aug 29 '18 at 14:41










                                • $begingroup$
                                  @DavidRicherby It adds brevity.
                                  $endgroup$
                                  – user558317
                                  Aug 30 '18 at 21:20







                                • 1




                                  $begingroup$
                                  @JohnColeman Asserting the impossibility of a proof, without a proof? I meant that a) the OP probably wouldn't care, since b) it's a matter of definition. The question seems to contain the assumption: "since turing machines operate with a finite set of alphabet and the tape has to be indexable thus countable, it's impossible to have uncountable number of algorithms."
                                  $endgroup$
                                  – user558317
                                  Aug 30 '18 at 21:30















                                0












                                $begingroup$

                                If we conceive of algorithms as computer programs written in binary*, then the number of algorithms is the number of (integer) binary numbers. Thus the cardinality of algorithms is the cardinality of the integers.



                                *A proof that turing machines can run all algorithms, and that computers can run any program turing machines, would make this answer unnecessarily long. The former may depend on the definition of an algorithm, but I don't think you're using uncomputable trading strategies.






                                share|cite|improve this answer









                                $endgroup$








                                • 1




                                  $begingroup$
                                  What does this add to the existing answers?
                                  $endgroup$
                                  – David Richerby
                                  Aug 28 '18 at 10:44










                                • $begingroup$
                                  "A proof that turing machines can run all algorithms ... would make this answer unnecessarily long". It would make the answer impossible, since you can't really prove the Church-Turing Thesis
                                  $endgroup$
                                  – John Coleman
                                  Aug 29 '18 at 14:41










                                • $begingroup$
                                  @DavidRicherby It adds brevity.
                                  $endgroup$
                                  – user558317
                                  Aug 30 '18 at 21:20







                                • 1




                                  $begingroup$
                                  @JohnColeman Asserting the impossibility of a proof, without a proof? I meant that a) the OP probably wouldn't care, since b) it's a matter of definition. The question seems to contain the assumption: "since turing machines operate with a finite set of alphabet and the tape has to be indexable thus countable, it's impossible to have uncountable number of algorithms."
                                  $endgroup$
                                  – user558317
                                  Aug 30 '18 at 21:30













                                0












                                0








                                0





                                $begingroup$

                                If we conceive of algorithms as computer programs written in binary*, then the number of algorithms is the number of (integer) binary numbers. Thus the cardinality of algorithms is the cardinality of the integers.



                                *A proof that turing machines can run all algorithms, and that computers can run any program turing machines, would make this answer unnecessarily long. The former may depend on the definition of an algorithm, but I don't think you're using uncomputable trading strategies.






                                share|cite|improve this answer









                                $endgroup$



                                If we conceive of algorithms as computer programs written in binary*, then the number of algorithms is the number of (integer) binary numbers. Thus the cardinality of algorithms is the cardinality of the integers.



                                *A proof that turing machines can run all algorithms, and that computers can run any program turing machines, would make this answer unnecessarily long. The former may depend on the definition of an algorithm, but I don't think you're using uncomputable trading strategies.







                                share|cite|improve this answer












                                share|cite|improve this answer



                                share|cite|improve this answer










                                answered Aug 28 '18 at 3:57









                                user558317user558317

                                1




                                1







                                • 1




                                  $begingroup$
                                  What does this add to the existing answers?
                                  $endgroup$
                                  – David Richerby
                                  Aug 28 '18 at 10:44










                                • $begingroup$
                                  "A proof that turing machines can run all algorithms ... would make this answer unnecessarily long". It would make the answer impossible, since you can't really prove the Church-Turing Thesis
                                  $endgroup$
                                  – John Coleman
                                  Aug 29 '18 at 14:41










                                • $begingroup$
                                  @DavidRicherby It adds brevity.
                                  $endgroup$
                                  – user558317
                                  Aug 30 '18 at 21:20







                                • 1




                                  $begingroup$
                                  @JohnColeman Asserting the impossibility of a proof, without a proof? I meant that a) the OP probably wouldn't care, since b) it's a matter of definition. The question seems to contain the assumption: "since turing machines operate with a finite set of alphabet and the tape has to be indexable thus countable, it's impossible to have uncountable number of algorithms."
                                  $endgroup$
                                  – user558317
                                  Aug 30 '18 at 21:30












                                • 1




                                  $begingroup$
                                  What does this add to the existing answers?
                                  $endgroup$
                                  – David Richerby
                                  Aug 28 '18 at 10:44










                                • $begingroup$
                                  "A proof that turing machines can run all algorithms ... would make this answer unnecessarily long". It would make the answer impossible, since you can't really prove the Church-Turing Thesis
                                  $endgroup$
                                  – John Coleman
                                  Aug 29 '18 at 14:41










                                • $begingroup$
                                  @DavidRicherby It adds brevity.
                                  $endgroup$
                                  – user558317
                                  Aug 30 '18 at 21:20







                                • 1




                                  $begingroup$
                                  @JohnColeman Asserting the impossibility of a proof, without a proof? I meant that a) the OP probably wouldn't care, since b) it's a matter of definition. The question seems to contain the assumption: "since turing machines operate with a finite set of alphabet and the tape has to be indexable thus countable, it's impossible to have uncountable number of algorithms."
                                  $endgroup$
                                  – user558317
                                  Aug 30 '18 at 21:30







                                1




                                1




                                $begingroup$
                                What does this add to the existing answers?
                                $endgroup$
                                – David Richerby
                                Aug 28 '18 at 10:44




                                $begingroup$
                                What does this add to the existing answers?
                                $endgroup$
                                – David Richerby
                                Aug 28 '18 at 10:44












                                $begingroup$
                                "A proof that turing machines can run all algorithms ... would make this answer unnecessarily long". It would make the answer impossible, since you can't really prove the Church-Turing Thesis
                                $endgroup$
                                – John Coleman
                                Aug 29 '18 at 14:41




                                $begingroup$
                                "A proof that turing machines can run all algorithms ... would make this answer unnecessarily long". It would make the answer impossible, since you can't really prove the Church-Turing Thesis
                                $endgroup$
                                – John Coleman
                                Aug 29 '18 at 14:41












                                $begingroup$
                                @DavidRicherby It adds brevity.
                                $endgroup$
                                – user558317
                                Aug 30 '18 at 21:20





                                $begingroup$
                                @DavidRicherby It adds brevity.
                                $endgroup$
                                – user558317
                                Aug 30 '18 at 21:20





                                1




                                1




                                $begingroup$
                                @JohnColeman Asserting the impossibility of a proof, without a proof? I meant that a) the OP probably wouldn't care, since b) it's a matter of definition. The question seems to contain the assumption: "since turing machines operate with a finite set of alphabet and the tape has to be indexable thus countable, it's impossible to have uncountable number of algorithms."
                                $endgroup$
                                – user558317
                                Aug 30 '18 at 21:30




                                $begingroup$
                                @JohnColeman Asserting the impossibility of a proof, without a proof? I meant that a) the OP probably wouldn't care, since b) it's a matter of definition. The question seems to contain the assumption: "since turing machines operate with a finite set of alphabet and the tape has to be indexable thus countable, it's impossible to have uncountable number of algorithms."
                                $endgroup$
                                – user558317
                                Aug 30 '18 at 21:30











                                0












                                $begingroup$

                                The other answers have already explained that in the standard model of computation (Turing machines, lambda calculus, etc.) the set of algorithms is countably infinite.



                                However, there are other theoretical models of computation in which the set of algorithms is uncountably infinite. For example, Blum–Shub–Smale machines have an uncountably infinite instruction set1, so their set of algorithms also is uncountably infinite.





                                1 To be precise, the instruction set itself is finite, but it is parameterized using an uncountably infinite set (the rational functions).




                                share|cite|improve this answer









                                $endgroup$












                                • $begingroup$
                                  Aren't the rational functions countable?
                                  $endgroup$
                                  – Ben Millwood
                                  Aug 28 '18 at 15:10










                                • $begingroup$
                                  @BenMillwood Can you briefly sketch a proof of why this might be the case?
                                  $endgroup$
                                  – Mark C
                                  Aug 29 '18 at 7:41










                                • $begingroup$
                                  @BenMillwood For each $x_0 in mathbbR$, the constant function $f: x mapsto x_0$ is a rational function.
                                  $endgroup$
                                  – Florian Brucker
                                  Aug 29 '18 at 14:55











                                • $begingroup$
                                  Oh, I was assuming the constants also had to be rational. Never mind then.
                                  $endgroup$
                                  – Ben Millwood
                                  Sep 5 '18 at 14:40















                                0












                                $begingroup$

                                The other answers have already explained that in the standard model of computation (Turing machines, lambda calculus, etc.) the set of algorithms is countably infinite.



                                However, there are other theoretical models of computation in which the set of algorithms is uncountably infinite. For example, Blum–Shub–Smale machines have an uncountably infinite instruction set1, so their set of algorithms also is uncountably infinite.





                                1 To be precise, the instruction set itself is finite, but it is parameterized using an uncountably infinite set (the rational functions).




                                share|cite|improve this answer









                                $endgroup$












                                • $begingroup$
                                  Aren't the rational functions countable?
                                  $endgroup$
                                  – Ben Millwood
                                  Aug 28 '18 at 15:10










                                • $begingroup$
                                  @BenMillwood Can you briefly sketch a proof of why this might be the case?
                                  $endgroup$
                                  – Mark C
                                  Aug 29 '18 at 7:41










                                • $begingroup$
                                  @BenMillwood For each $x_0 in mathbbR$, the constant function $f: x mapsto x_0$ is a rational function.
                                  $endgroup$
                                  – Florian Brucker
                                  Aug 29 '18 at 14:55











                                • $begingroup$
                                  Oh, I was assuming the constants also had to be rational. Never mind then.
                                  $endgroup$
                                  – Ben Millwood
                                  Sep 5 '18 at 14:40













                                0












                                0








                                0





                                $begingroup$

                                The other answers have already explained that in the standard model of computation (Turing machines, lambda calculus, etc.) the set of algorithms is countably infinite.



                                However, there are other theoretical models of computation in which the set of algorithms is uncountably infinite. For example, Blum–Shub–Smale machines have an uncountably infinite instruction set1, so their set of algorithms also is uncountably infinite.





                                1 To be precise, the instruction set itself is finite, but it is parameterized using an uncountably infinite set (the rational functions).




                                share|cite|improve this answer









                                $endgroup$



                                The other answers have already explained that in the standard model of computation (Turing machines, lambda calculus, etc.) the set of algorithms is countably infinite.



                                However, there are other theoretical models of computation in which the set of algorithms is uncountably infinite. For example, Blum–Shub–Smale machines have an uncountably infinite instruction set1, so their set of algorithms also is uncountably infinite.





                                1 To be precise, the instruction set itself is finite, but it is parameterized using an uncountably infinite set (the rational functions).





                                share|cite|improve this answer












                                share|cite|improve this answer



                                share|cite|improve this answer










                                answered Aug 28 '18 at 13:10









                                Florian BruckerFlorian Brucker

                                1112




                                1112











                                • $begingroup$
                                  Aren't the rational functions countable?
                                  $endgroup$
                                  – Ben Millwood
                                  Aug 28 '18 at 15:10










                                • $begingroup$
                                  @BenMillwood Can you briefly sketch a proof of why this might be the case?
                                  $endgroup$
                                  – Mark C
                                  Aug 29 '18 at 7:41










                                • $begingroup$
                                  @BenMillwood For each $x_0 in mathbbR$, the constant function $f: x mapsto x_0$ is a rational function.
                                  $endgroup$
                                  – Florian Brucker
                                  Aug 29 '18 at 14:55











                                • $begingroup$
                                  Oh, I was assuming the constants also had to be rational. Never mind then.
                                  $endgroup$
                                  – Ben Millwood
                                  Sep 5 '18 at 14:40
















                                • $begingroup$
                                  Aren't the rational functions countable?
                                  $endgroup$
                                  – Ben Millwood
                                  Aug 28 '18 at 15:10










                                • $begingroup$
                                  @BenMillwood Can you briefly sketch a proof of why this might be the case?
                                  $endgroup$
                                  – Mark C
                                  Aug 29 '18 at 7:41










                                • $begingroup$
                                  @BenMillwood For each $x_0 in mathbbR$, the constant function $f: x mapsto x_0$ is a rational function.
                                  $endgroup$
                                  – Florian Brucker
                                  Aug 29 '18 at 14:55











                                • $begingroup$
                                  Oh, I was assuming the constants also had to be rational. Never mind then.
                                  $endgroup$
                                  – Ben Millwood
                                  Sep 5 '18 at 14:40















                                $begingroup$
                                Aren't the rational functions countable?
                                $endgroup$
                                – Ben Millwood
                                Aug 28 '18 at 15:10




                                $begingroup$
                                Aren't the rational functions countable?
                                $endgroup$
                                – Ben Millwood
                                Aug 28 '18 at 15:10












                                $begingroup$
                                @BenMillwood Can you briefly sketch a proof of why this might be the case?
                                $endgroup$
                                – Mark C
                                Aug 29 '18 at 7:41




                                $begingroup$
                                @BenMillwood Can you briefly sketch a proof of why this might be the case?
                                $endgroup$
                                – Mark C
                                Aug 29 '18 at 7:41












                                $begingroup$
                                @BenMillwood For each $x_0 in mathbbR$, the constant function $f: x mapsto x_0$ is a rational function.
                                $endgroup$
                                – Florian Brucker
                                Aug 29 '18 at 14:55





                                $begingroup$
                                @BenMillwood For each $x_0 in mathbbR$, the constant function $f: x mapsto x_0$ is a rational function.
                                $endgroup$
                                – Florian Brucker
                                Aug 29 '18 at 14:55













                                $begingroup$
                                Oh, I was assuming the constants also had to be rational. Never mind then.
                                $endgroup$
                                – Ben Millwood
                                Sep 5 '18 at 14:40




                                $begingroup$
                                Oh, I was assuming the constants also had to be rational. Never mind then.
                                $endgroup$
                                – Ben Millwood
                                Sep 5 '18 at 14:40











                                -1












                                $begingroup$


                                since turing machines operate with a finite set of alphabet and the tape has to be indexable thus countable




                                Given a particular size, there are finitely many Turing machines, and there are countably many sizes. A countable set of numbers, as long which are finite, is countable. The size of the alphabet is a factor in the number of Turing machines, but the size of the tape isn't. If the alphabet were allowed to have countably many characters, then there would be uncountably many machines (each real number could be encoded as a sequence of symbols).



                                If "algorithm" you merely mean a correspondence between input and output, and not a Turing machine or otherwise something that is the normal sense of "computation", then clearly if there a countably many different inputs, then there are uncountably many algorithms: for each real number, we could define an "algorithm" that takes a natural number as input, and outputs that decimal place. For instance, giving the input "3" to the $sqrt.5$ algorithm would give the output of "7". (Note that while it is possible to design a Turing machine that gives the nth digit of $sqrt.5$, it is not possible to do so for all real numbers; only countably many real numbers are computable).






                                share|cite|improve this answer











                                $endgroup$












                                • $begingroup$
                                  I don't understand what you're trying to do, here. The question is about the number of algorithms, and the algorithm is the Turing machine, not the input. Allowing infinitely many non-blank characters on the tape at the start wouldn't affect the number of algorithms and, in any case, any terminating run would only be able to read a finite prefix of the input. Meanwhile, your second paragraph is confusing algorithms with mathematical functions. For all but countably many reals, there is no algorithm that can tell you the $n$th digit in the decimal expansion.
                                  $endgroup$
                                  – David Richerby
                                  Aug 27 '18 at 21:38











                                • $begingroup$
                                  And what would it mean to have uncountably many algorithms, anyway? You can only write down countably many. In what sense is something that you can't write down an algorithm?
                                  $endgroup$
                                  – David Richerby
                                  Aug 27 '18 at 21:39










                                • $begingroup$
                                  @DavidRicherby Yeah, I got a few things mixed up. But one can use "algorithm" in a general sense to refer to a sequence of choices. And in that sense, choosing a digit based on the input is an "algorithm", albeit not a computable one.
                                  $endgroup$
                                  – Acccumulation
                                  Aug 27 '18 at 22:29










                                • $begingroup$
                                  In computer science, "algorithm" and "computable" are the same thing. An algorithm is a Turing machine.
                                  $endgroup$
                                  – David Richerby
                                  Aug 27 '18 at 22:33















                                -1












                                $begingroup$


                                since turing machines operate with a finite set of alphabet and the tape has to be indexable thus countable




                                Given a particular size, there are finitely many Turing machines, and there are countably many sizes. A countable set of numbers, as long which are finite, is countable. The size of the alphabet is a factor in the number of Turing machines, but the size of the tape isn't. If the alphabet were allowed to have countably many characters, then there would be uncountably many machines (each real number could be encoded as a sequence of symbols).



                                If "algorithm" you merely mean a correspondence between input and output, and not a Turing machine or otherwise something that is the normal sense of "computation", then clearly if there a countably many different inputs, then there are uncountably many algorithms: for each real number, we could define an "algorithm" that takes a natural number as input, and outputs that decimal place. For instance, giving the input "3" to the $sqrt.5$ algorithm would give the output of "7". (Note that while it is possible to design a Turing machine that gives the nth digit of $sqrt.5$, it is not possible to do so for all real numbers; only countably many real numbers are computable).






                                share|cite|improve this answer











                                $endgroup$












                                • $begingroup$
                                  I don't understand what you're trying to do, here. The question is about the number of algorithms, and the algorithm is the Turing machine, not the input. Allowing infinitely many non-blank characters on the tape at the start wouldn't affect the number of algorithms and, in any case, any terminating run would only be able to read a finite prefix of the input. Meanwhile, your second paragraph is confusing algorithms with mathematical functions. For all but countably many reals, there is no algorithm that can tell you the $n$th digit in the decimal expansion.
                                  $endgroup$
                                  – David Richerby
                                  Aug 27 '18 at 21:38











                                • $begingroup$
                                  And what would it mean to have uncountably many algorithms, anyway? You can only write down countably many. In what sense is something that you can't write down an algorithm?
                                  $endgroup$
                                  – David Richerby
                                  Aug 27 '18 at 21:39










                                • $begingroup$
                                  @DavidRicherby Yeah, I got a few things mixed up. But one can use "algorithm" in a general sense to refer to a sequence of choices. And in that sense, choosing a digit based on the input is an "algorithm", albeit not a computable one.
                                  $endgroup$
                                  – Acccumulation
                                  Aug 27 '18 at 22:29










                                • $begingroup$
                                  In computer science, "algorithm" and "computable" are the same thing. An algorithm is a Turing machine.
                                  $endgroup$
                                  – David Richerby
                                  Aug 27 '18 at 22:33













                                -1












                                -1








                                -1





                                $begingroup$


                                since turing machines operate with a finite set of alphabet and the tape has to be indexable thus countable




                                Given a particular size, there are finitely many Turing machines, and there are countably many sizes. A countable set of numbers, as long which are finite, is countable. The size of the alphabet is a factor in the number of Turing machines, but the size of the tape isn't. If the alphabet were allowed to have countably many characters, then there would be uncountably many machines (each real number could be encoded as a sequence of symbols).



                                If "algorithm" you merely mean a correspondence between input and output, and not a Turing machine or otherwise something that is the normal sense of "computation", then clearly if there a countably many different inputs, then there are uncountably many algorithms: for each real number, we could define an "algorithm" that takes a natural number as input, and outputs that decimal place. For instance, giving the input "3" to the $sqrt.5$ algorithm would give the output of "7". (Note that while it is possible to design a Turing machine that gives the nth digit of $sqrt.5$, it is not possible to do so for all real numbers; only countably many real numbers are computable).






                                share|cite|improve this answer











                                $endgroup$




                                since turing machines operate with a finite set of alphabet and the tape has to be indexable thus countable




                                Given a particular size, there are finitely many Turing machines, and there are countably many sizes. A countable set of numbers, as long which are finite, is countable. The size of the alphabet is a factor in the number of Turing machines, but the size of the tape isn't. If the alphabet were allowed to have countably many characters, then there would be uncountably many machines (each real number could be encoded as a sequence of symbols).



                                If "algorithm" you merely mean a correspondence between input and output, and not a Turing machine or otherwise something that is the normal sense of "computation", then clearly if there a countably many different inputs, then there are uncountably many algorithms: for each real number, we could define an "algorithm" that takes a natural number as input, and outputs that decimal place. For instance, giving the input "3" to the $sqrt.5$ algorithm would give the output of "7". (Note that while it is possible to design a Turing machine that gives the nth digit of $sqrt.5$, it is not possible to do so for all real numbers; only countably many real numbers are computable).







                                share|cite|improve this answer














                                share|cite|improve this answer



                                share|cite|improve this answer








                                edited Aug 27 '18 at 22:28

























                                answered Aug 27 '18 at 20:35









                                AcccumulationAcccumulation

                                1194




                                1194











                                • $begingroup$
                                  I don't understand what you're trying to do, here. The question is about the number of algorithms, and the algorithm is the Turing machine, not the input. Allowing infinitely many non-blank characters on the tape at the start wouldn't affect the number of algorithms and, in any case, any terminating run would only be able to read a finite prefix of the input. Meanwhile, your second paragraph is confusing algorithms with mathematical functions. For all but countably many reals, there is no algorithm that can tell you the $n$th digit in the decimal expansion.
                                  $endgroup$
                                  – David Richerby
                                  Aug 27 '18 at 21:38











                                • $begingroup$
                                  And what would it mean to have uncountably many algorithms, anyway? You can only write down countably many. In what sense is something that you can't write down an algorithm?
                                  $endgroup$
                                  – David Richerby
                                  Aug 27 '18 at 21:39










                                • $begingroup$
                                  @DavidRicherby Yeah, I got a few things mixed up. But one can use "algorithm" in a general sense to refer to a sequence of choices. And in that sense, choosing a digit based on the input is an "algorithm", albeit not a computable one.
                                  $endgroup$
                                  – Acccumulation
                                  Aug 27 '18 at 22:29










                                • $begingroup$
                                  In computer science, "algorithm" and "computable" are the same thing. An algorithm is a Turing machine.
                                  $endgroup$
                                  – David Richerby
                                  Aug 27 '18 at 22:33
















                                • $begingroup$
                                  I don't understand what you're trying to do, here. The question is about the number of algorithms, and the algorithm is the Turing machine, not the input. Allowing infinitely many non-blank characters on the tape at the start wouldn't affect the number of algorithms and, in any case, any terminating run would only be able to read a finite prefix of the input. Meanwhile, your second paragraph is confusing algorithms with mathematical functions. For all but countably many reals, there is no algorithm that can tell you the $n$th digit in the decimal expansion.
                                  $endgroup$
                                  – David Richerby
                                  Aug 27 '18 at 21:38











                                • $begingroup$
                                  And what would it mean to have uncountably many algorithms, anyway? You can only write down countably many. In what sense is something that you can't write down an algorithm?
                                  $endgroup$
                                  – David Richerby
                                  Aug 27 '18 at 21:39










                                • $begingroup$
                                  @DavidRicherby Yeah, I got a few things mixed up. But one can use "algorithm" in a general sense to refer to a sequence of choices. And in that sense, choosing a digit based on the input is an "algorithm", albeit not a computable one.
                                  $endgroup$
                                  – Acccumulation
                                  Aug 27 '18 at 22:29










                                • $begingroup$
                                  In computer science, "algorithm" and "computable" are the same thing. An algorithm is a Turing machine.
                                  $endgroup$
                                  – David Richerby
                                  Aug 27 '18 at 22:33















                                $begingroup$
                                I don't understand what you're trying to do, here. The question is about the number of algorithms, and the algorithm is the Turing machine, not the input. Allowing infinitely many non-blank characters on the tape at the start wouldn't affect the number of algorithms and, in any case, any terminating run would only be able to read a finite prefix of the input. Meanwhile, your second paragraph is confusing algorithms with mathematical functions. For all but countably many reals, there is no algorithm that can tell you the $n$th digit in the decimal expansion.
                                $endgroup$
                                – David Richerby
                                Aug 27 '18 at 21:38





                                $begingroup$
                                I don't understand what you're trying to do, here. The question is about the number of algorithms, and the algorithm is the Turing machine, not the input. Allowing infinitely many non-blank characters on the tape at the start wouldn't affect the number of algorithms and, in any case, any terminating run would only be able to read a finite prefix of the input. Meanwhile, your second paragraph is confusing algorithms with mathematical functions. For all but countably many reals, there is no algorithm that can tell you the $n$th digit in the decimal expansion.
                                $endgroup$
                                – David Richerby
                                Aug 27 '18 at 21:38













                                $begingroup$
                                And what would it mean to have uncountably many algorithms, anyway? You can only write down countably many. In what sense is something that you can't write down an algorithm?
                                $endgroup$
                                – David Richerby
                                Aug 27 '18 at 21:39




                                $begingroup$
                                And what would it mean to have uncountably many algorithms, anyway? You can only write down countably many. In what sense is something that you can't write down an algorithm?
                                $endgroup$
                                – David Richerby
                                Aug 27 '18 at 21:39












                                $begingroup$
                                @DavidRicherby Yeah, I got a few things mixed up. But one can use "algorithm" in a general sense to refer to a sequence of choices. And in that sense, choosing a digit based on the input is an "algorithm", albeit not a computable one.
                                $endgroup$
                                – Acccumulation
                                Aug 27 '18 at 22:29




                                $begingroup$
                                @DavidRicherby Yeah, I got a few things mixed up. But one can use "algorithm" in a general sense to refer to a sequence of choices. And in that sense, choosing a digit based on the input is an "algorithm", albeit not a computable one.
                                $endgroup$
                                – Acccumulation
                                Aug 27 '18 at 22:29












                                $begingroup$
                                In computer science, "algorithm" and "computable" are the same thing. An algorithm is a Turing machine.
                                $endgroup$
                                – David Richerby
                                Aug 27 '18 at 22:33




                                $begingroup$
                                In computer science, "algorithm" and "computable" are the same thing. An algorithm is a Turing machine.
                                $endgroup$
                                – David Richerby
                                Aug 27 '18 at 22:33

















                                draft saved

                                draft discarded
















































                                Thanks for contributing an answer to Computer Science Stack Exchange!


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

                                But avoid


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

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

                                Use MathJax to format equations. MathJax reference.


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




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcs.stackexchange.com%2fquestions%2f96679%2fcardinality-of-the-set-of-algorithms%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

                                PHP code is not being executed, instead code shows on the page

                                Administrative divisions of China