Skip to content

Monte Carlo simulation for calculating how probable are shared birthdays in a group of persons. Code in R, Javascript and Go

Notifications You must be signed in to change notification settings

rschifini/MeetupJS-MonteCarlo

Repository files navigation

MeetupJS-MonteCarlo

Code for the MeetupJS presentation

Four scripts are contained in this repository:

  • Three JavaScript files
  • One R script

These four files were created for fun and a presentation was later prepared for Argentina's MeetupJS. All these files calculate coincidental birthdays in a group of N persons using the Monte Carlo method. The calculation is not limited to "at least 2 coincidences", the minimum number of coincidences is set as a parameter and can be changed.

The JavaScript files are:

  • a 4 years old code (with ~30 lines of code)
  • a new approach in ~5 lines of code
  • a revision to the 4 years old code (that performs better than the other two)

The R script mimics the logic of the JS file with the new approach.

About

Monte Carlo simulation for calculating how probable are shared birthdays in a group of persons. Code in R, Javascript and Go

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published