PHP Class MathPHP\Probability\CombinatoricsAxiomsTest
If all the combinatorics math is implemented properly, these tests should
all work out according to the axioms.
Axioms tested:
- Lah numbers, rising and falling factorials
- x⁽ⁿ⁾ = ∑ L⟮n,k⟯ x₍k₎
- x₍n₎ = ∑ (-1)ⁿ⁻ᵏ L(n,k) x⁽ᵏ⁾
- L(n,1) = n!
- L(n,2) = (n - 1)n! / 2
- L(n,n) = 1
ファイルを表示
Open project: markrogoyski/math-php
Public Methods
Method Details
dataProivderForLahNumberIdentities()
public method
dataProivderForLahNumbers()
public method
testFallingFactorialAsLahNumberAndRisingFactorial()
public method
Axiom: x₍n₎ = ∑ (-1)ⁿ⁻ᵏ L(n,k) x⁽ᵏ⁾
Falling factorial can be represented as the summation of Lah numbers and rising factorials
testLahNumberIdentityKEqualsOne()
public method
Axiom: L(n,1) = n!
Lah number identity when k is 1
testLahNumberIdentityKEqualsTwo()
public method
Axiom: L(n,2) = (n - 1)n! / 2
Lah number identity when k is 2
testLahNumberIdentityNNEqualsOne()
public method
Axiom: L(n,n) = 1
Lah number identity when n = n
testRisingFactorialAsLahNumberAndFallingFactorial()
public method
Axiom: x⁽ⁿ⁾ = L⟮n,k⟯ x₍k₎
Rising factorial can be represented as the summation of Lah numbers and falling factorials