"Sergey E. Koposov" <math@sai.msu.ru> writes:
> So among 10^5 random numbers there are already 3 collisions. Which doesn't
> seem right for the function which generate randoms of double precision
The underlying random() function only generates 31-bit integers, so
collisions aren't as improbable as they might seem. See
http://en.wikipedia.org/wiki/Birthday_paradox
> It is also interesting that in the table tmpx1 (if I actually output the
> values using select id from tmpx1) I do not see equal numbers at all but I see
> for example two values which are close to each other:
> 0.511193082667887
> 0.511194097343832
> First it seems strange that they have been merged into one group by "groupby".
They aren't; or at least you've not provided any evidence that they were.
regards, tom lane