Last active
July 11, 2018 14:35
-
-
Save Ginden/1c51ef227d0fc39d285a9cb3b29b89fe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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