Cody

Solution 1925247

Submitted on 7 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('pascalMat.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   Pass
n = 0; P_correct = [ 1 ]; assert(isequal(pascalMat(n),P_correct));

A = 1 P = 1

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

A = 1 0 1 -1 P = 1 0 1 -1

Assertion failed.

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

A = 1 0 0 1 -1 0 1 -2 1 P = 1 0 0 1 -1 0 1 -2 1

Assertion failed.

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

A = 1 0 0 0 1 -1 0 0 1 -2 1 0 1 -3 3 -1 P = 1.0000 0 0 0 1.0000 -1.0000 0 0 1.0000 -2.0000 1.0000 0.0000 1.0000 -3.0000 3.0000 -1.0000

Assertion failed.

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

A = 1 0 0 0 0 1 -1 0 0 0 1 -2 1 0 0 1 -3 3 -1 0 1 -4 6 -4 1 P = 1 0 0 0 0 1 -1 0 0 0 1 -2 1 0 0 1 -3 3 -1 0 1 -4 6 -4 1

Assertion failed.

7   Fail
n = 5; P_correct = [ 1 0 0 0 0 0 1 1 0 0 0 0 1 2 1 0 0 0 1 3 3 1 0 0 1 4 6 4 1 0 1 5 10 10 5 1 ]; assert(isequal(pascalMat(n),P_correct));

A = 1 0 0 0 0 0 1 -1 0 0 0 0 1 -2 1 0 0 0 1 -3 3 -1 0 0 1 -4 6 -4 1 0 1 -5 10 -10 5 -1 P = 1.0000 0 0 0 0 0 1.0000 -1.0000 0 0 0 0 1.0000 -2.0000 1.0000 -0.0000 0.0000 0.0000 1.0000 -3.0000 3.0000 -1.0000 -0.0000 -0.0000 1.0000 -4.0000 6.0000 -4.0000 1.0000 -0.0000 1.0000 -5.0000 10.0000 -10.0000 5.0000 -1.0000

Assertion failed.

8   Fail
n = 6; P_correct = [ 1 0 0 0 0 0 0 1 1 0 0 0 0 0 1 2 1 0 0 0 0 1 3 3 1 0 0 0 1 4 6 4 1 0 0 1 5 10 10 5 1 0 1 6 15 20 15 6 1 ]; assert(isequal(pascalMat(n),P_correct));

A = 1 0 0 0 0 0 0 1 -1 0 0 0 0 0 1 -2 1 0 0 0 0 1 -3 3 -1 0 0 0 1 -4 6 -4 1 0 0 1 -5 10 -10 5 -1 0 1 -6 15 -20 15 -6 1 P = 1.0000 0 0 0 0 0 0 1.0000 -1.0000 0 0 0 0 0 1.0000 -2.0000 1.0000 -0.0000 0.0000 -0.0000 0.0000 1.0000 -3.0000 3.0000 -1.0000 0.0000 0.0000 -0.0000 1.0000 -4.0000 6.0000 -4.0000 1.0000 0.0000 -0.0000 1.0000 -5.0000 10.0000 -10.0000 5.0000 -1.0000 -0.0000 1.0000 -6.0000 15.0000 -20.0000 15.0000 -6.0000 1.0000

Assertion failed.

9   Fail
n = 7; P_correct = [ 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 2 1 0 0 0 0 0 1 3 3 1 0 0 0 0 1 4 6 4 1 0 0 0 1 5 10 10 5 1 0 0 1 6 15 20 15 6 1 0 1 7 21 35 35 21 7 1 ]; assert(isequal(pascalMat(n),P_correct));

A = 1 0 0 0 0 0 0 0 1 -1 0 0 0 0 0 0 1 -2 1 0 0 0 0 0 1 -3 3 -1 0 0 0 0 1 -4 6 -4 1 0 0 0 1 -5 10 -10 5 -1 0 0 1 -6 15 -20 15 -6 1 0 1 -7 21 -35 35 -21 7 -1 P = 1.0000 0 0 0 0 0 0 0 1.0000 -1.0000 0 0 0 0 0 0 1.0000 -2.0000 1.0000 0.0000 0.0000 -0.0000 0.0000 -0.0000 1.0000 -3.0000 3.0000 -1.0000 -0.0000 0.0000 -0.0000 0.0000 1.0000 -4.0000 6.0000 -4.0000 1.0000 0.0000 -0.0000 0.0000 1.0000 -5.0000 10.0000 -10.0000 5.0000 -1.0000 -0.0000 -0.0000 1.0000 -6.0000 15.0000 -20.0000 15.0000 -6.0000 1.0000 -0.0000 1.0000 -7.0000 21.0000 -35.0000 35.0000 -21.0000 7.0000 -1.0000

Assertion failed.

10   Fail
n = 8; P_correct = [ 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 2 1 0 0 0 0 0 0 1 3 3 1 0 0 0 0 0 1 4 6 4 1 0 0 0 0 1 5 10 10 5 1 0 0 0 1 6 15 20 15 6 1 0 0 1 7 21 35 35 21 7 1 0 1 8 28 56 70 56 28 8 1 ]; assert(isequal(pascalMat(n),P_correct));

A = 1 0 0 0 0 0 0 0 0 1 -1 0 0 0 0 0 0 0 1 -2 1 0 0 0 0 0 0 1 -3 3 -1 0 0 0 0 0 1 -4 6 -4 1 0 0 0 0 1 -5 10 -10 5 -1 0 0 0 1 -6 15 -20 15 -6 1 0 0 1 -7 21 -35 35 -21 7 -1 0 1 -8 28 -56 70 -56 28 -8 1 P = 1.0000 0 0 0 0 0 0 0 0 1.0000 -1.0000 0 0 0 0 0 0 0 1.0000 -2.0000 1.0000 0 0 0 0 0 0 1.0000 -3.0000 3.0000 -1.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 1.0000 -4.0000 6.0000 -4.0000 1.0000 0.0000 -0.0000 0.0000 -0.0000 1.0000 -5.0000 10.0000 -10.0000 5.0000 -1.0000 0.0000 -0.0000 -0.0000 1.0000 -6.0000 15.0000 -20.0000 15.0000 -6.0000 1.0000 -0.0000 -0.0000 1.0000 -7.0000 21.0000 -35.0000 35.0000 -21.0000 7.0000 -1.0000 -0.0000 1.0000 -8.0000 28.0000 -56.0000 70.0000 -56.0000 28.0000 -8.0000 1.0000

Assertion failed.

11   Fail
n = 9; P_correct = [ 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 2 1 0 0 0 0 0 0 0 1 3 3 1 0 0 0 0 0 0 1 4 6 4 1 0 0 0 0 0 1 5 10 10 5 1 0 0 0 0 1 6 15 20 15 6 1 0 0 0 1 7 21 35 35 21 7 1 0 0 1 8 28 56 70 56 28 8 1 0 1 9 36 84 126 126 84 36 9 1 ]; assert(isequal(pascalMat(n),P_correct));

A = 1 0 0 0 0 0 0 0 0 0 1 -1 0 0 0 0 0 0 0 0 1 -2 1 0 0 0 0 0 0 0 1 -3 3 -1 0 0 0 0 0 0 1 -4 6 -4 1 0 0 0 0 0 1 -5 10 -10 5 -1 0 0 0 0 1 -6 15 -20 15 -6 1 0 0 0 1 -7 21 -35 35 -21 7 -1 0 0 1 -8 28 -56 70 -56 28 -8 1 0 1 -9 36 -84 126 -126 84 -36 9 -1 P = 1.0000 0 0 0 0 0 0 0 0 0 1.0000 -1.0000 -0.0000 0.0000 -0.0000 -0.0000 -0.0000 0.0000 -0.0000 -0.0000 1.0000 -2.0000 1.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0000 0.0000 1.0000 -3.0000 3.0000 -1.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 0.0000 1.0000 -4.0000 6.0000 -4.0000 1.0000 0.0000 0.0000 -0.0000 0.0000 -0.0000 1.0000 -5.0000 10.0000 -10.0000 5.0000 -1.0000 -0.0000 -0.0000 0.0000 -0.0000 1.0000 -6.0000 15.0000 -20.0000 15.0000 -6.0000 1.0000 -0.0000 0.0000 -0.0000 1.0000 -7.0000 21.0000 -35.0000 35.0000 -21.0000 7.0000 -1.0000 0.0000 0.0000 1.0000 -8.0000 28.0000 -56.0000 70.0000 -56.0000 28.0000 -8.0000 1.0000 -0.0000 1.0000 -9.0000 36.0000 -84.0000 126.0000 -126.0000 84.0000 -36.0000 9.0000 -1.0000

Assertion failed.

12   Fail
n = 10; P_correct = [ 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 2 1 0 0 0 0 0 0 0 0 1 3 3 1 0 0 0 0 0 0 0 1 4 6 4 1 0 0 0 0 0 0 1 5 10 10 5 1 0 0 0 0 0 1 6 15 20 15 6 1 0 0 0 0 1 7 21 35 35 21 7 1 0 0 0 1 8 28 56 70 56 28 8 1 0 0 1 9 36 84 126 126 84 36 9 1 0 1 10 45 120 210 252 210 120 45 10 1 ]; assert(isequal(pascalMat(n),P_correct));

A = 1 0 0 0 0 0 0 0 0 0 0 1 -1 0 0 0 0 0 0 0 0 0 1 -2 1 0 0 0 0 0 0 0 0 1 -3 3 -1 0 0 0 0 0 0 0 1 -4 6 -4 1 0 0 0 0 0 0 1 -5 10 -10 5 -1 0 0 0 0 0 1 -6 15 -20 15 -6 1 0 0 0 0 1 -7 21 -35 35 -21 7 -1 0 0 0 1 -8 28 -56 70 -56 28 -8 1 0 0 1 -9 36 -84 126 -126 84 -36 9 -1 0 1 -10 45 -120 210 -252 210 -120 45 -10 1 P = 1.0000 0 0 0 0 0 0 0 0 0 0 1.0000 -1.0000 0 0 0 0 0 0 0 0 0 1.0000 -2.0000 1.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0000 -0.0000 -0.0000 1.0000 -3.0000 3.0000 -1.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 1.0000 -4.0000 6.0000 -4.0000 1.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 1.0000 -5.0000 10.0000 -10.0000 5.0000 -1.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 1.0000 -6.0000 15.0000 -20.0000 15.0000 -6.0000 1.0000 -0.0000 0.0000 -0.0000 0.0000 1.0000 -7.0000 21.0000 -35.0000 35.0000 -21.0000 7.0000 -1.0000 0.0000 -0.0000 0.0000 1.0000 -8.0000 28.0000 -56.0000 70.0000 -56.0000 28.0000 -8.0000 1.0000 -0.0000 -0.0000 1.0000 -9.0000 36.0000 -84.0000 126.0000 -126.0000 84.0000 -36.0000 9.0000 -1.0000 0.0000 1.0000 -10.0000 45.0000 -120.0000 210.0000 -252.0000 210.0000 -120.0000 45.0000 -10.0000 1.0000

Assertion failed.

13   Fail
n = 11; P_correct = [ 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 2 1 0 0 0 0 0 0 0 0 0 1 3 3 1 0 0 0 0 0 0 0 0 1 4 6 4 1 0 0 0 0 0 0 0 1 5 10 10 5 1 0 0 0 0 0 0 1 6 15 20 15 6 1 0 0 0 0 0 1 7 21 35 35 21 7 1 0 0 0 0 1 8 28 56 70 56 28 8 1 0 0 0 1 9 36 84 126 126 84 36 9 1 0 0 1 10 45 120 210 252 210 120 45 10 1 0 1 11 55 165 330 462 462 330 165 55 11 1 ]; assert(isequal(pascalMat(n),P_correct));

A = 1 0 0 0 0 0 0 0 0 0 0 0 1 -1 0 0 0 0 0 0 0 0 0 0 1 -2 1 0 0 0 0 0 0 0 0 0 1 -3 3 -1 0 0 0 0 0 0 0 0 1 -4 6 -4 1 0 0 0 0 0 0 0 1 -5 10 -10 5 -1 0 0 0 0 0 0 1 -6 15 -20 15 -6 1 0 0 0 0 0 1 -7 21 -35 35 -21 7 -1 0 0 0 0 1 -8 28 -56 70 -56 28 -8 1 0 0 0 1 -9 36 -84 126 -126 84 -36 9 -1 0 0 1 -10 45 -120 210 -252 210 -120 45 -10 1 0 1 -11 55 -165 330 -462 462 -330 165 -55 11 -1 P = 1.0000 0 0 0 0 0 0 0 0 0 0 0 1.0000 -1.0000 0 0 0 0 0 0 0 0 0 0 1.0000 -2.0000 1.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 1.0000 -3.0000 3.0000 -1.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 1.0000 -4.0000 6.0000 -4.0000 1.0000 -0.0000 0.0000 -0.0000 0.0000 0.0000 -0.0000 -0.0000 1.0000 -5.0000 10.0000 -10.0000 5.0000 -1.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0000 1.0000 -6.0000 15.0000 -20.0000 15.0000 -6.0000 1.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 1.0000 -7.0000 21.0000 -35.0000 35.0000 -21.0000 7.0000 -1.0000 0.0000 -0.0000 0.0000 -0.0000 1.0000 -8.0000 28.0000 -56.0000 70.0000 -56.0000 28.0000 -8.0000 1.0000 -0.0000 0.0000 0.0000 1.0000 -9.0000 36.0000 -84.0000 126.0000 -126.0000 84.0000 -36.0000 9.0000 -1.0000 0.0000 0.0000 1.0000 -10.0000 45.0000 -120.0000 210.0000 -252.0000 210.0000 -120.0000 45.0000 -10.0000 1.0000 0.0000 1.0000 -11.0000 55.0000 -165.0000 330.0000 -462.0000 462.0000 -330.0000 165.0000 -55.0000 11.0000 -1.0000

Assertion failed.

14   Fail
n = 12; P_correct = [ 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 2 1 0 0 0 0 0 0 0 0 0 0 1 3 3 1 0 0 0 0 0 0 0 0 0 1 4 6 4 1 0 0 0 0 0 0 0 0 1 5 10 10 5 1 0 0 0 0 0 0 0 1 6 15 20 15 6 1 0 0 0 0 0 0 1 7 21 35 35 21 7 1 0 0 0 0 0 1 8 28 56 70 56 28 8 1 0 0 0 0 1 9 36 84 126 126 84 36 9 1 0 0 0 1 10 45 120 210 252 210 120 45 10 1 0 0 1 11 55 165 330 462 462 330 165 55 11 1 0 1 12 66 220 495 792 924 792 495 220 66 12 1 ]; assert(isequal(pascalMat(n),P_correct));

A = 1 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 1 -2 1 0 0 0 0 0 0 0 0 0 0 1 -3 3 -1 0 0 0 0 0 0 0 0 0 1 -4 6 -4 1 0 0 0 0 0 0 0 0 1 -5 10 -10 5 -1 0 0 0 0 0 0 0 1 -6 15 -20 15 -6 1 0 0 0 0 0 0 1 -7 21 -35 35 -21 7 -1 0 0 0 0 0 1 -8 28 -56 70 -56 28 -8 1 0 0 0 0 1 -9 36 -84 126 -126 84 -36 9 -1 0 0 0 1 -10 45 -120 210 -252 210 -120 45 -10 1 0 0 1 -11 55 -165 330 -462 462 -330 165 -55 11 -1 0 1 -12 66 -220 495 -792 924 -792 495 -220 66 -12 1 P = 1.0000 0 0 0 0 0 0 0 0 0 0 0 0 1.0000 -1.0000 0 0 0 0 0 0 0 0 0 0 0 1.0000 -2.0000 1.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 1.0000 -3.0000 3.0000 -1.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 -0.0000 1.0000 -4.0000 6.0000 -4.0000 1.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 -0.0000 1.0000 -5.0000 10.0000 -10.0000 5.0000 -1.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 -0.0000 1.0000 -6.0000 15.0000 -20.0000 15.0000 -6.0000 1.0000 -0.0000 0.0000 -0.0000 0.0000 0.0000 -0.0000 1.0000 -7.0000 21.0000 -35.0000 35.0000 -21.0000 7.0000 -1.0000 0.0000 -0.0000 0.0000 0.0000 0.0000 1.0000 -8.0000 28.0000 -56.0000 70.0000 -56.0000 28.0000 -8.0000 1.0000 -0.0000 0.0000 -0.0000 0.0000 1.0000 -9.0000 36.0000 -84.0000 126.0000 -126.0000 84.0000 -36.0000 9.0000 -1.0000 0.0000 -0.0000 0.0000 1.0000 -10.0000 45.0000 -120.0000 210.0000 -252.0000 210.0000 -120.0000 45.0000 -10.0000 1.0000 -0.0000 -0.0000 1.0000 -11.0000 55.0000 -165.0000 330.0000 -462.0000 462.0000 -330.0000 165.0000 -55.0000 11.0000 -1.0000 0.0000 1.0000 -12.0000 66.0000 -220.0000 495.0000 -792.0000 924.0000 -792.0000 495.0000 -220.0000 66.0000 -12.0000 1.0000

Assertion failed.

15   Fail
n = 13; P_correct = [ 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 0 0 0 0 0 0 0 0 0 0 0 1 3 3 1 0 0 0 0 0 0 0 0 0 0 1 4 6 4 1 0 0 0 0 0 0 0 0 0 1 5 10 10 5 1 0 0 0 0 0 0 0 0 1 6 15 20 15 6 1 0 0 0 0 0 0 0 1 7 21 35 35 21 7 1 0 0 0 0 0 0 1 8 28 56 70 56 28 8 1 0 0 0 0 0 1 9 36 84 126 126 84 36 9 1 0 0 0 0 1 10 45 120 210 252 210 120 45 10 1 0 0 0 1 11 55 165 330 462 462 330 165 55 11 1 0 0 1 12 66 220 495 792 924 792 495 220 66 12 1 0 1 13 78 286 715 1287 1716 1716 1287 715 286 78 13 1 ]; assert(isequal(pascalMat(n),P_correct));

A = 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 1 -2 1 0 0 0 0 0 0 0 0 0 0 0 1 -3 3 -1 0 0 0 0 0 0 0 0 0 0 1 -4 6 -4 1 0 0 0 0 0 0 0 0 0 1 -5 10 -10 5 -1 0 0 0 0 0 0 0 0 1 -6 15 -20 15 -6 1 0 0 0 0 0 0 0 1 -7 21 -35 35 -21 7 -1 0 0 0 0 0 0 1 -8 28 -56 70 -56 28 -8 1 0 0 0 0 0 1 -9 36 -84 126 -126 84 -36 9 -1 0 0 0 0 1 -10 45 -120 210 -252 210 -120 45 -10 1 0 0 0 1 -11 55 -165 330 -462 462 -330 165 -55 11 -1 0 0 1 -12 66 -220 495 -792 924 -792 495 -220 66 -12 1 0 1 -13 78 -286 715 -1287 1716 -1716 1287 -715 286 -78 13 -1 P = 1.0e+03 * 0.0010 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0010 -0.0010 0 0 0 0 0 0 0 0 0 0 0 0 0.0010 -0.0020 0.0010 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 0.0010 -0.0030 0.0030 -0.0010 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0000 0.0010 -0.0040 0.0060 -0.0040 0.0010 -0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0010 -0.0050 0.0100 -0.0100 0.0050 -0.0010 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0010 -0.0060 0.0150 -0.0200 0.0150 -0.0060 0.0010 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0010 -0.0070 0.0210 -0.0350 0.0350 -0.0210 0.0070 -0.0010 -0.0000 0.0000 -0.0000 -0.0000 0.0000 -0.0000 0.0010 -0.0080 0.0280 -0.0560 0.0700 -0.0560 0.0280 -0.0080 0.0010 0.0000 -0.0000 -0.0000 0.0000 0.0000 0.0010 -0.0090 0.0360 -0.0840 0.1260 -0.1260 0.0840 -0.0360 0.0090 -0.0010 0.0000 -0.0000 0.0000 -0.0000 0.0010 -0.0100 0.0450 -0.1200 0.2100 -0.2520 0.2100 -0.1200 0.0450 -0.0100 0.0010 -0.0000 0.0000 0.0000 0.0010 -0.0110 0.0550 -0.1650 0.3300 -0.4620 0.4620 -0.3300 0.1650 -0.0550 0.0110 -0.0010 0.0000 -0.0000 0.0010 -0.0120 0.0660 -0.2200 0.4950 -0.7920 0.9240 -0.7920 0.4950 -0.2200 0.0660 -0.0120 0.0010 -0.0000 0.0010 -0.0130 0.0780 -0.2860 0.7150 -1.2870 1.7160 -1.7160 1.2870 -0.7150 0.2860 -0.0780 0.0130 -0.0010

Assertion failed.

16   Fail
n = 14; P_correct = [ 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 0 0 0 0 0 0 0 0 0 0 0 0 1 3 3 1 0 0 0 0 0 0 0 0 0 0 0 1 4 6 4 1 0 0 0 0 0 0 0 0 0 0 1 5 10 10 5 1 0 0 0 0 0 0 0 0 0 1 6 15 20 15 6 1 0 0 0 0 0 0 0 0 1 7 21 35 35 21 7 1 0 0 0 0 0 0 0 1 8 28 56 70 56 28 8 1 0 0 0 0 0 0 1 9 36 84 126 126 84 36 9 1 0 0 0 0 0 1 10 45 120 210 252 210 120 45 10 1 0 0 0 0 1 11 55 165 330 462 462 330 165 55 11 1 0 0 0 1 12 66 220 495 792 924 792 495 220 66 12 1 0 0 1 13 78 286 715 1287 1716 1716 1287 715 286 78 13 1 0 1 14 91 364 1001 2002 3003 3432 3003 2002 1001 364 91 14 1 ]; assert(isequal(pascalMat(n),P_correct));

A = 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -2 1 0 0 0 0 0 0 0 0 0 0 0 0 1 -3 3 -1 0 0 0 0 0 0 0 0 0 0 0 1 -4 6 -4 1 0 0 0 0 0 0 0 0 0 0 1 -5 10 -10 5 -1 0 0 0 0 0 0 0 0 0 1 -6 15 -20 15 -6 1 0 0 0 0 0 0 0 0 1 -7 21 -35 35 -21 7 -1 0 0 0 0 0 0 0 1 -8 28 -56 70 -56 28 -8 1 0 0 0 0 0 0 1 -9 36 -84 126 -126 84 -36 9 -1 0 0 0 0 0 1 -10 45 -120 210 -252 210 -120 45 -10 1 0 0 0 0 1 -11 55 -165 330 -462 462 -330 165 -55 11 -1 0 0 0 1 -12 66 -220 495 -792 924 -792 495 -220 66 -12 1 0 0 1 -13 78 -286 715 -1287 1716 -1716 1287 -715 286 -78 13 -1 0 1 -14 91 -364 1001 -2002 3003 -3432 3003 -2002 1001 -364 91 -14 1 P = 1.0e+03 * 0.0010 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0010 -0.0010 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 -0.0000 0.0010 -0.0020 0.0010 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0010 -0.0030 0.0030 -0.0010 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0010 -0.0040 0.0060 -0.0040 0.0010 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0010 -0.0050 0.0100 -0.0100 0.0050 -0.0010 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0010 -0.0060 0.0150 -0.0200 0.0150 -0.0060 0.0010 -0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 -0.0000 0.0010 -0.0070 0.0210 -0.0350 0.0350 -0.0210 0.0070 -0.0010 0.0000 -0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0010 -0.0080 0.0280 -0.0560 0.0700 -0.0560 0.0280 -0.0080 0.0010 -0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0000 0.0010 -0.0090 0.0360 -0.0840 0.1260 -0.1260 0.0840 -0.0360 0.0090 -0.0010 -0.0000 0.0000 -0.0000 0.0000 0.0000 0.0010 -0.0100 0.0450 -0.1200 0.2100 -0.2520 0.2100 -0.1200 0.0450 -0.0100 0.0010 0.0000 -0.0000 0.0000 -0.0000 0.0010 -0.0110 0.0550 -0.1650 0.3300 -0.4620 0.4620 -0.3300 0.1650 -0.0550 0.0110 -0.0010 -0.0000 0.0000 0.0000 0.0010 -0.0120 0.0660 -0.2200 0.4950 -0.7920 0.9240 -0.7920 0.4950 -0.2200 0.0660 -0.0120 0.0010 0.0000 0.0000 0.0010 -0.0130 0.0780 -0.2860 0.7150 -1.2870 1.7160 -1.7160 1.2870 -0.7150 0.2860 -0.0780 0.0130 -0.0010 0.0000 0.0010 -0.0140 0.0910 -0.3640 1.0010 -2.0020 3.0030 -3.4320 3.0030 -2.0020 1.0010 -0.3640 0.0910 -0.0140 0.0010

Assertion failed.

17   Fail
n = 15; P_correct = [ 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 3 3 1 0 0 0 0 0 0 0 0 0 0 0 0 1 4 6 4 1 0 0 0 0 0 0 0 0 0 0 0 1 5 10 10 5 1 0 0 0 0 0 0 0 0 0 0 1 6 15 20 15 6 1 0 0 0 0 0 0 0 0 0 1 7 21 35 35 21 7 1 0 0 0 0 0 0 0 0 1 8 28 56 70 56 28 8 1 0 0 0 0 0 0 0 1 9 36 84 126 126 84 36 9 1 0 0 0 0 0 0 1 10 45 120 210 252 210 120 45 10 1 0 0 0 0 0 1 11 55 165 330 462 462 330 165 55 11 1 0 0 0 0 1 12 66 220 495 792 924 792 495 220 66 12 1 0 0 0 1 13 78 286 715 1287 1716 1716 1287 715 286 78 13 1 0 0 1 14 91 364 1001 2002 3003 3432 3003 2002 1001 364 91 14 1 0 1 15 105 455 1365 3003 5005 6435 6435 5005 3003 1365 455 105 15 1 ]; assert(isequal(pascalMat(n),P_correct));

A = Columns 1 through 15 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -2 1 0 0 0 0 0 0 0 0 0 0 0 0 1 -3 3 -1 0 0 0 0 0 0 0 0 0 0 0 1 -4 6 -4 1 0 0 0 0 0 0 0 0 0 0 1 -5 10 -10 5 -1 0 0 0 0 0 0 0 0 0 1 -6 15 -20 15 -6 1 0 0 0 0 0 0 0 0 1 -7 21 -35 35 -21 7 -1 0 0 0 0 0 0 0 1 -8 28 -56 70 -56 28 -8 1 0 0 0 0 0 0 1 -9 36 -84 126 -126 84 -36 9 -1 0 0 0 0 0 1 -10 45 -120 210 -252 210 -120 45 -10 1 0 0 0 0 1 -11 55 -165 330 -462 462 -330 165 -55 11 -1 0 0 0 1 -12 66 -220 495 -792 924 -792 495 -220 66 -12 1 0 0 1 -13 78 -286 715 -1287 1716 -1716 1287 -715 286 -78 13 -1 0 1 -14 91 -364 1001 -2002 3003 -3432 3003 -2002 1001 -364 91 -14 1 1 -15 105 -455 1365 -3003 5005 -6435 6435 -5005 3003 -1365 455 -105 15 Column 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 P = 1.0e+03 * 0.0010 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0010 -0.0010 -0.0000 -0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0010 -0.0020 0.0010 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 -0.0000 0.0010 -0.0030 0.0030 -0.0010 0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 -0.0000 0.0010 -0.0040 0.0060 -0.0040 0.0010 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0000 0.0000 0.0010 -0.0050 0.0100 -0.0100 0.0050 -0.0010 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0010 -0.0060 0.0150 -0.0200 0.0150 -0.0060 0.0010 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0010 -0.0070 0.0210 -0.0350 0.0350 -0.0210 0.0070 -0.0010 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0010 -0.0080 0.0280 -0.0560 0.0700 -0.0560 0.0280 -0.0080 0.0010 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0010 -0.0090 0.0360 -0.0840 0.1260 -0.1260 0.0840 -0.0360 0.0090 -0.0010 -0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0010 -0.0100 0.0450 -0.1200 0.2100 -0.2520 0.2100 -0.1200 0.0450 -0.0100 0.0010 0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0010 -0.0110 0.0550 -0.1650 0.3300 -0.4620 0.4620 -0.3300 0.1650 -0.0550 0.0110 -0.0010 -0.0000 0.0000 -0.0000 0.0000 0.0010 -0.0120 0.0660 -0.2200 0.4950 -0.7920 0.9240 -0.7920 0.4950 -0.2200 0.0660 -0.0120 0.0010 0.0000 -0.0000 0.0000 0.0010 -0.0130 0.0780 -0.2860 0.7150 -1.2870 1.7160 -1.7160 1.2870 -0.7150 0.2860 -0.0780 0.0130 -0.0010 -0.0000 -0.0000 0.0010 -0.0140 0.0910 -0.3640 1.0010 -2.0020 3.0030 -3.4320 3.0030 -2.0020 1.0010 -0.3640 0.0910 -0.0140 0.0010 0.0000 0.0010 -0.0150 0.1050 -0.4550 1.3650 -3.0030 5.0050 -6.4350 6.4350 -5.0050 3.0030 -1.3650 0.4550 -0.1050 0.0150 -0.0010

Assertion failed.