The functions in this topic are useful for solving probability problems.


euler_gamma is Euler's γ (gamma) constant.  The constant can be entered by typing euler_gamma on the expression entry line.  The lower case Greek letter γ (gamma) on the Greek symbol toolbar is not associated with Euler's gamma constant, so that γ can be used as the name of a user-defined variable or function.  In exact mode arithmetic, euler_gamma remains symbolic since it is an irrational number.  In approximate or mixed mode arithmetic, it simplifies to an approximation for γ accurate to the current precision.  For example,

APPROX(euler_gamma, 25)

simplifies to 0.5772156649015328606065121.


z! is the factorial function z!, defined for all real and complex z.  If n is a positive integer, n! is the product of the first n integers.  For example,

VECTOR(k!, k, 0, 9)

simplifies to

[1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880]

and

(3/2)!

simplifies to

 3·√π 
——————
   4  


GAMMA(z) is the gamma function Γ(z), defined for all real and complex z.  If z is nonnumeric, Γ(z) simplifies to z-1 factorial.  The function can be entered by typing GAMMA on the expression entry line, or by clicking on the capital Greek letter Γ (Gamma) on the Greek symbol toolbar.  The incomplete gamma function and its relatives are defined in ProbabilityFunctions.mth0FMTUG.  For example,

VECTOR(GAMMA(k), k, 1, 10)

simplifies to

[1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880]


DIGAMMA(z) is the digamma function Ψ(z).  Ψ(z) is defined as the first derivative of the natural logarithm of Γ(z).  The function can be entered by typing DIGAMMA on the expression entry line.  The capital Greek letter Ψ (Psi) on the Greek symbol toolbar is not associated with the digamma function, so that Ψ can be used as the name of a user-defined variable or function.  If k is a nonnegative integer, Σ(1/n, n, 1, k) equals Ψ(k+1) + γ (Euler's gamma constant).  For example,

VECTOR(DIGAMMA(k + 1) + euler_gamma, k, 0, 7)

simplifies to

      3    11    25    137    49    363
0, 1, ———, ————, ————, —————, ————, —————
      2     6    12     60    20    140


PERM(m, n) is the number of permutations or arrangements of m things taken n at a time.  If z and w are nonnumeric, PERM(z, w) simplifies to z!/(z-w)!.  For example,

PERM(n, n)

simplifies to n!.


COMB(m, n) is the number of combinations or groupings of m things taken n at a time.  If z and w are nonnumeric, COMB(z, w) simplifies to z!/(w!·(z-w)!).  Note that COMB(m, n) is also the binomial coefficient of m and n.  For example,

VECTOR(VECTOR(COMB(j, k), k, 0, 8), j, 0, 8)

simplifies to the first 9 rows of Pascal's triangle.


RANDOM(n) invokes a pseudo-random number generator.  Random numbers are derived from a random number state variable, s, that is updated using the rule 2654435721·s + 1 mod 2^32 each time a random number is generated.


       If n>1 is an integer, RANDOM(n) simplifies to a random integer in the interval [0, n).  For example, each time RANDOM(6) is simplified, it returns with equal probability one of the 6 integers from the set {­0, 1, 2, 3, 4, 5}.

       RANDOM(1) simplifies to a random number in the interval [0, 1).

       If n<0 is an integer, RANDOM(n) simplifies to -n and initializes the random number state variable to -n.

       RANDOM(0) simplifies to the time in centiseconds since the current calendar year began and initializes the random number state variable to that time.


Other Built-in Functions and ConstantsBuilt_in_Functions_and_Constants 

Created with the Personal Edition of HelpNDoc: What is a Help Authoring tool?