# How can the probability that a number contains the digit 3 be 1?

Based on this Numberphile video which claims almost all integers contain a $3$, I have a few questions on the reasoning behind recurring decimal numbers like $0.9999\ldots =1$

What they have shown is that $$\lim_{n \to + \infty} \frac{10^n-9^n}{10^n} = 1$$

this basically means that probability of eg. a $3$ occurring in a set of numbers like for $1-10, 1-100,$ increases as the upper bound gets large.

So you are more likely to see a $3$ when you take $1-100000$, than $1-10$ as the probability gets higher.

So what I would like to know is as '$n$' approaches $∞$ does probability of seeing a '$3$' equals $0.99999....$?

But since $0.9999... = 1$ wouldn't this not make sense, since there are infinitely many numbers that do not have a '$3$'?

All I need is for an explanation as to why this logic is wrong. Simpler answers are most appreciated.

Note

I am not looking for the reason as to why 0.9999...=1.

• We have many questions and answers about $0.\overline9=1$ already, but the actual question you ask seems to be something different abouth "probability of a 3". Could you perhaps edit the question title to say more precisely what you're actually asking? Also, it would help if you could edit in an explanation about where looking for 3s come in at all -- I suspect the video may say something about it, but it's much quicker for a reader to read a short explanation than to have to watch through a video to find out what it is you're talking about. – Henning Makholm Aug 1 '16 at 8:26
• The main $0.99999999\ldots=1$ thread is at math.stackexchange.com/questions/11/… – Henry Aug 1 '16 at 8:41
• For your information, $3$ occurs in the integer range from $1$ to $100$ once and exactly once. – Frenzy Li Aug 1 '16 at 9:02
• @Frenzy Li you didn't read the question properly – ruby duby Aug 1 '16 at 9:03
• @user357484 Then, please edit your wording. What does $3$ occur in a set of numbers mean? Is $233$ an occurrence of $3$? – Frenzy Li Aug 1 '16 at 9:04

The probability increases as the range increases, like you say; the probability that a 3 appears when we choose a random number between 1 and 100000 is much greater than when we pick a number between 1 and 100. As we let the range increase, the probability increases; when we do not have an upper bound, the probability is $0.999\ldots = 1$. So yes, the probability that, taking a completely random integer, it has a 3 as one of its digits is 1.

Ok now wait; there are lots of integers without a 3 (infinitely many), so how can this be?

The problem is the interpretation of "probability 1". We tend to think this means that taking a random number, it would be impossible for it not to contain a 3 (which is clearly not true). But this interpretation only works when we are talking about the probability of an event from a finite sample space. When the number of possibilities are infinite (as in this situation, where there are infinitely many integers to choose from), this has a slightly different meaning. It means that the event happens "almost surely". So taking a random number, the probability it does not contain a 3 is zero, but is not impossible. It would just be like splitting an atom when you throw a dart at a dartboard.

• I really do like your interpretation of the question, this is pretty close to the answer that i was expecting. – ruby duby Aug 1 '16 at 9:21
• @user357484 Thanks, it is an interesting question (it took a minute to realize where you were confused, but the edits improved it a lot; I think it is phrased nicely now). – Morgan Rodgers Aug 1 '16 at 9:35
• You have spotted his problem and explained it well, but it think it would be even clearer if you started with the essential point that an event can have probability 1 without being certain. Another interesting aspect is the definition of a ‘random integer’: I’m not sure what is usual, perhaps that all cosets of $\{n\}$ are equally likely for all $n$? – PJTraill Aug 1 '16 at 12:55
• For what it's worth, you can't choose an integer uniformly at random from all integers, there's simply no way to do it compatible with the usual probability axioms. This leads me to dislike the phrase "choosing a number without a 3 has probability zero" from this answer. – Ben Millwood Aug 1 '16 at 15:28
• @BenMillwood That's fair, I know there is no practical way to choose a random element from the set of integers, but I didn't know exactly how to word it. I edited it a little, don't know if it's better (probability is not really my area). – Morgan Rodgers Aug 1 '16 at 15:38

Yep, there are infinitely many numbers without a $3$, but there are many more with a $3$.

Indeed, in $n$ digit numbers, $9^n$ of them have no $3$, while $10^n-9^n$ do. The ratio is

$$\left(\frac{10}9\right)^n-1$$ which tends to infinity exponentially, meaning that the numbers without a $3$ become more and more rare.

Also note that "the probability of seeing a $3$ equals $1$" doesn't mean that it is absolutely impossible to have no $3$.

• "Yep, there are infinitely many numbers without a 3, but there are many more with a 3." – this is only true for certain, rather uncommon, definitions of "many more". Most mathematicians would say there are countably infinitely many of both kinds of number. – Ben Millwood Aug 1 '16 at 15:51
• @BenMillwood: "countably infinitely many of both kinds of number" would be completely uninformative as it gives no clue about the probability. My "many more" is analyzed quantitatively. – Yves Daoust Aug 1 '16 at 16:23

Your question seems to be "How is it possible for an event to have 100% probability if there are exceptions?" The answer is, this is just one of many counter-intuitive situations when dealing with infinite sets.

With finite sets, if an event has any exceptions, its probability is necessarily < 100%. However, with infinite sets, it's possible for for there to be some exceptions (even an infinite number of exceptions) and the event to still have 100% probability. In other words, with infinite sets, "is true with probability 1" and "is always true" have different meanings!

You seem to think that the numbers $0.9999999\dots$ and $1$ are two different things. They are not. They are the exact same thing. The difference between $0.999\dots$ and $1$ is the same as the difference between "The third round rock rotating around the sun" and "the Earth". They are two different ways of representing the exact same thing.

What the video shows is that the limit of the probability of seeing a $3$ is equal to $1$. That does not mean that the probability itself is equal to $1$ for any single value of $n$.

What it does mean is that if $n$ is really big, then the probability is really close to $1$. It doesn't equal $1$, of course, since you can always pick a number with no threes in it.

• although this is not what i was looking for, i guess this would be closer to the answer than the others who are simply trying to prove that 0.9999... =1 – ruby duby Aug 1 '16 at 8:55
• @user357484 Yes, but your main problem is that you still think that $0.9999\dots$ is different from $1$. Your statement " the probability of seeing a 3 from a set from 1-∞ is 0.9999..... but NEVER 1" shows that you think these are two different things, when really, they are not. – 5xum Aug 1 '16 at 8:58
• yes that is worded pretty badly, i removed that part although i am still unsure how to better word it – ruby duby Aug 1 '16 at 9:39

The logic is both right and wrong, depending what kind of math you're using. But I'm a programmer, rather than a mathematician, so take what I say with a pinch of salt.

In programming at least, once you start working with different infinities, perhaps using libraries which allow you to handle the Aleph numbers of well ordered infinite sets, you also start playing with different kinds of zeroes, or rather, with different kinds of infinitesimals, which get all called "zero" in almost all branches of mathematics (algebra, calculus), in the same way as they treat all types of infinity as a single "inverse-zero", 1/0, the conceptual "upper bound" of the integers.

Once you start using math that is aware of relative infinities, then 0.999... is not one, it's just infinitesimally far from one. The fact that there are two ways of thinking about this, mathematically, is why there are so many arguments about it: as in all great arguments, both sides are right.

If you are using math which is aware of infinite sets, then 0.999... != 1, but 0.999... == 1 - (1/infinity).

If we randomly select an integer, the chance of there being few enough digits in it that we could express just its magnitude (even using shortcuts like powers of powers, terms like "googol" and "graham's number", or knuth's up-arrow notation) in a single lifetime is infinitesimal: there are only a finite number of magnitudes that we can express, and an infinite number of magnitudes.

Since "everyone knows" that dividing any integer by infinity gives zero, then there are apparently zero integers that we can express. But using math which is aware of different infinities, there aren't zero: just an infinitesimally small fraction of integers that we can express.

The chance of it being a number without a 3 in it, is infinitely larger than that. Because there is an infinite quantity of numbers with no 3s in, and only a finite list of numbers that could not be expressed by humans.

But it is still infinitesimally small, because for every number with no threes, there is an infinite number that does contain threes.

Picturing no-threes is hard. I find this easier to picture when considering the "countable" integers and the uncountable 'real' numbers between. It's clear to me that there are infinite integers; between each of those, there are infinite real numbers.

The chances of hitting an integer when panning through the numbers from 0.5 to 1.5, are 100%. The chances of randomly selecting an integer in a random pick form that range are infinitudinously small.

• I think that was also where I partially had a problem in making sense of this. Because infinitesimally large or small numbers exist, then 0.999...=1 doesn't add up because it is infinitesimally far from 1 – ruby duby Aug 2 '16 at 6:33
• @rubyduby It only doesn't add up in those math systems where infinitesimals exist. Not all math systems are the same. Some math systems accept negative zero, for example; others do not. Some don't handle infinity at all. Some do, but only one infinity, and one zero as its inverse. Some (eg roman numerals) do not even accept the possibility of zero. This is why there are even arguments about 0.999... It's because many people don't get that there are different kinds of math from the ones they are familiar with. – Dewi Morgan Aug 2 '16 at 17:10