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).

void main()
{printf("%f\n", (float)(abs(rand()) % 1001) * 0.001f);

the output is

Press any key to continue_”

Or in matlab, which is simpler:

>> rand
ans =

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.

This entry was posted in probability, programming. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s