Given a positive integer x, we are asked to evaluate the following triple summation:
The symbol
is the combination function, nchoosek in Matlab. Therefore, we can write the function in Matlab as follows:
>> S = @(x) sum(arrayfun(@(y) sum(arrayfun(@(n) sum(arrayfun(@(k) ((-4)^k*nchoosek(n,k)/nchoosek(2*k,k)),0:n)),0:y)),0:x));
Hence, for
, we have:
>> S(5)
>> ans =
-1.3302
Please round-off the output to the nearest 4 decimal places.
Solution Stats
Solution Comments
Show comments
Loading...
Problem Recent Solvers3
Suggested Problems
-
Find the longest sequence of 1's in a binary sequence.
6809 Solvers
-
Number of 1s in a binary string
11408 Solvers
-
Longest run of consecutive numbers
6633 Solvers
-
Diophantine Equations (Inspired by Project Euler, problem 66)
70 Solvers
-
395 Solvers
More from this Author116
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!