Cody

Problem 44951. Verify Law of Large Numbers

Solution 2962756

Submitted on 18 Sep 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))

s(:,:,1) = 0.0763 0.7799 0.4384 0.7235 0.9780 0.5385 s(:,:,2) = 0.5011 0.0721 0.2684 0.4999 0.6792 0.8037 s(:,:,3) = 0.3809 0.0659 0.2881 0.9096 0.2134 0.4521 s(:,:,4) = 0.9312 0.0249 0.6005 0.9501 0.2303 0.5485 s(:,:,5) = 0.9091 0.1332 0.5234 0.7504 0.6690 0.4678 s(:,:,6) = 0.2048 0.4908 0.3724 0.4774 0.3659 0.8379 s(:,:,1) = 0.5891 s(:,:,2) = 0.4707 s(:,:,3) = 0.3850 s(:,:,4) = 0.5476 s(:,:,5) = 0.5755 s(:,:,6) = 0.4582 N = 3.5000 N(:,:,1) = -2.9109 N(:,:,2) = -3.0293 N(:,:,3) = -3.1150 N(:,:,4) = -2.9524 N(:,:,5) = -2.9245 N(:,:,6) = -3.0418

Error using assert The condition input argument must be convertible to a scalar logical. 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))

s(:,:,1) = 0.6536 0.1150 0.9503 0.4822 0.8725 0.2123 0.0407 0.3972 0.2331 0.8417 s(:,:,2) = 0.2071 0.7425 0.3922 0.1823 0.7435 0.0696 0.8853 0.9526 0.9311 0.4154 s(:,:,3) = 0.0290 0.9820 0.3396 0.7067 0.3619 0.0351 0.8551 0.6573 0.7657 0.5541 s(:,:,4) = 0.8851 0.9042 0.0104 0.0746 0.2446 0.1333 0.6979 0.3982 0.8831 0.1810 s(:,:,5) = 0.4325 0.0181 0.6914 0.4697 0.1282 0.8913 0.9182 0.0731 0.0454 0.4386 s(:,:,6) = 0.6017 0.3102 0.6819 0.2090 0.5196 0.5660 0.4412 0.1376 0.2135 0.1334 s(:,:,7) = 0.3223 0.2339 0.5275 0.5660 0.4382 0.3219 0.5596 0.8653 0.8473 0.1078 s(:,:,8) = 0.3163 0.4095 0.6871 0.7022 0.4462 0.4203 0.8026 0.5386 0.9235 0.0619 s(:,:,9) = 0.3676 0.9704 0.6991 0.8910 0.2536 0.7255 0.2035 0.5375 0.2369 0.4365 s(:,:,10) = 0.7980 0.3084 0.6215 0.4396 0.9133 0.6587 0.6536 0.3585 0.5229 0.0451 s(:,:,1) = 0.4799 s(:,:,2) = 0.5522 s(:,:,3) = 0.5286 s(:,:,4) = 0.4412 s(:,:,5) = 0.4107 s(:,:,6) = 0.3814 s(:,:,7) = 0.4790 s(:,:,8) = 0.5308 s(:,:,9) = 0.5322 s(:,:,10) = 0.5320 N = 5.5000 N(:,:,1) = -5.0201 N(:,:,2) = -4.9478 N(:,:,3) = -4.9714 N(:,:,4) = -5.0588 N(:,:,5) = -5.0893 N(:,:,6) = -5.1186 N(:,:,7) = -5.0210 N(:,:,8) = -4.9692 N(:,:,9) = -4.9678 N(:,:,10) = -4.9680

Error using assert The condition input argument must be convertible to a scalar logical. 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!