Cody

Problem 2581. Sum of series VII

Solution 2816020

Submitted on 10 Aug 2020 by Joshua Burke
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 = [] s = 0.5000 s = 0.5000

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

s = [] s = 0.3333 s = 0.3333

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

s = [] s = 0.1250 s = 0.1250 0.1500 s = 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)

s = [] s = 0.3333 s = 0.3333 0.3333 s = 0.3333 0.3333 0.2000 s = 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)

s = [] s = 0.0069 s = 0.0069 0.0099 s = 0.0069 0.0099 0.0093 s = 0.0069 0.0099 0.0093 0.0069 s = 0.0069 0.0099 0.0093 0.0069 0.0043 s = 0.0069 0.0099 0.0093 0.0069 0.0043 0.0023 s = 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)

s = [] s = 1.7361e-04 s = 1.0e-03 * 0.1736 0.2701 s = 1.0e-03 * 0.1736 0.2701 0.2836 s = 1.0e-03 * 0.1736 0.2701 0.2836 0.2406 s = 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)

s = [] s = 0.1250 s = 0.1250 0.1500 s = 0.1250 0.1500 0.1125 s = 0.1250 0.1500 0.1125 0.0643 s = 0.1250 0.1500 0.1125 0.0643 0.0301 s = 0.1250 0.1500 0.1125 0.0643 0.0301 0.0121 s = 0.1250 0.1500 0.1125 0.0643 0.0301 0.0121 0.0042 s = 0.1250 0.1500 0.1125 0.0643 0.0301 0.0121 0.0042 0.0013 s = 0.1250 0.1500 0.1125 0.0643 0.0301 0.0121 0.0042 0.0013 0.0004 s = 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)

s = [] s = 0.0333 s = 0.0333 0.0444 s = 0.0333 0.0444 0.0381 s = 0.0333 0.0444 0.0381 0.0254 s = 0.0333 0.0444 0.0381 0.0254 0.0141 s = 0.0333 0.0444 0.0381 0.0254 0.0141 0.0068 s = 0.0333 0.0444 0.0381 0.0254 0.0141 0.0068 0.0029 s = 0.0333 0.0444 0.0381 0.0254 0.0141 0.0068 0.0029 0.0011 s = 0.0333 0.0444 0.0381 0.0254 0.0141 0.0068 0.0029 0.0011 0.0004 s = 0.0333 0.0444 0.0381 0.0254 0.0141 0.0068 0.0029 0.0011 0.0004 0.0001 s = 0.0333 0.0444 0.0381 0.0254 0.0141 0.0068 0.0029 0.0011 0.0004 0.0001 0.0000 s = 0.0333 0.0444 0.0381 0.0254 0.0141 0.0068 0.0029 0.0011 0.0004 0.0001 0.0000 0.0000 s = 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 s = 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)

s = [] s = 2.2964e-08 s = 1.0e-07 * 0.2296 0.3886 s = 1.0e-07 * 0.2296 0.3886 0.4580 s = 1.0e-07 * 0.2296 0.3886 0.4580 0.4478 s = 1.0e-07 * 0.2296 0.3886 0.4580 0.4478 0.3849 s = 1.0e-07 * 0.2296 0.3886 0.4580 0.4478 0.3849 0.2988 s = 1.0e-07 * 0.2296 0.3886 0.4580 0.4478 0.3849 0.2988 0.2131 s = 1.0e-07 * 0.2296 0.3886 0.4580 0.4478 0.3849 0.2988 0.2131 0.1410 s = 1.0e-07 * 0.2296 0.3886 0.4580 0.4478 0.3849 0.2988 0.2131 0.1410 0.0872 s = 1.0e-07 * 0.2296 0.3886 0.4580 0.4478 0.3849 0.2988 0.2131 0.1410 0.0872 0.0508 s = 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 s = 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 s = 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 s = 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 s = 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!