Birthday Paradox Checker

Step 8 – calculate the percentage

We can calculate the percentage of times we got a match and add this at the bottom.

    Code image
  1. Add the code shown at the bottom of your program
  2. I've shown you code for 1000 runs of the program
  3. If you only have it repeating 10 times or 100 times you'll need to change the code to divide by 10 or 100
  4. Run your program to check it works (Run > Run module)

You should get the percentage of matches, which should be close to 50% if the birthday paradox works