Cody

Problem 2581. Sum of series VII

Solution 1999121

Submitted on 1 Nov 2019 by Asif Newaz
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))

a = 0.5000 s = 0.5000

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

a = 0.3333 s = 0.3333

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

a = 0.1250 a = 0.1250 0.1500 a = 0.1250 0.1500 0.1125 s = 0.3875

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

a = 0.3333 a = 0.3333 0.3333 a = 0.3333 0.3333 0.2000 a = 0.3333 0.3333 0.2000 0.0889 s = 0.9556

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

a = 0.0069 a = 0.0069 0.0099 a = 0.0069 0.0099 0.0093 a = 0.0069 0.0099 0.0093 0.0069 a = 0.0069 0.0099 0.0093 0.0069 0.0043 a = 0.0069 0.0099 0.0093 0.0069 0.0043 0.0023 a = 0.0069 0.0099 0.0093 0.0069 0.0043 0.0023 0.0011 s = 0.0409

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

a = 1.7361e-04 a = 1.0e-03 * 0.1736 0.2701 a = 1.0e-03 * 0.1736 0.2701 0.2836 a = 1.0e-03 * 0.1736 0.2701 0.2836 0.2406 a = 1.0e-03 * 0.1736 0.2701 0.2836 0.2406 0.1754 s = 0.0011

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

a = 0.1250 a = 0.1250 0.1500 a = 0.1250 0.1500 0.1125 a = 0.1250 0.1500 0.1125 0.0643 a = 0.1250 0.1500 0.1125 0.0643 0.0301 a = 0.1250 0.1500 0.1125 0.0643 0.0301 0.0121 a = 0.1250 0.1500 0.1125 0.0643 0.0301 0.0121 0.0042 a = 0.1250 0.1500 0.1125 0.0643 0.0301 0.0121 0.0042 0.0013 a = 0.1250 0.1500 0.1125 0.0643 0.0301 0.0121 0.0042 0.0013 0.0004 a = 0.1250 0.1500 0.1125 0.0643 0.0301 0.0121 0.0042 0.0013 0.0004 0.0001 s = 0.5000

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

a = 0.0333 a = 0.0333 0.0444 a = 0.0333 0.0444 0.0381 a = 0.0333 0.0444 0.0381 0.0254 a = 0.0333 0.0444 0.0381 0.0254 0.0141 a = 0.0333 0.0444 0.0381 0.0254 0.0141 0.0068 a = 0.0333 0.0444 0.0381 0.0254 0.0141 0.0068 0.0029 a = 0.0333 0.0444 0.0381 0.0254 0.0141 0.0068 0.0029 0.0011 a = 0.0333 0.0444 0.0381 0.0254 0.0141 0.0068 0.0029 0.0011 0.0004 a = 0.0333 0.0444 0.0381 0.0254 0.0141 0.0068 0.0029 0.0011 0.0004 0.0001 a = 0.0333 0.0444 0.0381 0.0254 0.0141 0.0068 0.0029 0.0011 0.0004 0.0001 0.0000 a = 0.0333 0.0444 0.0381 0.0254 0.0141 0.0068 0.0029 0.0011 0.0004 0.0001 0.0000 0.0000 a = 0.0333 0.0444 0.0381 0.0254 0.0141 0.0068 0.0029 0.0011 0.0004 0.0001 0.0000 0.0000 0.0000 a = 0.0333 0.0444 0.0381 0.0254 0.0141 0.0068 0.0029 0.0011 0.0004 0.0001 0.0000 0.0000 0.0000 0.0000 s = 0.1667

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

a = 2.2964e-08 a = 1.0e-07 * 0.2296 0.3886 a = 1.0e-07 * 0.2296 0.3886 0.4580 a = 1.0e-07 * 0.2296 0.3886 0.4580 0.4478 a = 1.0e-07 * 0.2296 0.3886 0.4580 0.4478 0.3849 a = 1.0e-07 * 0.2296 0.3886 0.4580 0.4478 0.3849 0.2988 a = 1.0e-07 * 0.2296 0.3886 0.4580 0.4478 0.3849 0.2988 0.2131 a = 1.0e-07 * 0.2296 0.3886 0.4580 0.4478 0.3849 0.2988 0.2131 0.1410 a = 1.0e-07 * 0.2296 0.3886 0.4580 0.4478 0.3849 0.2988 0.2131 0.1410 0.0872 a = 1.0e-07 * 0.2296 0.3886 0.4580 0.4478 0.3849 0.2988 0.2131 0.1410 0.0872 0.0508 a = 1.0e-07 * 0.2296 0.3886 0.4580 0.4478 0.3849 0.2988 0.2131 0.1410 0.0872 0.0508 0.0279 a = 1.0e-07 * 0.2296 0.3886 0.4580 0.4478 0.3849 0.2988 0.2131 0.1410 0.0872 0.0508 0.0279 0.0146 a = 1.0e-07 * 0.2296 0.3886 0.4580 0.4478 0.3849 0.2988 0.2131 0.1410 0.0872 0.0508 0.0279 0.0146 0.0072 a = 1.0e-07 * 0.2296 0.3886 0.4580 0.4478 0.3849 0.2988 0.2131 0.1410 0.0872 0.0508 0.0279 0.0146 0.0072 0.0034 a = 1.0e-07 * 0.2296 0.3886 0.4580 0.4478 0.3849 0.2988 0.2131 0.1410 0.0872 0.0508 0.0279 0.0146 0.0072 0.0034 0.0016 s = 2.7546e-07

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!