# stats::hypergeometricCDF

The (discrete) cumulative probability function of the hypergeometric distribution

### Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

## Syntax

```stats::hypergeometricCDF(`N`, `X`, `n`)
```

## Description

`stats::hypergeometricCDF(N, X, n)` returns a procedure representing the probability function

of the hypergeometric distribution with "population size" `N`, "success population size" `X` and "sample size" `n`.

The procedure `f:=stats::hypergeometricCDF(N, X, n)` can be called in the form `f(x)` with arithmetical expressions `x`. The return value of `f(x)` is either a floating-point number, an exact numerical value, or a symbolic expression:

If `x` is an integer, a rational or a floating point number, while `N` is a positive integer and both `X` and `n` are nonnegative integers, then an explicit numerical value is returned.

The function `f` reacts to properties of identifiers set via `assume`.

If any of the parameters is symbolic with properties as follows, then 0, 1 or a symbolic result is returned:

If x < max(0, n + X - N), then f(x) = 0.

If xmin(n, X), then f(x) = 1.

If X = N, then f(x) = 0 for x < n and f(x) = 1 for xn.

If n = N, then f(x) = 0 for x < X and f(x) = 1 for xX.

If X = N - 1, then f(x) = 0 for x < n - 1, for n - 1 ≤ x < n and f(x) = 1 for xn.

If n = N - 1, then f(x) = 0 for x < X - 1, for X - 1 ≤ x < X and f(x) = 1 for xX.

If X = 1, then for 0 ≤ x < 1 and f(x) = 1 for x ≥ 1.

If n = 1, then for 0 ≤ x < 1 and f(x) = 1 for x ≥ 1.

If X = 0 or n = 0, then f(x) = 1 for x ≥ 0.

If `x` and all parameters but `N` are numerical and the assumption on N is `assume(N > X)`, then symbolic values are returned.

`f(x)` returns the symbolic call ```stats::hypergeometricCDF(N, X, n)(x)``` in all other cases.

Numerical values for `N` are only accepted if they are positive integers.

Numerical values for `X` are only accepted if they are nonnegative integers.

Numerical values for `n` are only accepted if they are nonnegative integers.

 Note:   If `x` is a floating-point number, the result is a floating number provided N, X and n are numerical values. If `x` is an exact value, the result is a rational number.

Note that for large numbers, floating-point results are computed much faster than exact results. If floating-point approximations are desired, pass a floating-point number `x` to `stats::hypergeometricCDF`.

## Environment Interactions

The function is sensitive to the environment variable `DIGITS` which determines the numerical working precision.

## Examples

### Example 1

We compute the distribution function with N = 20, X = 4 and n = 3 at various points:

```f := stats::hypergeometricCDF(20, 4, 3): f(-1), f(0), f(1/2), f(1), f(2), f(PI), f(5)```

`f(-infinity), f(infinity)`

`f(-0.2), f(0.0), f(0.7), f(1.0), f(float(PI)), f(4.0)`

`delete f:`

### Example 2

We use symbolic arguments:

`f := stats::hypergeometricCDF(N, X, n): f(x), f(8), f(8.0)`

When real numbers are assigned to N, X and n, the function f starts to produce explicit results if the argument is numerical:

```N := 15: X := 6: n := 5: f(0), f(1), f(2.0), f(3.5), f(4)```

`delete f, N, X, n:`

### Example 3

If one or more parameters are symbolic, usually a symbolic call is returned. Some combinations of symbolic and numeric values for N, X, n and x, however, may yield symbolic or numeric results:

```f := stats::hypergeometricCDF(N, X, n): X := 1: f(-1), f(0), f(1/2), f(0.5), f(3/2), f(2.0)```

```X := N - 1: f(1), f(n-1), f(n)```

`delete X:`

### Example 4

If x and all parameters but N are numerical and N is assumed to be greater than X, a symbolic expression is returned:

```X := 6: assume(N > X): f := stats::hypergeometricCDF(N, X, 5): f(1), f(2), f(3)```

`delete f, N, X:`

## Parameters

 `N` The "population size": an arithmetical expression representing a positive integer `X` The "success population size": an arithmetical expression representing a nonnegative integer `n` The "sample size": an arithmetical expression representing a nonnegative integer