Skip to content
FutureBlitz

    Install

    Import std.algo.combinatorics

    Binomial

    std.algo.combinatorics

    function

    @PanicsAtCaller Public Function Binomial(n: Int, k: Int): Long

    The number of ways to choose k of n things, "n choose k": 0 for a k below 0 or above n. A negative n panics, and so does a count too large for a Long.

    Examples

    Expect(Binomial(5, 2) == 10)
    Expect(Binomial(5, 6) == 0)

    std/algo/combinatorics.fb, line 226

    Report an issue with this page or with FutureBlitz on GitHub.