2

Let the sequence $(x_1, x_2,...)$ be generated by sampling (uniformly and independently) the integers $\{0,1,2,...,9\}$. From the sequence we construct the real number $x = 0.\overline{x_1x_2x_3..}$

What is the probability that $x$ is rational?

I just came up with this question, and realized that I do not even know how to start thinking about it. Intuitively, since the rationals are countable and the irrationals are uncountable, one might guess that the probability of $x$ being rational is 0.

Does the question even make sense from a probability theory's perspective?

JustANoob
  • 1,729
  • 11
  • 25
  • 5
    Hint: a number, represented in decimal digits, is rational if and only if it digit sequence becomes periodic at some point –  Apr 21 '22 at 08:12
  • 1
    Are the $x_i$ sampled independently? – Arthur Apr 21 '22 at 08:13
  • 2
    All in all, your $x$ ends up distributed uniformly on $[0,1]$. – Ivan Neretin Apr 21 '22 at 08:45
  • @Arthur Yes they are. – JustANoob Apr 21 '22 at 09:15
  • @Masacroso So if $P(k)$ represents the probability that the digit sequence has period of length $k$, I guess the answer I'm looking for can be represented as $\sum\limits_{k=1}^{\infty}P(k) ? $ – JustANoob Apr 21 '22 at 09:19
  • @Masacroso But wait... $P(k) = 0$ for any $k\ge 1$... right? – JustANoob Apr 21 '22 at 09:22
  • from a probability space $\Omega :={0,\ldots ,9}$ you need to construct a probability measure in $\Omega ^{\mathbb{N}}$ and use it to solve the exercise. The construction of this probability measure is not trivial and you must know it before to proceed with this exercise –  Apr 21 '22 at 09:35
  • 1
    Kolmogorov says the probability is either 0 or 1. Which does narrow it down. But ultimately it doesn't help. – Arthur Apr 21 '22 at 09:42
  • 1
    If you pick a real uniformly from $[0,1]$, then it will almost surely not be rational, cause the set of rationals has Lebesgue measure 0. – Jaap Scherphuis Apr 21 '22 at 10:10
  • 1
    @JaapScherphuis However, that's not what we're doing. It's almost what we're doing, but not quite. – Arthur Apr 21 '22 at 12:10
  • 1
    @Arthur You're right. I don't think it will make a difference, since each rational has at most two decimal representations, so there are still only countably many of them compared to the uncountably many decimal representations of irrationals. I don't know how you would prove it though. Thanks for your Kolmogorov link, which was new to me. – Jaap Scherphuis Apr 21 '22 at 12:21
  • @Arthur Actually, you could prove that since the probability of a digit being not 9 is non-zero, the probability of picking a representation ending in repeated nines is zero. Hence those extra representations of some rationals do not matter to the probability of picking a rational. – Jaap Scherphuis Apr 21 '22 at 12:39

2 Answers2

3

The set of all rational numbers in $[0,1]$ is countably infinite. So by Axiom 3 of probability theory, we can just add up the probabilities one by one. Let $X$ be your random variable. Then $$ P[X \in [0,1]\cap \mathbb{Q}] = \sum_{x \in [0,1]\cap \mathbb{Q}} \underbrace{P[X=x]}_{0} = 0 $$ where we use the fact that $P[X=x]=0$ for all $x \in [0,1]$ (indeed, a comment by Ivan mentions that $X$ is uniformly distributed over $[0,1]$). The same is true for any random variable $X$ with a continuous CDF: The probability that $X$ is irrational is 1.

For your situation, you can see that $P[X=x]=0$ for all $x \in [0,1]$ by noting that for your i.i.d. random variables $\{X_i\}_{i=1}^{\infty}$ we have $X= \sum_{i=1}^{\infty} X_i 10^{-i}$. Now a prior comment notes that every $x \in [0,1]$ has at most two representations $0.a_1a_2a_3...$ (there can be two if one has an infinite tail of 9s). But we observe that for any particular sequence $\{a_1, a_2, a_3, ...\}$ such that $a_i \in \{0, 1, 2, ..., 9\}$ for all $i$ we get \begin{align} P[X_1=a_1, X_2=a_2, X_3=a_3, ...] &= P[\cap_{i=1}^{\infty} \{X_i=a_i\}] \\ &\overset{(a)}{=} \prod_{i=1}^{\infty} \underbrace{P[X_i=a_i]}_{1/10} \\ &= 0 \end{align} where step (a) holds by mutual independence of $\{X_i\}_{i=1}^{\infty}$.

Michael
  • 26,378
  • Note: In this context, there is nothing special about rational numbers: If $A$ is any countably infinite subset of real numbers then $$P[X\in A] = \sum_{x \in A} P[X=x]=0$$ – Michael Apr 22 '22 at 14:29
2

Sketch for a solution: this is just an sketched answer as to fill all the details will be extremely lenghty. You can find an exposition with all the details for this in many books of probability theory.

Let $\Omega :=\{0,\ldots ,9\}$ equiped with the uniform probability measure in the powerset, that is, we have that $P(k)=\frac1{10}$ for each $k\in \Omega $. Now, you want to build from $(\Omega ,2^{\Omega },P)$ a $\sigma $-algebra and a probability measure $Q$ in $J:=\Omega ^{\mathbb{N}}$, the space of sequences.

This construction is done as follow: first we equip $J$ with the product topology and from here with the Borel $\sigma $-algebra. Now, from all Borel sets, we construct $Q$ first in the cylinders, that is, sets $G\subset J$ of the form $G=\prod_{k\geqslant 1}G_k $ such that $G_k \subset \Omega $ for each $k$ and such that there is a $N\in \mathbb{N}$ such that $G_k=\Omega $ for each $k>N$. Then in the cylinders we set $Q(G):=\prod_{k=1}^N P(G_k)$.

From there it can be shown that $Q$ extends to a probability measure in $J$, known as the product measure. With this construction we have that, by example, the probability that a sequence starts by $4$ is $Q(\{4\}\times \Omega ^{\mathbb{N}})=P(4)=\frac1{10}$, the probability that a sequence starts with $1,2,3$ is $Q(\{1\}\times \{2\}\times \{3\}\times \Omega ^{\mathbb{N}})=P(1)\cdot P(2)\cdot P(3)=\frac1{10}\cdot \frac1{10}\cdot \frac1{10}=\frac1{1000}$. The probability that a sequence start by $1$ or $2$ and that in the third position appear an even number is $Q(\{1,2\}\times \Omega \times \{0,2,4,6,8\}\times \Omega ^{\mathbb{N}})=P(\{1,2\})\cdot P(\Omega )\cdot P(\{0,2,4,6,8\})=\frac{2}{10}\cdot 1\cdot \frac{5}{10}=\frac1{10}$, etc...

Then, from here, its easy to see that the probability that a sequence becomes periodic at some point is zero, and so, after you find some measurable surjection $f:J\to [0,1]$ you can conclude that the measure of all sequences that represent the rationals in $[0,1]$ have zero measure.