LAW OF LARGE NUMBERS - Amazon Web Services...In import numpy np from numpy. random import randn...
Transcript of LAW OF LARGE NUMBERS - Amazon Web Services...In import numpy np from numpy. random import randn...
![Page 1: LAW OF LARGE NUMBERS - Amazon Web Services...In import numpy np from numpy. random import randn counter for N *specify sample size *reset counter *iterate over random values *check](https://reader035.fdocuments.us/reader035/viewer/2022070819/5f19827a140d732ebf6554e2/html5/thumbnails/1.jpg)
Python Programming A-Z™ © Kirill Eremenko
LAW OF LARGE NUMBERSHomework Exercise
![Page 2: LAW OF LARGE NUMBERS - Amazon Web Services...In import numpy np from numpy. random import randn counter for N *specify sample size *reset counter *iterate over random values *check](https://reader035.fdocuments.us/reader035/viewer/2022070819/5f19827a140d732ebf6554e2/html5/thumbnails/2.jpg)
Python Programming A-Z™ © Kirill Eremenko
LLN
![Page 3: LAW OF LARGE NUMBERS - Amazon Web Services...In import numpy np from numpy. random import randn counter for N *specify sample size *reset counter *iterate over random values *check](https://reader035.fdocuments.us/reader035/viewer/2022070819/5f19827a140d732ebf6554e2/html5/thumbnails/3.jpg)
Python Programming A-Z™ © Kirill Eremenko
10: 7 / 3 70% / 30%100: 52 / 48 52% / 48%
1000: 502 / 498 50.2% / 49.8%…
![Page 4: LAW OF LARGE NUMBERS - Amazon Web Services...In import numpy np from numpy. random import randn counter for N *specify sample size *reset counter *iterate over random values *check](https://reader035.fdocuments.us/reader035/viewer/2022070819/5f19827a140d732ebf6554e2/html5/thumbnails/4.jpg)
Python Programming A-Z™ © Kirill Eremenko
NORMAL DISTRIBUTION
![Page 5: LAW OF LARGE NUMBERS - Amazon Web Services...In import numpy np from numpy. random import randn counter for N *specify sample size *reset counter *iterate over random values *check](https://reader035.fdocuments.us/reader035/viewer/2022070819/5f19827a140d732ebf6554e2/html5/thumbnails/5.jpg)
Python Programming A-Z™ © Kirill Eremenko
Test the Law Of Large Numbers for N random normally distributed numbers with mean = 0, stdev = 1:
Create a Python script that will count how many of these numbers fall between -1 and 1 and divide by the total quantity of N
You know that E(X) = 68.2%
Check that Mean(XN) -> E(X) as you rerun your script while increasing N
![Page 6: LAW OF LARGE NUMBERS - Amazon Web Services...In import numpy np from numpy. random import randn counter for N *specify sample size *reset counter *iterate over random values *check](https://reader035.fdocuments.us/reader035/viewer/2022070819/5f19827a140d732ebf6554e2/html5/thumbnails/6.jpg)
Python Programming A-Z™ © Kirill Eremenko
HINT #1
![Page 7: LAW OF LARGE NUMBERS - Amazon Web Services...In import numpy np from numpy. random import randn counter for N *specify sample size *reset counter *iterate over random values *check](https://reader035.fdocuments.us/reader035/viewer/2022070819/5f19827a140d732ebf6554e2/html5/thumbnails/7.jpg)
Python Programming A-Z™ © Kirill Eremenko
for i in randn(100):#…
![Page 8: LAW OF LARGE NUMBERS - Amazon Web Services...In import numpy np from numpy. random import randn counter for N *specify sample size *reset counter *iterate over random values *check](https://reader035.fdocuments.us/reader035/viewer/2022070819/5f19827a140d732ebf6554e2/html5/thumbnails/8.jpg)
Python Programming A-Z™ © Kirill Eremenko
HINT #2
![Page 9: LAW OF LARGE NUMBERS - Amazon Web Services...In import numpy np from numpy. random import randn counter for N *specify sample size *reset counter *iterate over random values *check](https://reader035.fdocuments.us/reader035/viewer/2022070819/5f19827a140d732ebf6554e2/html5/thumbnails/9.jpg)
Python Programming A-Z™ © Kirill Eremenko