Java Reference
In-Depth Information
figure 9.4
Distribution of lottery
winners if the
expected number of
winners is 2
Winning Tickets
0
1
2
3
4
5
Frequency
0.135
0.271
0.271
0.180
0.090
0.036
3.
The event of getting k occurrences in one region and the event of get-
ting j occurrences in another region disjoint from the first region are
independent. (Technically this statement means that you can get the
probability of both events simultaneously occurring by multiplying
the probability of individual events.)
4.
The mean number of occurrences in a region of some size is known.
If the mean number of occurrences is the constant a , the probability of
exactly k occurrences is .
The Poisson distribution generally applies to events that have a low prob-
ability of a single occurrence. For example, consider the event of purchasing a
winning lottery ticket, where the odds of winning the jackpot are 14,000,000
to 1. Presumably the picked numbers are more or less random and indepen-
dent. If a person buys 100 tickets, the odds of winning become 140,000 to 1
(the odds improve by a factor of 100), so condition 1 holds. The odds of the
person holding two winning tickets are negligible, so condition 2 holds. If
someone else buys 10 tickets, that person's odds of winning are 1,400,000 to
1, and these odds are independent of the first person's, so condition 3 holds.
Suppose that 28,000,000 tickets are sold. The mean number of winning tick-
ets in this situation is 2 (the number we need for condition 4). The actual num-
ber of winning tickets is a random variable with an expected value of 2, and it
satisfies the Poisson distribution. Thus the probability that exactly k winning
tickets have been sold is , which gives the distribution shown in
Figure 9.4. If the expected number of winners is the constant a , the probabil-
ity of k winning tickets is .
To generate a random unsigned integer according to a Poisson distribution
that has an expected value of a , we can adopt the following strategy (whose
mathematical justification is beyond the scope of this topic): Repeatedly gen-
erate uniformly distributed random numbers in the interval (0, 1) until their
product is smaller than (or equal to) . The code shown in Figure 9.5 does
just that, using a mathematically equivalent technique that is less sensitive to
overflow. The code adds the logarithm of the uniform random numbers until
their sum is smaller than (or equal to) -a .
a k e
k !
-
a
2 k e
k !
-
2
a k e
k !
-
a
e
-
a
 
Search WWH ::




Custom Search