Can an event be possible if its probability is zero? Consider a computer program that generates any random number between 0 and 1(exclusive). There are infinitely many numbers between 0 and 1. So the probability that the random-number generate the same number twice, will be given by - 
$P(E)={1\over \infty}=0$
($\because$ number of favourable outcome = 1, sample space = $\infty$)
But it has happened many times that the program repeats a number, even though, the probability of that event is 0.
Please explain this.
 A: If the probability of a random variable taking any particular value is $0$, then the sample space must be infinite, and the probability of a repeated value (in a sequence of i.i.d. samples) is also $0$.  So if you see a repeated value, you can conclude with confidence that the probability of that particular value is not zero:


*

*because the sample space is actually finite, or

*because the samples are not actually independent, or

*because the probability distribution is not actually uniform.


On a computer, all of these problems occur at once: there are only finitely many floating-point numbers; pseudo-random number generators do not generate all of these numbers with equal probability; and samples from a pseudo-random number generator are not independent.
A: I must be the world’s worst person to be offering an answer to the question posed in the title, and I will be happy to be slapped down by someone who actually knows probability. But it seems to me that if you want to talk probabilities, you need to specify a probability space, and you need to specify the probability measure on it. Until you do both these things, you are merely talking philosophy, not mathematics.
Consider the example of a unit square $S$ as probability space, and ordinary Lebesgue measure on it, so that the probability of a point being in a subset $A\subset S$ is the area of $A$. Now draw the line from one corner to the opposite corner, and consider this subset $D\subset S$. What is the probability of a point lying on the diagonal $D$? Zero, of course, since a line has zero area. But there are points on the diagonal.
Now, to amplify @Tunococ’s good answer, let me say that one must make a careful distinction between real numbers and computer numbers. There are only a finite number of (floating point) computer numbers in your favorite computer, but uncountably infinitely many real numbers. I once sat in a room where the speaker (correctly) stated that it’s impossible to determine on a computer whether two real numbers are equal, and a Respected Member of the computer science department of my university said “Of course it’s possible: take their difference and see if it’s zero.” But he was wrong. For instance, there’s no way to tell by comparing the numbers on your computer that $\arctan(1/3)+\arctan(1/2)=\pi/4$, even though Pure Thought shows that it’s true.
A: An event having probability zero does not mean it is impossible, but that is unlikely to happen. If you look at the qoutients of all pairs of your numbers, and take the quotient of those which are equal by all pairs, for infitite many pairs this quotient will be zero. This means that there are pairs of equal numbers, but there are relatively few.
Another example: Take a pipe. The probability of the pipe breaking at a point is zero, but the probability for breaking might be not zero. If it breakes, it breakes at a certain point. the probability for this was zero, but it happend.
So, finally, probability zero does only mean relatively unlikely, not impossible.
A: A real number representation in computers is not really "real". It is represented by a finite number of bits, so only finitely many values can be represented. That means all random variables generated by a computer will be discrete.
A: There are number of factors that bound an infinite sample space of a computer program to a finite space:


*

*A number in a computer program has a limited fixed representation. This is limited by the hardware. 

*Widely used random number generators (such as Random class in C#) produce only pseudo-random sequences. There are real random number generators, but they produce numbers from finite space.


These limitations transforms the equation:
$P(E)={1\over \infty}=0$   
To
$P(E)={1\over N}=0$   
Where N is a very large positive finite number. 
This makes P(E) a very small positive number.

However, if we consider a hypothetical computer in an ideal environment with infinite amount of memory and processing power to compute real random numbers from infinite space. Then, indeed
$P(E)={1\over \infty}=0$   
will hold true and you will never see two identical numbers.
