Monash University > CSSE > CSE1303 > Part A > Lectures > Lecture A14 notes
The following table contains the probabilities that at least two people in group have the same birthday. This is equivalent to considering the probability that there is at least one collision in a table of size 365, given a number of entries in the table.
| Number of People | Probability |
|
10 20 30 40 50 60 70 80 90 100 |
0.11694818 0.41143838 0.70631624 0.89123181 0.97037358 0.99412266 0.99915958 0.99991433 0.99999385 0.99999969 |
/* This is a simple hash function for character strings */
unsigned hash(char* s)
{
int i = 0;
unsigned value = 0;
while (s[i] != ´\0´)
{
value = (s[i] + PRIME*value) % TABLESIZE;
i++;
}
return value;
}