So I thought I'd lob this little puzzle out there for youse jokers.

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

    Wouldn't the probability change dependant on the number of figues in the particular number ?

    1 in 10 for 1 number....

    However, I remember doing probability a long time ago, with the heads / tails on a coin....

    It wasn't 50/50 - as heads landed 8 times out of 10.... (dirt on the coin ? was the coin clipped ? Imperfections in the manufacturing - make your own mind up...)

      Well if it's one digit the chance is 1 in 10, for two digits it's 10+9 in 100 for 3 digits it 100+90+92 in 1000 for 4 digits it's 1000+900+902+93 etc etc etc
      Can't remember how to write it out in terms of n though.
      Can someone remind me please.

        This is really annoying me I know what it is I just don't know how to express it.
        Assuming i is the max number of possibilities (ie for one digit it's 10 for two it's 100 for three digits it's 1000 etc..)

        Where i = 1
        probability is (i*10-1)/i

        Where i = 2
        probability is ((i10-1) + (i10-1 - i*10-2))/i

        Where i = 3
        probability is ((i10-1)+(i10-1 - i10-2) + (i10-2 - i*10-3))/i

        etc etc.

        Just got to figure out how to do it terms of n now 😕 😕
        Do I get any points at all?:rolleyes:

          Not sure about this now but I think the notation is

          Where i is the number of digits in the given number 
          (i*10^-(n-1) - i*10^-n)^(n-1)
          

          Please let me know even if I'm wrong so I can stop thinking about it and carry on with fishing out all the obsolete image files on the server. 🙁
          Bubble

            Nice puzzle 🙂

            So I have not checked bubblenut formula but I wanted to ask him:

            What's the number then? (it's just one number) 😛

            Lets see if someone other than weedpacket post it before i do.

              Originally posted by Weedpacket
              So I thought I'd lob this little puzzle out there for youse jokers.

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

              Ah, another intriguing puzzle launched into the air by everybody's favourite mathematician. This puzzle is challenging because we can't just automatically append 0's to the beginning of numbers. But I'll be simple. The probability is the number of occurences of a 3 in an infinite number of numbers. Since both quantities will be infinite, the probability of getting a number with the digit '3' in it will be infinity out of infinity.

                Originally posted by The Chancer
                Wouldn't the probability change dependant on the number of figues in the particular number ?

                Unspecified; it could be any natural number.

                  Originally posted by Merve
                  Since both quantities will be infinite, the probability of getting a number with the digit '3' in it will be infinity out of infinity.

                  Unfortunately, this would be the same "probability" you'd get if the desired property of the selected number was that it was even.

                  In reality, of course, the probability that a randomly-selected natural number will be even is 1/2.

                    bubblenut's on the right track. Further progress can be made by noting that all of those entries will need to be added together; so you might as well add them as you go. Instead of "numbers with 1 digit, numbers with 2 digits, numbers with 3 digits..." count "numbers with up to 1 digit, numbers with up to 2 digits, numbers with up to 3 digits..." and see what proportion of each of those contains a '3'. This might allow a simpler general expression.

                      bubblenut,

                      in your statement, the i's can be factored out and reduced.

                      ( (i10-1) + (i10-1 - i*10-2) ) / i

                      since i exists in eahc member of the numerator, it can be factored out, and since it exists in the denominator the same amount of times as the numerator, it is gone.

                      the 10-1 is actually 1/10, because it's a negative exponent.

                      the second one would be (1/10)-(1/100), so there's a flaw.

                      because the probability is how many times a member will appear within a set period
                      AND
                      since there is no requirement on a different member meeting a criterion
                      AND
                      because each part of the whole is using the same set
                      THEN
                      the probability would not change. it would be the probability of the number occuring in the set...

                      which is 1/10

                      trick quesiton.

                      (edited to be easier to read)

                        Originally posted by mattsinclair
                        because the probability is how many times a member will appear within a set period
                        AND
                        since there is no requirement on a different member meeting a criterion
                        AND
                        because each part of the whole is using the same set
                        THEN
                        the probability would not change. it would be the probability of the number occuring in the set...

                        which is 1/10

                        But observe that even though only ten percent of natural numbers have a '3' as their final digit, that does not mean that the other ninety percent have no '3's at all. So the solution must be >1/10.

                          For some reason I was thinking like it was a string variable... not an integer. In otherwords "303" would have 3 members, not three hundred and three.

                          I'll have to rethink this on my way to the store...

                            Something that just occurred to me that I thought I should mention as it makes the working easier for anyone who might not otherwise be aware of it ("natural number" only got its modern definition in 1986).

                            0 is a natural number. So there are ten natural numbers with one-digit decimal numerals: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.

                            (And, to complete the definition of a natural number: "If n is a natural number, so is n plus one.")

                              No?

                              Okay.

                              I'll build up towards a solution, but first let's start off with some numeric experiments. A wee PHP program gave me the following table:

                              n   Number of n-digit #s   Proportion of occurrences of '3'
                              1       10                      1/10
                              2       90                     18/90
                              3      900                    252/900
                              4     9000                   3168/9000
                              5    90000                  37512/90000
                              6   900000                 427608/900000
                              

                              Those numbers are a bit messy; note, for example, that there are ten one-digit numerals (0,1,2,3,4,5,6,7,8,9), but only 90 two-digit numerals. This of course is because '0' is the only numeral with a leading zero digit.

                              Besides, we'll still need to add them all together again later, when we try to consider all natural numbers at once.

                              So what we'll do instead, is consider numerals that have at most n digits. Or, to put it another way, we'll consider the decimal representations of the first 10n natural numbers for successive n. Up to n=6 (i.e., 0..999999), the table becomes

                              n   10^n      Proportion of occurrences of '3'
                              1        10        1/10
                              2       100       19/100
                              3      1000      271/1000
                              4     10000     3433/10000
                              5    100000    40951/100000
                              6   1000000   468559/1000000
                              

                              This can be worked out from the previous table of course because e.g., 271=252+18+1.

                              But what does that achieve? What pattern is there to those numbers? Well, let's tinker with them a bit and see what we get.

                                   1/10      = 0.1      = 1-0.9      = 1-9^1/10^1 = 1-(9/10)^1
                                  19/100     = 0.19     = 1-0.81     = 1-9^2/10^2 = 1-(9/10)^2
                                 271/1000    = 0.271    = 1-0.729    = 1-9^3/10^3 = 1-(9/10)^3
                                3433/10000   = 0.3433   = 1-0.6561   = 1-9^4/10^4 = 1-(9/10)^4
                               40951/100000  = 0.40951  = 1-0.59049  = 1-9^5/10^5 = 1-(9/10)^5
                              468559/1000000 = 0.468559 = 1-0.531441 = 1-9^6/10^6 = 1-(9/10)^6
                              

                              But that exponent is just n all over again. We now have our general expression for the proportion of numerals up to n digits in length that contain a '3':

                              1-(9/10)n.

                              And there was much rejoicing.

                              More to come (unless someone beats me to the punchline).

                                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?