Cody

Problem 2581. Sum of series VII

Solution 3394733

Submitted on 26 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   Pass
n = 1; m = 1; s_correct = 1/2; assert(isequal(sumOfSeriesVII(n,m),s_correct))

s = 0.5000

2   Pass
n = 1; m = 2; s_correct = 1/3; assert(abs(sumOfSeriesVII(n,m)-s_correct)<eps)

s = 0.3333

3   Fail
n = 3; m = 3; s_correct = 0.3875; assert(abs(sumOfSeriesVII(n,m)-s_correct)<eps)

s = 0.1250 s = 0.4250 s = 1.4375

Assertion failed.

4   Fail
n = 4; m = 2; s_correct = 0.955555555555556; assert(abs(sumOfSeriesVII(n,m)-s_correct)<10*eps)

s = 0.3333 s = 1 s = 2.8000 s = 8.4889

Assertion failed.

5   Fail
n = 7; m = 5; s_correct = 0.0408511683468281; assert(abs(sumOfSeriesVII(n,m)-s_correct)<10*eps)

s = 0.0069 s = 0.0268 s = 0.1105 s = 0.5514 s = 3.2426 s = 21.5055 s = 155.8251

Assertion failed.

6   Fail
n = 5; m = 7; s_correct = 0.00114327593060232; assert(abs(sumOfSeriesVII(n,m)-s_correct)<10*eps)

s = 1.7361e-04 s = 7.1373e-04 s = 0.0033 s = 0.0187 s = 0.1283

Assertion failed.

7   Fail
n = 10; m = 3; s_correct = 0.499971551885614; assert(abs(sumOfSeriesVII(n,m)-s_correct)<10*eps)

s = 0.1250 s = 0.4250 s = 1.4375 s = 5.5518 s = 24.3855 s = 118.1141 s = 614.4458 s = 3.3721e+03 s = 1.9292e+04 s = 1.1412e+05

Assertion failed.

8   Fail
n = 14; m = 4; s_correct = 0.166666498956709; assert(abs(sumOfSeriesVII(n,m)-s_correct)<10*eps)

s = 0.0333 s = 0.1222 s = 0.4651 s = 2.0905 s = 10.9088 s = 63.5717 s = 401.5980 s = 2.6970e+03 s = 1.9007e+04 s = 1.3929e+05 s = 1.0544e+06 s = 8.2039e+06 s = 6.5348e+07 s = 5.3125e+08

Assertion failed.

9   Fail
n = 15; m = 11; s_correct = 2.75459255461393e-07; assert(abs(sumOfSeriesVII(n,m)-s_correct)<10*eps)

s = 2.2964e-08 s = 1.0069e-07 s = 5.1291e-07 s = 3.3791e-06 s = 2.7434e-05 s = 2.5981e-04 s = 0.0028 s = 0.0323 s = 0.4078 s = 5.4845 s = 77.9069 s = 1.1603e+03 s = 1.8013e+04 s = 2.9006e+05 s = 4.8257e+06

Assertion failed.

Suggested Problems

More from this Author9

Community Treasure Hunt

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

Start Hunting!