================== Birthday paradox ================== [status: barely-started] The theory ========== A practical demonstration ========================= Look at the code in :numref:`listing-birthdays-py`: .. _listing-birthdays-py: .. literalinclude:: birthdays.py :language: python :caption: Simulate a party with several people and calculate the probability that two of them share a birthday. .. command-output:: python3 birthday-paradox/birthdays.py :ellipsis: 0, 20 The result of running birthdays.py: this calculates the probability that two people at a party will share the same birthday for party sizes from 0 to 50. What we have learned: - Simulate a situation (in this case people sharing birthdays). - Calculate the probability of an event with a random component. We do this by running the event many times and averaging the outcome.