## Why the point probability of a continuous distribution is 0?

We all know that if a random variable $X$ is continuous distributed, the point probability of $X$ is 0. For example, $X\sim U(0,1)$, where $U(0,1)$ means a uniform distribution with support in $(0,1)$. Then $P(X=x_{0})=0$ for any $x_{0} \in (0,1)$.

However, it is not that easy to understand why $P(X=x_{0})=0$. The  confusion always comes from programming. The following is the C code to generate a random number from $(0,1)$.

#include<stdio.h>
#include<stdlib.h>
void main()
{printf("%f\n", (float)(abs(rand()) % 1001) * 0.001f);
}

the output is

“0.041000
Press any key to continue_”

Or in matlab, which is simpler:

>> rand
ans =
0.8147


In R:

> runif(1)
[1] 0.5685145


What happened now? We drew a sample from $U(0,1)$ and 0.5685145 is what we find. So  0.5685145 did happened in our experiment, but why $P(X=0.5685145)=0$? Doesn’t it contradict the concept of maximum likelihood?

The answer lies on the limitation of  computer hardware. We can’t never get a real sample from $U(0,1)$ using any computer. Recall that $P(rational\ number\ from\ (0,1))=0$, 0.5685145 is a rational number! If we sample a number $x_{0}$ from $U(0,1)$, it will always be an irrational number, because $P(irrational\ number\ from\ (0,1))=1$. We will never know what will $x_{0}$ be like, we can’t write it down, we can’t  even tell it apart from any other irrational number. In other words, $P(X=x_{0})=0$.