This function evaluates the discrete uniform probability density function.
Function Return Value
UNDPR — Function value, the probability that a random variable from a uniform distribution having scale parameter N will be equal to IX. (Output)
Required Arguments
IX — Argument for which the discrete uniform probability density function is to be evaluated. (Input)
N — Scale parameter. N must be greater than 0. (Input)
FORTRAN 90 Interface
Generic: UNDPR (IX, N)
Specific: The specific interface names are S_UNDPR and D_UNDPR.
FORTRAN 77 Interface
Single: UNDPR (IX, N)
Double: The double precision name is DUNDPR.
Description
The discrete uniform PDF is defined for positive integers x in the range 1, …, N, N > 0. It has the value , and y = 0, for x > N. Allowing the function to accept values of x resulting in y = 0, for x > N is provided as a convenience to the user. Values of x ≤ 0 are errors.
Example
In this example, we evaluate the discrete uniform probability density function at IX = 3, N = 5.