Cody

# Problem 1475. Chebyshev polynomials of the 2nd Kind

Solution 1938617

Submitted on 16 Sep 2019
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
user_solution = fileread('chebyshev2ndKindPoly.m'); assert(isempty(strfind(user_solution,'regexp'))); assert(isempty(strfind(user_solution,'2str'))); assert(isempty(strfind(user_solution,'str2'))); assert(isempty(strfind(user_solution,'interp'))); assert(isempty(strfind(user_solution,'printf'))); assert(isempty(strfind(user_solution,'assert')));

2   Fail
n = 0; P_correct = [1]; assert(isequal(chebyshev2ndKindPoly(n),P_correct));

Output argument "ans" (and maybe others) not assigned during call to "chebyshev2ndKindPoly". Error in Test2 (line 3) assert(isequal(chebyshev2ndKindPoly(n),P_correct));

3   Fail
n = 1; P_correct = [2 0]; assert(isequal(chebyshev2ndKindPoly(n),P_correct));

A = 2 0

Output argument "ans" (and maybe others) not assigned during call to "chebyshev2ndKindPoly". Error in Test3 (line 3) assert(isequal(chebyshev2ndKindPoly(n),P_correct));

4   Fail
n = 2; P_correct = [4 0 -1]; assert(isequal(chebyshev2ndKindPoly(n),P_correct));

A = 2 0 A = 4 0 -1

Output argument "ans" (and maybe others) not assigned during call to "chebyshev2ndKindPoly". Error in Test4 (line 3) assert(isequal(chebyshev2ndKindPoly(n),P_correct));

5   Fail
n = 3; P_correct = [8 0 -4 0]; assert(isequal(chebyshev2ndKindPoly(n),P_correct));

A = 2 0 A = 4 0 -1 A = 8 0 -4 0

Output argument "ans" (and maybe others) not assigned during call to "chebyshev2ndKindPoly". Error in Test5 (line 3) assert(isequal(chebyshev2ndKindPoly(n),P_correct));

6   Fail
n = 4; P_correct = [16 0 -12 0 1]; assert(isequal(chebyshev2ndKindPoly(n),P_correct));

A = 2 0 A = 4 0 -1 A = 8 0 -4 0 A = 16 0 -12 0 2

Output argument "ans" (and maybe others) not assigned during call to "chebyshev2ndKindPoly". Error in Test6 (line 3) assert(isequal(chebyshev2ndKindPoly(n),P_correct));

7   Fail
n = 5; P_correct = [32 0 -32 0 6 0]; assert(isequal(chebyshev2ndKindPoly(n),P_correct));

A = 2 0 A = 4 0 -1 A = 8 0 -4 0 A = 16 0 -12 0 2 A = 32 0 -32 0 10 0

Output argument "ans" (and maybe others) not assigned during call to "chebyshev2ndKindPoly". Error in Test7 (line 3) assert(isequal(chebyshev2ndKindPoly(n),P_correct));

8   Fail
n = 6; P_correct = [64 0 -80 0 24 0 -1]; assert(isequal(chebyshev2ndKindPoly(n),P_correct));

A = 2 0 A = 4 0 -1 A = 8 0 -4 0 A = 16 0 -12 0 2 A = 32 0 -32 0 10 0 A = 64 0 -80 0 36 0 -5

Output argument "ans" (and maybe others) not assigned during call to "chebyshev2ndKindPoly". Error in Test8 (line 3) assert(isequal(chebyshev2ndKindPoly(n),P_correct));

9   Fail
n = 7; P_correct = [128 0 -192 0 80 0 -8 0]; assert(isequal(chebyshev2ndKindPoly(n),P_correct));

A = 2 0 A = 4 0 -1 A = 8 0 -4 0 A = 16 0 -12 0 2 A = 32 0 -32 0 10 0 A = 64 0 -80 0 36 0 -5 A = 128 0 -192 0 112 0 -28 0

Output argument "ans" (and maybe others) not assigned during call to "chebyshev2ndKindPoly". Error in Test9 (line 3) assert(isequal(chebyshev2ndKindPoly(n),P_correct));

10   Fail
n = 8; P_correct = [256 0 -448 0 240 0 -40 0 1]; assert(isequal(chebyshev2ndKindPoly(n),P_correct));

A = 2 0 A = 4 0 -1 A = 8 0 -4 0 A = 16 0 -12 0 2 A = 32 0 -32 0 10 0 A = 64 0 -80 0 36 0 -5 A = 128 0 -192 0 112 0 -28 0 A = 256 0 -448 0 320 0 -112 0 14

Output argument "ans" (and maybe others) not assigned during call to "chebyshev2ndKindPoly". Error in Test10 (line 3) assert(isequal(chebyshev2ndKindPoly(n),P_correct));

11   Fail
n = 9; P_correct = [512 0 -1024 0 672 0 -160 0 10 0]; assert(isequal(chebyshev2ndKindPoly(n),P_correct));

A = 2 0 A = 4 0 -1 A = 8 0 -4 0 A = 16 0 -12 0 2 A = 32 0 -32 0 10 0 A = 64 0 -80 0 36 0 -5 A = 128 0 -192 0 112 0 -28 0 A = 256 0 -448 0 320 0 -112 0 14 A = 512 0 -1024 0 864 0 -384 0 84 0

Output argument "ans" (and maybe others) not assigned during call to "chebyshev2ndKindPoly". Error in Test11 (line 3) assert(isequal(chebyshev2ndKindPoly(n),P_correct));

12   Fail
n = 10; P_correct = [1024 0 -2304 0 1792 0 -560 0 60 0 -1]; assert(isequal(chebyshev2ndKindPoly(n),P_correct));

A = 2 0 A = 4 0 -1 A = 8 0 -4 0 A = 16 0 -12 0 2 A = 32 0 -32 0 10 0 A = 64 0 -80 0 36 0 -5 A = 128 0 -192 0 112 0 -28 0 A = 256 0 -448 0 320 0 -112 0 14 A = 512 0 -1024 0 864 0 -384 0 84 0 A = 1024 0 -2304 0 2240 0 -1200 0 360 0 -42

Output argument "ans" (and maybe others) not assigned during call to "chebyshev2ndKindPoly". Error in Test12 (line 3) assert(isequal(chebyshev2ndKindPoly(n),P_correct));

13   Fail
n = 11; P_correct = [2048 0 -5120 0 4608 0 -1792 0 280 0 -12 0]; assert(isequal(chebyshev2ndKindPoly(n),P_correct));

A = 2 0 A = 4 0 -1 A = 8 0 -4 0 A = 16 0 -12 0 2 A = 32 0 -32 0 10 0 A = 64 0 -80 0 36 0 -5 A = 128 0 -192 0 112 0 -28 0 A = 256 0 -448 0 320 0 -112 0 14 A = 512 0 -1024 0 864 0 -384 0 84 0 A = 1024 0 -2304 0 2240 0 -1200 0 360 0 -42 A = 2048 0 -5120 0 5632 0 -3520 0 1320 0 -264 0

Output argument "ans" (and maybe others) not assigned during call to "chebyshev2ndKindPoly". Error in Test13 (line 3) assert(isequal(chebyshev2ndKindPoly(n),P_correct));

14   Fail
n = 12; P_correct = [4096 0 -11264 0 11520 0 -5376 0 1120 0 -84 0 1]; assert(isequal(chebyshev2ndKindPoly(n),P_correct));

A = 2 0 A = 4 0 -1 A = 8 0 -4 0 A = 16 0 -12 0 2 A = 32 0 -32 0 10 0 A = 64 0 -80 0 36 0 -5 A = 128 0 -192 0 112 0 -28 0 A = 256 0 -448 0 320 0 -112 0 14 A = 512 0 -1024 0 864 0 -384 0 84 0 A = 1024 0 -2304 0 2240 0 -1200 0 360 0 -42 A = 2048 0 -5120 0 5632 0 -3520 0 1320 0 -264 0 A = 4096 0 -11264 0 13824 0 -9856 0 4400 0 -1188 0 132

Output argument "ans" (and maybe others) not assigned during call to "chebyshev2ndKindPoly". Error in Test14 (line 3) assert(isequal(chebyshev2ndKindPoly(n),P_correct));

15   Fail
n = 13; P_correct = [8192 0 -24576 0 28160 0 -15360 0 4032 0 -448 0 14 0]; assert(isequal(chebyshev2ndKindPoly(n),P_correct));

A = 2 0 A = 4 0 -1 A = 8 0 -4 0 A = 16 0 -12 0 2 A = 32 0 -32 0 10 0 A = 64 0 -80 0 36 0 -5 A = 128 0 -192 0 112 0 -28 0 A = 256 0 -448 0 320 0 -112 0 14 A = 512 0 -1024 0 864 0 -384 0 84 0 A = 1024 0 -2304 0 2240 0 -1200 0 360 0 -42 A = 2048 0 -5120 0 5632 0 -3520 0 1320 0 -264 0 A = 4096 0 -11264 0 13824 0 -9856 0 4400 0 -1188 0 132 A = 8192 0 -24576 0 33280 0 -26624 0 13728 0 -4576 0 858 0

Output argument "ans" (and maybe others) not assigned during call to "chebyshev2ndKindPoly". Error in Test15 (line 3) assert(isequal(chebyshev2ndKindPoly(n),P_correct));

16   Fail
n = 14; P_correct = [16384 0 -53248 0 67584 0 -42240 0 13440 0 -2016 0 112 0 -1]; assert(isequal(chebyshev2ndKindPoly(n),P_correct));

A = 2 0 A = 4 0 -1 A = 8 0 -4 0 A = 16 0 -12 0 2 A = 32 0 -32 0 10 0 A = 64 0 -80 0 36 0 -5 A = 128 0 -192 0 112 0 -28 0 A = 256 0 -448 0 320 0 -112 0 14 A = 512 0 -1024 0 864 0 -384 0 84 0 A = 1024 0 -2304 0 2240 0 -1200 0 360 0 -42 A = 2048 0 -5120 0 5632 0 -3520 0 1320 0 -264 0 A = 4096 0 -11264 0 13824 0 -9856 0 4400 0 -1188 0 132 A = 8192 0 -24576 0 33280 0 -26624 0 13728 0 -4576 0 858 0 A = 16384 0 -53248 0 78848 0 -69888 0 40768 0 -16016 0 4004 0 -429

Output argument "ans" (and maybe others) not assigned during call to "chebyshev2ndKindPoly". Error in Test16 (line 3) assert(isequal(chebyshev2ndKindPoly(n),P_correct));

17   Fail
n = 15; P_correct = [32768 0 -114688 0 159744 0 -112640 0 42240 0 -8064 0 672 0 -16 0]; assert(isequal(chebyshev2ndKindPoly(n),P_correct));

A = 2 0 A = 4 0 -1 A = 8 0 -4 0 A = 16 0 -12 0 2 A = 32 0 -32 0 10 0 A = 64 0 -80 0 36 0 -5 A = 128 0 -192 0 112 0 -28 0 A = 256 0 -448 0 320 0 -112 0 14 A = 512 0 -1024 0 864 0 -384 0 84 0 A = 1024 0 -2304 0 2240 0 -1200 0 360 0 -42 A = 2048 0 -5120 0 5632 0 -3520 0 1320 0 -264 0 A = 4096 0 -11264 0 13824 0 -9856 0 4400 0 -1188 0 132 A = 8192 0 -24576 0 33280 0 -26624 0 13728 0 -4576 0 858 0 A = 16384 0 -53248 0 78848 0 -69888 0 40768 0 -16016 0 4004 0 -429 A = Columns 1 through 15 32768 0 -114688 0 184320 0 -179200 0 116480 0 -52416 0 16016 0 -2860 Column 16 0

Output argument "ans" (and maybe others) not assigned during call to "chebyshev2ndKindPoly". Error in Test17 (line 3) assert(isequal(chebyshev2ndKindPoly(n),P_correct));

### Community Treasure Hunt

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

Start Hunting!