/** * Typed Probability & Combinatorics Functions * * Promotes genuinely-missing exports from the activated `probability/` layer that * are not already surfaced by `typed/distributions.ts` (PDF/PMF/CDF/entropy) or * `typed/special.ts` (erf, beta, bessel, …). * * After dedup audit (2026-05-24): * * | mathjs name | Promote? | Existing surface (if any) | Rationale | * | ------------------ | -------- | ---------------------------------------------- | ------------------------------------------------ | * | bernoulli | YES | — | genuinely missing (bernoulliPMF ≠ Bernoulli number) | * | combinations | YES | — | genuinely missing | * | combinationsWithRep| YES | — | genuinely missing | * | factorial | SKIP | factories/index.ts (tier 7) exports `factorial`| already in active factory surface | * | gamma | SKIP | factories/index.ts (tier 6) exports `gamma` | needs Complex/BigNumber factory deps; in scope | * | kldivergence | SKIP | factories/index.ts (tier 13) | needs matrix/sum/divide factory wiring | * | lgamma | SKIP | factories/index.ts (tier 1) | needs WASM bridge + Complex; already wired | * | multinomial | YES | — | genuinely missing; clean number[] → number impl | * | permutations | YES | — | genuinely missing | * | pickRandom | YES | — | genuinely missing | * | random | YES | — | genuinely missing (scalar seeded-RNG) | * | randomInt | YES | — | genuinely missing | * * 8 of 12 promoted; 4 skipped (already in the active factory surface under the * same name with richer type coverage than can be achieved in a clean typed/ * reimplementation). * * @packageDocumentation */ /** * Return the n-th Bernoulli number. * * B_0=1, B_1=-1/2, B_{odd>1}=0. * For even n, uses the cotangent-coefficient recursion. * * @example * bernoulli(0) // 1 * bernoulli(1) // -0.5 * bernoulli(2) // 1/6 ≈ 0.16666… * bernoulli(4) // -1/30 * bernoulli(7) // 0 (all odd B_n for n > 1 are zero) */ export declare const bernoulli: import("@danielsimonjr/mathts-core").TypedFunction; /** * Compute the binomial coefficient C(n, k) — the number of ways of choosing * k unordered elements from n elements without replacement. * * @example * combinations(5, 2) // 10 * combinations(7, 5) // 21 * combinations(10, 0) // 1 */ export declare const combinations: import("@danielsimonjr/mathts-core").TypedFunction; /** * Compute the number of ways of choosing k unordered elements from n elements * WITH replacement: C(n + k - 1, k). * * @example * combinationsWithRep(7, 5) // 462 * combinationsWithRep(5, 2) // 15 */ export declare const combinationsWithRep: import("@danielsimonjr/mathts-core").TypedFunction; /** * Compute the multinomial coefficient n! / (a1! * a2! * … * am!) where * n = a1 + a2 + … + am. * * @param a - Array of positive integers * @returns Multinomial coefficient as a number * * @example * multinomial([2, 1, 1]) // 12 (= 4! / (2! * 1! * 1!)) * multinomial([1, 1]) // 2 * multinomial([3]) // 1 */ export declare const multinomial: import("@danielsimonjr/mathts-core").TypedFunction; /** * Compute the number of ordered subsets of k elements from n elements: * P(n, k) = n! / (n-k)! * * When called with a single argument, returns n! (all permutations of n items). * * @example * permutations(5) // 120 (= 5!) * permutations(5, 3) // 60 (= 5*4*3) */ export declare const permutations: import("@danielsimonjr/mathts-core").TypedFunction; /** * Reset the internal RNG used by `random`, `randomInt`, and `pickRandom`. * * Pass `null` to re-initialize with a time-based seed (non-reproducible). * Pass a string or number for a reproducible sequence. * * @example * seedProbabilityRng('my-seed-42'); * random(); // reproducible * randomInt(10); // same sequence */ export declare function seedProbabilityRng(seed: string | number | null): void; /** * Return a uniform random number in [min, max). * * Overloads: * - `random()` → [0, 1) * - `random(max)` → [0, max) * - `random(min, max)` → [min, max) * * Uses the shared seeded PRNG (reset via `seedProbabilityRng`). * * @example * seedProbabilityRng('test'); * random(); // always the same value after a given seed * random(100); // uniform in [0, 100) * random(30, 40); // uniform in [30, 40) */ export declare const random: import("@danielsimonjr/mathts-core").TypedFunction; /** * Return a uniform random integer in [min, max). * * Overloads: * - `randomInt()` → 0 or 1 * - `randomInt(max)` → integer in [0, max) * - `randomInt(min, max)` → integer in [min, max) * * Uses the shared seeded PRNG (reset via `seedProbabilityRng`). * * @example * seedProbabilityRng('test'); * randomInt(10); // integer in [0, 10) * randomInt(30, 40); // integer in [30, 40) */ export declare const randomInt: import("@danielsimonjr/mathts-core").TypedFunction; /** * Pick one or more random elements from an array, using uniform or weighted * sampling with replacement. * * Overloads: * - `pickRandom(array)` → single element (uniform) * - `pickRandom(array, n)` → n elements (uniform, with replacement) * - `pickRandom(array, weights)` → single element (weighted) * - `pickRandom(array, n, weights)` → n elements (weighted, with replacement) * * Uses the shared seeded PRNG (reset via `seedProbabilityRng`). * * @example * pickRandom([1, 2, 3, 4]) // one of the four values * pickRandom([1, 2, 3, 4], 2) // array of two values * pickRandom(['a','b','c'], 1, [1, 3, 1]) // 'b' chosen 3× more often */ export declare const pickRandom: import("@danielsimonjr/mathts-core").TypedFunction; /** * All typed probability & combinatorics functions promoted by Slice 4.6. * (Seeded-RNG state is shared; call `seedProbabilityRng` to reset.) */ export declare const typedProbability: { bernoulli: import("@danielsimonjr/mathts-core").TypedFunction; combinations: import("@danielsimonjr/mathts-core").TypedFunction; combinationsWithRep: import("@danielsimonjr/mathts-core").TypedFunction; multinomial: import("@danielsimonjr/mathts-core").TypedFunction; permutations: import("@danielsimonjr/mathts-core").TypedFunction; random: import("@danielsimonjr/mathts-core").TypedFunction; randomInt: import("@danielsimonjr/mathts-core").TypedFunction; pickRandom: import("@danielsimonjr/mathts-core").TypedFunction; }; //# sourceMappingURL=probability.d.ts.map