Random Functions

Previous  Terms  Next

TinkerPlots_logoV2-rgb


Random Functions

random( )

A random number between 0 and 1.

random(max)

A random (real) number between 0 and max.

random(min, max)

A random (real) number between min and max.

randomInteger(min, max)

A random integer between its two arguments, inclusive. For example, randomInteger(1, 6) gives 1, 2, 3, 4, 5, or 6, chosen at random.

randomPick(a1, a2, . . .)

This function gives you an element randomly chosen from a list of any number of arguments. For example:

randomPick(1, 2, 3, 4, 5, 6) makes a die.

randomPick("heads", "tails") makes a coin.

randomPick("Male", Male", "Female") gives you a population that is two-thirds "Male."

randomBinomial(n, p)

n = number of trials

p = probability of success

This function gives you a random integer from a binomial distribution. For example, randomBinomial(20, 0.5) gives the number of heads in 20 tosses of a fair coin.

randomNormal(mu, sd)

mu = the mean

sd = standard deviation

A random real number pulled from a normal distribution. For example, randomNormal(0, 1) gives you a number from a distribution with a mean of 0 and a standard deviation of 1.

randomGeometric(p)

mu = the probability of a "catch." Must be between 0 and 1.

A random nonnegative integer from a geometric distribution. You can think of the result as the number of turns it takes before you "catch" the case if the probability of catching it is the argument. Catching on the first try yields 0.

randomExponential(mu)

mu = the mean. Must be positive.

A random real number greater than 0, pulled from a distribution that declines exponentially (so there are more near 0, just as in the geometric distribution). The larger the argument, the shallower the curve. Some people use the reciprocal of mu as the argument of their exponential distributions.

Other Random Number Functions

TinkerPlots has a number of less commonly encountered random number functions, each of which returns numbers from a different distribution. These include randomBeta, randomCauchy, randomChiSquare, randomF, randomGamma, randomLattice, randomPoisson, and randomT. The help text that appears at the bottom of the formula editor will provide some guidance for using these functions.


TinkerPlots Help

© 2012 Clifford Konold and Craig D. Miller