Download Statistics Toolbox User's Guide

Transcript
unidrnd
Purpose
Syntax
unidrnd
Random numbers from the discrete uniform distribution.
R = unidrnd(N)
R = unidrnd(N,mm)
R = unidrnd(N,mm,nn)
Description
The discrete uniform distribution arises from experiments equivalent to
drawing a number from one to N out of a hat.
R = unidrnd(N) generates discrete uniform random numbers with maximum,
N. The size of R is the size of N.
R = unidrnd(N,mm) generates discrete uniform random numbers with
maximum, N. mm is a 1-by-2 vector that contains the row and column dimensions
of R.
R = unidrnd(N,mm,nn) generates discrete uniform random numbers with
maximum, N. The scalars mm and nn are the row and column dimensions of R.
The parameter, N, must have positive integer elements.
Examples
In the Massachusetts lottery a player chooses a four digit number. Generate
random numbers for Monday through Saturday.
numbers = unidrnd(10000,1,6) – 1
numbers =
2189
2-224
470
6788
6792
9346