Probability
Factorial
Factorial of a positive integer. For non-integers, x! = Γ(x + 1). This calculates the gamma function.
value!
Example:
5! returns 120
Combination
The number of combinations (without regard to order) of n things taken r at a time.
COMB(n,r)
Example: Suppose you want to know how many ways ve things can be combined two at a time.
COMB(5,2) returns 10
Permutation
Number of permutations (with regard to order) of n things taken r at a time: n!/(n–r)!.
PERM (n,r)
Example: Suppose you want to know how many permutations there are for ve things taken two at a time.
PERM(5,2) returns 20
Probability – Random
Number
Random number. With no argument, this function returns a random number between zero and one. With one
argument a, it returns a random number between 0 and a. With two arguments, a, and b, returns a random
number between a and b. With three arguments, n, a, and b, returns n random number between a and b.
RANDOM
RANDOM(a)
RANDOM(a,b)
RANDOM(n,a,b)
Integer
Random integer. With no argument, this function returns either 0 or 1 randomly. With one integer argument
a, it returns a random integer between 0 and a. With two arguments, a, and b, returns a random integer
between a and b. With three integer arguments, n, a, and b, returns n random integers between a and b.
RANDINT
RANDINT(a)
RANDINT(a,b)
RANDINT(n,a,b)
358 Chapter 22 Functions and commands
Komentarze do niniejszej Instrukcji