b-random

▸ function bFlatRoots (d: number, a?: number, b?: number, seed?: number, odds?: number): object

Defined in predictive-random/bigint/b-random.ts:33

Generates and returns a polynomial with random roots (with coefficients given densely as an array of bigints from highest to lowest power, e.g. [5n,-3n,0n] represents the polynomial 5x^2 - 3x).

  • all roots will approximate real values so is not at all representative of a natural random root distribution

  • the exact same polynomial will be created on each call to this function if the same seed is used; this is by design to improve testing.

Parameters:

NameTypeDefault valueDescription
dnumber-the degree of the polynomials
anumber0defaults to 0; the lower bound of the coefficients
bnumber1defaults to 1; the upper bound of the coefficients
seednumberSEEDdefaults to 123456789; a seed value in [0,4294967296]
oddsnumber0defaults to 0; the odds that a root will be doubled (applied recursively so that some roots could be tripled, etc.

Returns: object

NameType
pbigint[]
seednumber

▸ function bFlatRootsArr (n: number, d: number, a?: number, b?: number, seed?: number, odds?: number): bigint[][]

Defined in predictive-random/bigint/b-random.ts:67

Generates and returns an array of polynomials with random roots (with coefficients given densely as an array of bigints from highest to lowest power, e.g. [5n,-3n,0n] represents the polynomial 5x^2 - 3x).

  • all roots will approximate real values so is not at all representative of a natural random root distribution

  • the exact same polynomials will be created on each call to this function if the same seed is used; this is by design to improve testing.

Parameters:

NameTypeDefault valueDescription
nnumber-the number of polynomials to generate.
dnumber-the degree of the polynomials
anumber0defaults to 0; the lower bound of the coefficients
bnumber1defaults to 1; the upper bound of the coefficients
seednumberSEEDdefaults to 123456789; a seed value in [0,4294967296]
oddsnumber0defaults to 0; the odds that a root will be doubled (applied recursively so that some roots could be tripled, etc.

Returns: bigint[][]


▸ function bFlatCoefficients (d: number, a?: number, b?: number, seed?: number): object

Defined in predictive-random/bigint/b-random.ts:96

Generates and returns a polynomial with random coefficients (with coefficients given densely as an array of bigints from highest to lowest power, e.g. [5n,-3n,0n] represents the polynomial 5x^2 - 3x).

  • the exact same polynomials will be created on each call to this function if the same seed is used; this is by design to improve testing.

Parameters:

NameTypeDefault valueDescription
dnumber-the length of the polynomial coefficients array
anumber0defaults to 0; the lower bound of the coefficients
bnumber1defaults to 1; the upper bound of the coefficients
seednumberSEEDdefaults to 123456789; a seed value in [0,4294967296]

Returns: object

NameType
pbigint[]
seednumber

▸ function bFlatCoefficientsArr (n: number, d: number, a?: number, b?: number, seed?: number, odds?: number): bigint[][]

Defined in predictive-random/bigint/b-random.ts:126

Generates and returns an array of polynomials with random coefficients (with coefficients given densely as an array of bigints from highest to lowest power, e.g. [5n,-3n,0n] represents the polynomial 5x^2 - 3x).

  • the exact same polynomials will be created on each call to this function if the same seed is used; this is by design to improve testing.

Parameters:

NameTypeDefault valueDescription
nnumber-the number of polynomials to generate.
dnumber-the length of the polynomial coefficients array
anumber0defaults to 0; the lower bound of the coefficients
bnumber1defaults to 1; the upper bound of the coefficients
seednumberSEEDdefaults to 123456789; a seed value in [0,4294967296]
oddsnumber0defaults to 0; the odds that a root will be doubled (applied recursively so that some roots could be tripled, etc.

Returns: bigint[][]