# Probability of picking a number with finite digits in the fractional part

For a certain interval on the Real Axis, i.g. [0, 1) if you randomly (with uniform distribution) pick a dot on it , what are the chances that number has in the decimal representation a finite number of digits on the fractional part?

My intuition says that it doesn't matter what interval you pick and the problem is the same as finding the ratio between numbers with a finite digits and numbers with infinite digits (either periodic decimal expansion or irrational). Is this correct?

Bonus: Is the ratio the same for all bases (e.g. base 2, base 16)?

This is just something I was wondering about.

My train of thought: You pick a dot on the real axis. You figure the first decimal by splitting the axis into segments of 0.1 (mark every 0.1). You have the segment your number is on. For example [0.4, 0.5). I think it's a probabilistic impossibility to pick a dot exactly on the segment end, thus having exactly one fractional digit.

My rational is this:

• probability of being on a segment is the same for all segments.
• on the segment it is: Probability your dot is exactly on he segment end: 1
• on the segment it is: Probability your dot is not on the segment end: infinite.

So your dot wold be between two marks. In our example your number is of form 0.4...

To figure out the second digit you split the interval further into ten (segments of length 0.01). For example your number is now on the segment [0.48 - 0.49) By the same rationale it's a probabilistic impossibility that your dot is exactly on 0.48. So your number is 0.48xxx....

And you repeat the steps at infinit, figuring out more digits infinitely.

But (by this raionale) the final probability of your dot being a number with finite digits is actually 0 * ∞ (I think). So this is where I get stack overflow. More seriously it reminded me of some of the Zeno's paradoxes. Maybe this is a variant of one of them.

• If the decimal expansion is has only finitely many nonzero digits to the right of the decimal, then the number is rational. The rationals are countable, the reals are uncountable, and so the probability of picking a rational out of the reals is zero. Hence the probability of picking a number with a finite decimal representation is zero. The appropriate language for this question is likely measure theory: the rationals of are measure zero in the reals, hence you will "almost surely" choose an irrational. – Xander Henderson Nov 25 '17 at 21:02
• @XanderHenderson aren't number with infinitely repeating digits also rational? e.g. 1.(3) Anyway your point still stands even if that were true. – bolov Nov 25 '17 at 21:06
• @bolov yes, so you can say that with one hundred percent probability the decimal expansion does not terminate or repeat indefinitely (and note we can just view terminating as repeating zero forever). – spaceisdarkgreen Nov 25 '17 at 21:25
• @bolov I said that if a number has a terminating decimal expansion, then it is rational. I did not state the converse, which is not true. There are plenty of rationals that have non-terminating decimal expansions (though they do have eventually repeating expansions). But if you take a subset (terminating expansions) of a nullset (the rationals), you still have a nullset. – Xander Henderson Nov 25 '17 at 22:21

For clarity and completeness I am moving the comments (especialy Xander's) to an answer.

All numbers with terminating decimal expansions are rational.

However, not all rationals have terminating decimal expansions.

Thus, you are only interested in a strict a subset of the rationals.

The rationals are countable, but the reals are uncountable, and so the probability of picking a rational out of the reals is zero.

Hence the probability of picking a number with a finite decimal representation is zero.

Measure theory describes concepts such as these, more technically and rigorously. In situations such as these where the are a obviously some positive outcomes, but the universe of possibilities is uncountable, the phrase "almost surely" is used.

That is, the decimal expansion of the number you choose is 'almost surely' non-terminating.

• And the answer to the "bonus" question is that everything that's been said here for decimal expansions applies equally well to expansions to any (integer) base (greater than or equal to 2). – Gerry Myerson Aug 5 '18 at 12:43
• @Gerry. Yes thanks for this addition. I missed that part of the question. – Martin Roberts Aug 5 '18 at 12:50