Cody

Problem 44951. Verify Law of Large Numbers

Solution 3473629

Submitted on 29 Oct 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
N = 6; rng(7); assert((round(abs(loln(N)),7) == 7.2900e-05))

Error using randi Requested array exceeds the maximum possible variable size. Error in loln (line 2) dice_diff = mean(1:N) - mean(randi([1, N], 1e8)); Error in Test1 (line 3) assert((round(abs(loln(N)),7) == 7.2900e-05))

2   Fail
N = 10; rng(1000); assert((round(abs(loln(N)),7) == 8.7600e-05))

Error using randi Requested array exceeds the maximum possible variable size. Error in loln (line 2) dice_diff = mean(1:N) - mean(randi([1, N], 1e8)); Error in Test2 (line 3) assert((round(abs(loln(N)),7) == 8.7600e-05))

Suggested Problems

More from this Author13

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!