Skip to content

Instantly share code, notes, and snippets.

@Ginden
Last active July 11, 2018 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ginden/1c51ef227d0fc39d285a9cb3b29b89fe to your computer and use it in GitHub Desktop.
Save Ginden/1c51ef227d0fc39d285a9cb3b29b89fe to your computer and use it in GitHub Desktop.
liczbaOsob = [0.7, 2.6, 1].map(e => e/100).reduce((a,b) => a*b)*38*1000*1000;
liczbaProb = 100;
Array.from({length: liczbaProb}, () => Object.entries(Array.from({length: liczbaOsob})
.map(e => Math.random()*70*365)
.map(Math.floor)
.reduce((obj, k) => (obj[k] = (obj[k]|0)+1, obj), {}))
.filter(([,v]) => v > 1).length)
.reduce((a,b)=>a+b)/liczbaProb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment