Cody

Problem 161. Wilf-Zeilberger pairs

Solution 2877452

Submitted on 25 Aug 2020 by Ramesh Kumar V
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
F = @(n,k)(sin(n)+sin(k)) G = @(n,k)(n+k) n = 6; k = 4; y_correct = false; assert(isequal(wzpair(F,G,n,k),y_correct))

F = function_handle with value: @(n,k)(sin(n)+sin(k)) G = function_handle with value: @(n,k)(n+k) z1 = 0.9364 z2 = 1

2   Pass
F = @(n,k) (((-1)^k)*nchoosek(n,k)*nchoosek(2*k,k)*4^(n-k)/nchoosek(2*n,n)); G = @(n,k)((2*k-1)*F(n,k-1)/(2*n+1)) n = 7; k = 2; y_correct = true; assert(isequal(wzpair(F,G,n,k),y_correct))

G = function_handle with value: @(n,k)((2*k-1)*F(n,k-1)/(2*n+1)) z1 = 15.8732 z2 = 15.8732

3   Pass
F = @(n,k)(sin(n)+sin(k)) G = @(n,k)(n+k) n = 7; k = 2; y_correct = false; assert(isequal(wzpair(F,G,n,k),y_correct))

F = function_handle with value: @(n,k)(sin(n)+sin(k)) G = function_handle with value: @(n,k)(n+k) z1 = 0.3324 z2 = 1

4   Pass
F = @(n,k) (((-1)^k)*nchoosek(n,k)*nchoosek(2*k,k)*4^(n-k)/nchoosek(2*n,n)); G = @(n,k)((2*k-1)*F(n,k-1)/(2*n+1)) n = 6; k = 4; y_correct = true; assert(isequal(wzpair(F,G,n,k),y_correct))

G = function_handle with value: @(n,k)((2*k-1)*F(n,k-1)/(2*n+1)) z1 = 27.5058 z2 = 27.5058

Suggested Problems

More from this Author23

Community Treasure Hunt

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

Start Hunting!