originally posted by Weedpacket
And there was much rejoicing.

And what exactly do we do now, eat the minstrels? 😃

I almost burned up a CPU on this one. As you've more/less shown, expressed as a percentage, the probability increases several % for each power of 10 with a decrease in the increase as n is increased ... a 19% chance out of 100, 27.1% in 1000, 34.39% in 10,000, 40.951% out of 100,000, 46.856% (rounded) in 1,000,000, 52.17% in 10,000,000 and after that it got boring sitting around waiting for the 100 million computation to finish, as I don't have a Cray, or even a Beowulf cluster. I guess if I'd been downloading a big file, I could have waited ... might have been interesting to see what would happen when PHP got up to 90% or more of CPU.....

Based on this, I'd have to guess that for an infinitely large natural number nnn..., you're gonna have a repeating decimal nine, a la 99.99999...% chance....

I'm pretty sure that that's what your regexp says, isn't it? 😉 Thanks for the enlightenment. Makes me wish I'd learned much more mathematics much earlier in life.

Hmm, punchline[?]: Merve was almost right for numbers close to infinity; or, perhaps "Is there an odd perfect number?" 😃

    I'm going to make a stupid educated guess and say 2/19 is the probability. (I think I'm totally off-base though.)

      Well I'm going to give another bit of reasoning (better than numeric experiments) before giving the answer; mainly 'cos I've already written it and I don't want it to go to waste.

      It has to be admitted that a few numeric experiments do not a proof make, however. Who knows, the pattern could go wonky with n=7, or 9, or 10, or.... What would be nice is something a little more solid. A chain of reasoning that doesn't involve conducting numeric experiments might go something like this:

      Consider the set of all natural numbers less than 10n. Put that another way, all n-digit decimal numerals where those less than 10(n-1) have been padded with leading zeros (oh, but you can do that, because it doesn't affect how many numerals do or don't have a '3' in them! If you don't like it you can just keep the shorter numerals around and say that, e.g, '57' does not have a '3' in the thousands position - which is true!). How many of these numerals contain a '3'?

      Well, ten percent of them have a '3' in the units position. In other words, (1/10) of them.

      Of the remaining ninety percent (i.e., those that don't have a '3' in the units position), ten percent have a '3' in the tens position. That is to say, ten percent of ninety percent, or (1/10)(9/10).

      Of the remaining ninety percent of those, ten percent have a '3' in the hundreds position. That's (1/10)(9/10)(9/10) = (1/10)(9/10)2.

      Etc...

      ...of the remaining ninety percent of those, ten percent have a '3' in the - um - (n-1)illions position, (i.e., the "first" or leftmost position). That's (1/10)(9/10)(n-1).

      Now let's add those all together.

      (1/10) + (1/10)(9/10) + (1/10)(9/10)^2 + ... + (1/10)(9/10)^([i]n[/i]-1)
      = (1/10)(1 + (9/10) + (9/10)^2 + ... + (9/10)^([i]n[/i]-1))
      

      Oh, this is just summing a geometric progression! Talk about in-your-sleep!

               [i]n[/i]-1
      = (1/10)(SUM (9/10)^[i]i[/i])
               [i]i[/i]=0
      
      =(1/10)(1-(9/10)^[i]n[/i])/(1-9/10)
      

      And simplify that a bit. (It really could do with a bit of simplification!)

      =(1/10)(1-(9/10)^[i]n[/i])/(1-9/10)
      =(1/10)(1-(9/10)^[i]n[/i])/(10/10-9/10)
      =(1/10)(1-(9/10)^[i]n[/i])/(1/10)
      =1-(9/10)^[i]n[/i]
      

      Hurrraaaay.

      If you want to be rigorous about that argument, it can be formulated in terms of induction on n.

        If I knew I could pad everything with 0's, then I would've figured it out a long time ago! :mad:

        Nah, I'm just kidding; I'm no mathematician, that's a nice puzzle Weed and you had me stumped. 🙂

          Oh, go ahead: that's the general expression for n, but what is n? It's supposed to be the number of digits in a randomly-selected natural number, but how many is that, and what does it make the value of the expression?

            And so I wrap up. dalecosp came closest it has to be said (no, no prizes except a sense of intellectual achievement).

            The full and final answer to the puzzle is the same as the answer to the question "what happens to that expression as n approaches infinity? What value (if any) does it take?"

            As n gets larger, (9/10)n is obviously going to get smaller. How much smaller? As small as we like: any number ε you might suggest as a limit to how tiny it can go can be beaten for tinyness by (9/10)n just by picking a big enough value for n. And we're allowed to pick n as big as we like because there'll always be natural numbers whose decimal representations have that many digits.

            So no matter what how small a positive real number might be suggested for the value of (9/10)n as n approaches ∞ the fact is that the real value is smaller. Smaller than any positive number in other words. And there is only one number that is smaller than any positive number.

            Zero.

            As n approaches infinity, (9/10)n approaches zero, and hence 1-(9/10)n approaches 1. And that's the answer to the question I started the thread with.

            What is the probability that a randomly-selected natural number has the digit '3' in its decimal representation?

            Answer: 1.

            Pick any natural number at random, and it is certain to contain a '3' in its decimal representation.

              Weed you were close but still very far away.
              The first digit of a number cannot be zero, otherwise
              probability of 3, 03, 003, 0000000000000000003 will all be different even if those numbers are mathematically same.

              assuming that 0 cannot come in the first place
              we have the expression as

              (1/9) + (1/9)(9/10) + (1/9)(9/10)^2 + ... + (1/9)(9/10)^([i]n[/i]-1)
              = (1/9)(1 + (9/10) + (9/10)^2 + ... + (9/10)^([i]n[/i]-1))
              

              where n is the number of digits.

              now use the GP.

              for finite n it will be
              probability will be (10/9)(1-(9/10)n)

              for n=infinite
              probablity will be (10/9)/(1-0) = 10/9 which is greater than 1, => sure shot.

                probability :

                maybe... maybe not... pass me another beer

                Every problem can find its solution in pure evil denial.

                  Originally posted by jayant
                  Weed you were close but still very far away.
                  The first digit of a number cannot be zero, otherwise
                  probability of 3, 03, 003, 0000000000000000003 will all be different even if those numbers are mathematically same.

                  No, they're all the same, as I noted in the parenthetical remark. The number of n-digit numerals with leading zeros is for present purposes identical to the set of all n-digit or shorter numerals without leading zeros. Either way, the number three only gets counted once.

                  The fact that you get a probability that is greater than one just shows that you made a mistake somewhere.

                    Pick any natural number at random, and it is certain to contain a '3' in its decimal representation.

                    I dont quite understand the implication of the mathematics, though.

                    If we were indeed to select a natural number at random, quite obviously we may still pick a number that does not contain a '3' in its decimal representation, since such numbers exist.

                    But then is that because we (as in human beings doing the selection, or using a computer) cannot really select from the entire set of natural numbers?

                      The probability is 1 ?!

                      I doubt it... that's like saying that every natural number has the digit 3 in it. I think i'll check if the probability of picking a natural number WITHOUT the digit 3 is actually 0. 😛

                        "This branch of mathematics [Probability] is the only one, I believe, in which good writers frequently get results which are entirely erroneous." ---Charles Pierce

                        😉

                          What I think Weed is saying is that the probability is so damn close to one that for all practical purposes, it is 1.

                            Originally posted by Merve
                            What I think Weed is saying is that the probability is so damn close to one that for all practical purposes, it is 1.

                            No, I'm saying it is 1.

                            Pick a natural number - any natural number - at random, and there will be a '3' in its decimal representation. You've got no chance of missing it; like trying to hit an infinitely small bulls-eye with an infinitely sharp dart, only harder. Or rolling a pair of dice forever and never getting snake eyes.

                            Kind of goes to show just how unrepresentative the natural numbers we're familiar with are.

                            And, abx_2112, the probability of picking a natural number without a '3' in its decimal representation is 0. It's the limit of (9/10)n as n tends towards ∞.

                            The Frivolous Theorem of Arithmetic:
                            Almost all natural numbers are very, very, very large.

                              Lets read it again:-
                              What is the probability that a randomly-selected natural number has the digit '3' in its decimal representation?

                              probability that 'n' digit number contains '3' atleast once = 1- probabability than number doesn't contain '3' even once

                              probability that 'n' digit number doesn't contain '3' even once = probablity that 1st digit is not '3' x probablity that 2nd digit is not '3' x probablity that 3rd digit is not '3' X ........ x probablity that 'n'th digit is not '3'

                              probablity that 1st digit is not '3' = 8/9 (since we can only have digits 1-9 at the first place)
                              for rest each probab = 9/10 (since 0-9 can come at each place)

                              => probabability than number doesn't contain '3' even once = (8/9) x (9/10) x ..... x (9/10) (n-1 times)
                              = (8/9) x (9/10)(n-1)

                              => probability that 'n' digit number contains '3' atleast once = 1 - (8/9) x (9/10)(n-1)

                              For n tending to infinity, (9/10)(n-1) tends to 0, and hence probablity tends to 1

                                For those who don't understand probability:-
                                if we say
                                that probability of a patient managing to survive for a perticular hospital is 4/5 (every 4 people of out 5, survive)
                                and the last 4 people survived and the one in bed right now is the fifth one, and so he must die.
                                probablity doesn't say that.

                                probablity will that there are 80% (4/5100) chances that , the current patient will survive and 20%(100 - 4/5100) that he will die.

                                also, probablity tending to 1 doesn't mean probablity of exactly 1

                                probability of exact 1 = sure shot
                                probablity tending to 1 = sure shot but few exceptions may occur.

                                  jayant, weedpacket clearly states that the probability is 1, not merely tending to one, since the set of natural numbers is an infinite set.

                                  If it is 1, then the event must happen.

                                  I think that more accurately, the probability is 1 in theory, but tending to 1 in practice.

                                  This is because in practice, we cannot consider the entire set of natural numbers, but from a theoretical viewpoint we can.

                                    set of natural numbers is infinite, fine. but the number of digits in a natural number is finite (unless infinite) and that is the one that is responsible for probabbility.

                                    if i were to pick up a random natural number, I am sure that the number of digits in the number will be finite.
                                    higher the number of digits, closer is the the probabbility to 1
                                    lower the number of digits, lower the probability

                                    what i calculated is probability of existence of '3' in 'n' digit number.
                                    but since we do not know what 'n' will be, you might also like to multiply the probability that the chosen natural # is of length 'n'
                                    which will be 1 divided by infinity (since we are choosing 1 number out of infinite number) which will be close 0.
                                    so total probability for '3' to occur in any natural number =
                                    p(1).q(1) + p(2).q(2) + p(3).q(3) + ................ + p(n).q(n) + .............infinity

                                    where p(x) represents the probability that the a 'x' digit number will be chosen
                                    and
                                    q(x) represents the probablity that the selected 'x' digit number contains '3' as digit atleast once.

                                    0<= p(x) <= 1
                                    0<= q(x) <= 1

                                    though it is another case that p(x) will be ver very close to zero (1/infinity)

                                    basically we are adding infinite terms of the form (1/infinity), which is an indeterminate form.

                                    hence we need to think over a better solution for this.

                                    BUT
                                    for a finite 'n', what i gave in last msg will give the answer.
                                    if we apply some more brain, i think we can crack this indeterminate form into a more solvable form.

                                    my exams start from 5th and i need to study those subjects badly

                                    more after 29th. i will keep checking in, in-b/w the site, but might not post.

                                    so until 29th dec, 2003
                                    its bye from me.
                                    wish me luck for these........ ufffff exams

                                      Using mathematical formulas, one can arrive at the answer of 1, but we cannot say 445681209867 has a 3 in its decimal representation. So theoretically, the probability is asymptotically approaching 1, but never will be equal to 1.

                                        Originally posted by jayant
                                        set of natural numbers is infinite, fine. but the number of digits in a natural number is finite (unless infinite)

                                        Well, all natural numbers are finite - it's a consequence of the definition of natural number.

                                        Merve:
                                        what are the odds that a randomly-selected natural number will be equal to 445681209867? Randomly-selected, note - not artificially constructed to prove a point. That's your hitting an infinitely small bullseye with a perfectly sharp dart. You can do it by chucking the dart at the board and then painting the bullseye where it hits....

                                        Theoretically, the value is exactly one - not asymptotically approaching one, because the only thing "approaching" anything are finite sets of natural numbers (those with n or fewer digits) - and those are only approximations: no finite set of natural numbers is ever going to include all of the natural numbers - and it's the set of all natural numbers that the problem relates to.

                                        Jayant:
                                        No, same sort of thing as Merve; if you are given a natural number, the probability that that number has a '3' in its decimal representation is either 1 or 0, depending on what the number is.

                                        But there's an associated problem:
                                        What is the probability that a randomly-selected number will have n digits in its decimal representation, for a given n?

                                        The answer is 0 (not "close to zero"), because there are only a finite number of n-digit numbers (approximately 10n) but an infinite number of natural numbers. There is no indeterminate form. The sum of 0+0+0+0+0+0+..... is zero.

                                        Let me put it this way: If the probability is not 1, it must be less than one. Call the difference &epsilon;, because it's traditional to do so.

                                        Now, the probability that a natural number with n digits or fewer in its decimal representation contains the digit '3' is, as has been established, 1-(9/10)n.

                                        Fine. But now you're saying that as n approaches &infin; that expression approaches 1-&epsilon; (and not 1). In other words, (9/10)n approaches &epsilon;. To put that another way, n approaches log(&epsilon😉/log(9/10) (remember that &epsilon;>0, so log(&epsilon😉 is defined).

                                        But that is a finite number. So n doesn't approach &infin;, it approaches this finite number instead. And doesn't reach (for example) log(&epsilon😉/log(9/10)+1. So a decimal numeral can't have that many (or more) digits. So there are therefore no natural numbers greater than 10(log(&epsilon😉/log(9/10)).

                                        laserlight:
                                        Best response yet: all our practical experience (and all our ability) revolves around only a vanishingly small (and finite) subset of the natural numbers. Intuitions and gut feelings (which are what are being defended here) derived from working with (small and finite) subsets and not the entire set.