Description Usage Arguments Details Value Examples
What is the probability that N different persons have the same birthdays?
1 | birthday.problem(days, people, gap, repetitions)
|
days |
The total number N of possible choices per each occurrency; namely, for K occurrencies the total sample space is N^K. It defaults to the number of days in a regular year, i. e. 365. |
people |
The number of different cases whose coincidences we want to look at. In the example at hand the number of different people whose birthdays one wants to happen. |
gap |
The allowed gap between any two different cases. It defaults to 0, namely birthdays happening on the same day. |
repetitions |
The number of times one wants to repeat the experiment to derive the statistics. It defaults to 20000, that produces a relative error smaller than 0.5% in most relevant cases. |
The function also provides the theoretical result, namely the theoretical probability that K cases can occurr simultaneously in the total sample space.
experiment |
The frequency of success cases from the experiment, after the selected amount of repetitions. |
theory |
The theoretical probability value of K cases occurring simultaneously in the total sample space. |
1 2 3 4 | ## Simultaneous birthdays
birthday.problem(people = 23)
## Birthdays one day apart
birthday.problem(people = 23, gap = 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.