Search Postgresql Archives

Re: PG & random() strangeness

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Sergey E. Koposov" <math@xxxxxxxxxx> 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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux