MathPHP\Probability\CombinatoricsAxiomsTest::testLahNumberIdentityKEqualsTwo PHP Method

testLahNumberIdentityKEqualsTwo() public method

Axiom: L(n,2) = (n - 1)n! / 2 Lah number identity when k is 2
    public function testLahNumberIdentityKEqualsTwo(int $n)
    {
        // Skip exception where n < k
        if ($n === 1) {
            return;
        }
        $L⟮n、1⟯ = Combinatorics::lahNumber($n, 2);
        $⟮n−1⟯n!/2 = ($n - 1) * Combinatorics::factorial($n) / 2;
        $this->assertEquals($L⟮n、1⟯, $⟮n−1⟯n!/2);
    }