Jump to content

Probabilistic choice: Difference between revisions

m
added a comma to the task's preamble.
No edit summary
m (added a comma to the task's preamble.)
Line 2:
Given a mapping between items and their required probability of occurrence, generate a million items ''randomly'' subject to the given probabilities and compare the target probability of occurrence versus the generated values.
 
The total of all the probabilities should equal one. (Because floating point arithmetic is involved, this is subject to rounding errors).
 
Use the following mapping to test your programs:<pre>
Cookies help us deliver our services. By using our services, you agree to our use of cookies.