Created
July 16, 2021 19:41
-
-
Save cesarvargas00/11a0a9e4f0a8c3397aaba30edc2d53fd to your computer and use it in GitHub Desktop.
Revisions
-
cesarvargas00 created this gist
Jul 16, 2021 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ function empirical(x, y, n){ for (let i = 0; i < n; i++){ x = x * (1 + (Math.random() < .5 ? -1 : 1) * (Math.random() * y)/x) } return x } let xs = [] for (let i = 0; i < 10000; i++){ xs.push(empirical(100, 1, 10000) ) } xs.reduce((acc, x) => acc + x,0)/xs.length