# samplePair

> **samplePair**(`random`, `lowerBound`, `upperExclusive`): readonly \[`number`, `number`]

Defined in: [packages/sampling/src/sample-pair.ts:23](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/sampling/src/sample-pair.ts#L23)

Sample an ascending pair of distinct integers in `[lowerBound, upperExclusive)`.

Runs in O(1) time and auxiliary space and does not mutate its inputs.

## Parameters

### random

[`RandomSource`](/reference/knotkit/prng/type-aliases/randomsource/)

### lowerBound

`number`

### upperExclusive

`number`

## Returns

readonly \[`number`, `number`]

## Throws

With code `INVALID_RANGE` when the bounds are not safe integers spanning between 2 and 2^32 values.

## Throws

With code `INVALID_SOURCE_VALUE` when the random source returns a value outside `[0, 1)`.
