This code
java.util.Random r = new java.util.Random();
double a = r.nextDouble();
...
double b = r.nextDouble();
produces two random values between 0.0 and 1.0.
What is the probability of a == b
?
(how many distinct double values are there between 0.0 and 1.0?)