Statistics Toolbox
  Go to function:
    Search    Help Desk 
unidinv    Examples

Inverse of the discrete uniform cumulative distribution function.

Syntax

Description

unidinv(P,N) returns the smallest integer X such that the discrete uniform cdf evaluated at X is equal to or exceeds P. You can think of P as the probability of drawing a number as large as X out of a hat with the numbers 1 through N inside.

The argument P must lie on the interval [0 1] and N must be a positive integer. Each element of X is a positive integer.

Examples

A small change in the first parameter produces a large jump in output. The cdf and its inverse are both step functions. The example shows what happens at a step.



[ Previous | Help Desk | Next ]