# binomialTest

> **binomialTest**(`successes`, `trials`, `options?`): [`BinomialTestResult`](/reference/knotkit/hypothesis-test/interfaces/binomialtestresult/)

Defined in: [packages/hypothesis-test/src/binomial-test.ts:28](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/hypothesis-test/src/binomial-test.ts#L28)

Test the success probability of independent Bernoulli trials. One-sided tails include the observed count. The two-sided test sums all outcomes whose mass is at most that of the observed count, with a relative allowance of 1e-7. Uses O(trials) time and constant working storage.

## Parameters

### successes

`number`

### trials

`number`

### options?

[`BinomialTestOptions`](/reference/knotkit/hypothesis-test/interfaces/binomialtestoptions/)

## Returns

[`BinomialTestResult`](/reference/knotkit/hypothesis-test/interfaces/binomialtestresult/)

## Throws

With `INVALID_COUNT`, `SUCCESSES_EXCEED_TRIALS`, or `INVALID_OPTION`.

## Throws

With `INVALID_PARAMETER` outside the supported binomial parameter domain.
