Python COM and distribution issues
hungjunglu at yahoo.com
hungjunglu at yahoo.com
Wed May 16 04:50:05 EDT 2001
--- In python-list at y..., Tim Roberts <timr at p...> wrote:
> You are incorrect. Do the math. If you had been generating a
billion
> GUIDs per second, for every second since the big bang, you would
still have
> generated only one billionth of the possible GUIDs. 2^128 is
unfathomably
> large.
There is a famous birthday problem for probability as taught in high
schools: "What is the typical size of a class for two persons to have
the same birthday?" Most people would say that since there are 365
days, they'd guess somewhere around half that number, that is, for a
class of around 180 students.
The actual number is more like the square root of 365, that is, for a
group of 20 people or so (order of magnitude), you'd already have a
pretty good chance of finding two people with the same birthday.
For p students, the probability of finding NO students with the same
birthday is about
prob. for zero collision = exp[p(p-1)/(2N)] (where N=365)
For p=20 students, that is 0.6
For p=180 students, that is exp[-44] = 10^(-20) =
0.00000000000000000001 (order-of-magnitude-wise speaking)
Or conversely, you have 40% chance of finding 2 people with the same
birthday in class size of 20 students. And you have better than
0.99999999999999999999 probability of finding students with same
birthday in a class of size 180. Matter of fact, you probably find
about 10 people with birthday collisions, maybe more.
Now, that's well-known and I am sure you have done the math yourself,
you just forgot how to do the math, now.
2^128 is about 3.4x10^39, square root of that is 10^19 or so. There
are 10^7 seconds in a year (order of magnitude), age of universe is
about 10^10 years. If you generate a billion (10^9) GUIDs per second,
I'd say you have about (7+10+9-19) = 7 orders of power of 10, that
is, tens of millions of GUID collisions.
Suddenly 2^128 does not seem to be "unfathomably large" anymore.
Right?
I did the math, years ago. Don't tell people to do the math when you
yourself cannot do the math. :)
regards,
Hung Jung
More information about the Python-list
mailing list