Skip to content

Commit a8cd69b

Browse files
committed
math.combinatorics: adding some more nCk tests
1 parent ad1a878 commit a8cd69b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

basis/math/combinatorics/combinatorics-tests.factor

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ math.combinatorics.private tools.test sequences sets ;
2020
{ 2598960 } [ 52 5 nCk ] unit-test
2121
{ 2598960 } [ 52 47 nCk ] unit-test
2222

23+
! Mirror identity: nCk(n, k) = nCk(n, n-k)
24+
{ t } [ 49 12 nCk 49 37 nCk = ] unit-test
25+
{ t } [ 20 5 nCk 20 15 nCk = ] unit-test
26+
27+
! Pascal's triangle identity: nCk(n, k) = nCk(n-1, k-1) + nCk(n-1, k)
28+
{ t } [ 49 12 nCk 48 11 nCk 48 12 nCk + = ] unit-test
29+
{ t } [ 10 4 nCk 9 3 nCk 9 4 nCk + = ] unit-test
2330

2431
{ { } } [ 0 factoradic ] unit-test
2532
{ { 1 0 } } [ 1 factoradic ] unit-test

0 commit comments

Comments
 (0)