in reply to Re: Infinite JAPHs?
in thread Infinite JAPHs?

By defining the limits of the problem in terms of the physical size of the JAPH you have immediately demonstrated that there is a finite number of solutions even if the number is large.

Removing the size limitation will allow you to write an infinite number of JAPHs because you only need to add more code. You could for example write:

print "Just another Perl hacker,"; print "Just another Perl hacker,";; print "Just another Perl hacker,";;; # add more semi-colons as necessary


Comment on Re^2: Infinite JAPHs?
Download Code
Re^3: Infinite JAPHs?
by dragonchild (Archbishop) on Mar 31, 2005 at 13:13 UTC
    . . . you have immediately demonstrated that there is a finite number of solutions even if the number is large.

    Yes, it is a "finite" number, but it is a number that is effectively infinite. For example, 10**10**10**10**10**10**10**10**10**10 is a finite number. Yet, by the 4th 10, you're already past the number of seconds the Universe will survive multiplied by the number of stars in the sky. By the 6th 10, you're past the number of possible living things that will ever live in the Universe, from Big Bang to when it dies, assuming that every 10th star has planets and every 10th such system has a planet that supports life.

    You see where I'm going . . .

    Being right, does not endow the right to be rude; politeness costs nothing.
    Being unknowing, is not the same as being stupid.
    Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
    Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

      This is true, but only under the assumption that only one JAPH can be composed per second. If we compose one per microsecond, then a far greater number of JAPHs is achievable.

      One could, for example, write a program in - say - Perl, to generate a script with a random set of characters, execute, and check if the output matched "Just another Perl hacker[,\n]". It would then simply be a matter of adding processing power to increase your output (and assuming Moore's law still applies until the end of time, this would occur exponentially).
        to generate a script with a random set of characters, execute

        Generating a script with a random set of characters and executing it doesn't seem the brightest of ideas O:-)

        Besides, you'd be generating several times the same script (since the process would be random), and some possible japhs might never be generated (assuming a finite amount of time generating them).

        Let's say we're talking 10**66 different JAPHs. The Universe is projected to live a total of roughly 30 billion years, or 3E10**10. That means the Universe will live (roughly!) 3E10**10 * 365 * 86400, or 10**18 seconds (with a little hand-waving in there to get a nice number). That means you would have to generate 10**48 JAPHS per second, starting at the Big Bang!, to get there. In case you're missing the point further, that's

        1,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000

        JAPHs per second. Or, the number of seconds the Universe is project to live . . . to the third power.

        Now, let's take Moore's Law. Let's say that it takes an average of a billion floating-point operations to test a random Perl script against /^Just another Perl hacker[,\n]$/. (We'll leave out, for a second, those that enter an infinite loop.) That means, currently, IBM's BlueGene/L computer (currently the fastest in the world at 92 teraflops) can do, roughly, 10**8 JAPHs per second. That's pretty good!

        Let's assume Moore's Law holds and computing power doubles every 18 months. (We'll leave aside the cost issues.) Assuming the Universe will live for another 15 billion years, that means that the computing power will multiplied by 2 ** (10**10). Now, it's a close approximation that 2**10 == 10**3. So:

        2**(10**10) ==> (2**10)**(10**9)
                    ==> (10**3)**(10**9)
                    ==> 10**(3*10**9)
                    ~~> 10**(10**9.3)
        
        That means that the current 10**8/second will go up to roughly 10 ** (10**9.3 * 8) or, roughly, 10 ** (10 **10.2) / second - well above the projected 10**66 total JAPHs. So, yes, Moore's Law applied to BlueGene/L will handle the number of projected 4x80 JAPHs before the Universe dies. :-)

        Being right, does not endow the right to be rude; politeness costs nothing.
        Being unknowing, is not the same as being stupid.
        Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
        Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

      Back when I studied chemistry I was introduced to Avogadros number which is numerically around 6.022x10**23 and represents the number of particles in a mole of a substance. (Google around for various explanations etc.). As it turns out, a mole of a substance weighs the same as it's atomic weight in grammes. A mole of water for example weighs 18 grammes which has a volume of 18 ml. Now start to think about the number of atoms of water in the world's oceans...

      The point of this long winded rambling is that once you get into the area of counting molecules you need to use some really big numbers. (and that's without going sub-atomic). These numbers are big but they are still finite.

      Infinity is not a number but the concept of a quantity that has no limits. In limiting the form of the JAPH in terms of the total number of characters that it can contain, you have defined limits. In order to say that there are an infinite number of JAPHs you need to expand at least one parameter so that it can always be increased. You could for example represent the JAPH using any number of character sets where each character could be expressed by an arbitrary number of bytes...

      I could go on and on and on (ad infinitum)

      This thread just got me reading again Arthur C. Clarke's famous sci-fi novel, The Nine Billion Names of God. In the story the task is similar: generate all the possible names of God using some braindead alphabet. Guess what happens when all the names are found...

      rg0now