ProbabilityFunction - Maple Help

Student[Statistics]

 ProbabilityFunction
 compute the probability function

 Calling Sequence ProbabilityFunction(X, t, numeric_option,output_option)

Parameters

 X - algebraic; random variable t - algebraic; point (assumed to be an integer) numeric_option - (optional) equation of the form numeric=value where value is true or false output_option - (optional) equation of the form output=x where x is value, plot, or both inert_option - (optional) equation of the form inert=value where value is true or false

Description

 • The ProbabilityFunction function computes the probability function of the specified discrete random variable at the specified point.
 • The first parameter can be either a discrete random variable, or a continuous random variable.
 • If the option inert is not included or is specified to be inert=false, then the function will return the actual value of the result. If inert or inert=true is specified, then the function will return the formula of evaluating the actual value.

Computation

 • By default, all computations involving random variables are performed symbolically (see option numeric below).
 • If the option numeric is included, then the computation is done in floating point. Otherwise the computation is exact.
 • If the first parameter is a continuous random variable, then the result is always 0.
 • By default, the probability function of the specified random variable at the specified point is computed according to the rules mentioned above. To always compute the value numerically, specify the numeric or numeric = true option.

Examples

 > $\mathrm{with}\left({\mathrm{Student}}_{\mathrm{Statistics}}\right):$

Compute the value of the probability function of the binomial random variable with parameters $n$ and $p$.

 > $\mathrm{ProbabilityFunction}\left(\mathrm{BinomialRandomVariable}\left(n,p\right),x\right)$
 $\left\{\begin{array}{cc}{0}& {x}{<}{0}\\ \left(\genfrac{}{}{0}{}{{n}}{{x}}\right){}{{p}}^{{x}}{}{\left({1}{-}{p}\right)}^{{n}{-}{x}}& {\mathrm{otherwise}}\end{array}\right\$ (1)

Use numeric parameters.

 > $\mathrm{ProbabilityFunction}\left(\mathrm{BinomialRandomVariable}\left(10,\frac{1}{3}\right),5\right)$
 $\frac{{896}}{{6561}}$ (2)
 > $\mathrm{ProbabilityFunction}\left(\mathrm{BinomialRandomVariable}\left(10,\frac{1}{3}\right),5,\mathrm{numeric}\right)$
 ${0.1365645480}$ (3)

Use the output = plot option.

 > $\mathrm{ProbabilityFunction}\left(\mathrm{BinomialRandomVariable}\left(10,\frac{1}{3}\right),5,\mathrm{output}=\mathrm{plot}\right)$

Compute the value of the probability function of a continuous random variable at the specified point, and it should always be 0.

 > $\mathrm{ProbabilityFunction}\left(\mathrm{BetaRandomVariable}\left(2,3\right),5\right)$
 ${0}$ (4)
 > $\mathrm{ProbabilityFunction}\left(\mathrm{NormalRandomVariable}\left(8,5\right),2\right)$
 ${0}$ (5)

Define a new random variable, and use the inert option.

 > $X≔\mathrm{BinomialRandomVariable}\left(7,\frac{1}{2}\right)+\mathrm{NegativeBinomialRandomVariable}\left(3,\frac{1}{2}\right):$
 > $\mathrm{ProbabilityFunction}\left(X,2,\mathrm{inert}\right)$
 ${\sum }_{{{u}}_{{1}}{=}{0}}^{{\mathrm{\infty }}}{}\left(\left\{\begin{array}{cc}{0}& {{u}}_{{1}}{<}{0}\\ \frac{\left(\genfrac{}{}{0}{}{{2}{+}{{u}}_{{1}}}{{{u}}_{{1}}}\right){}{\left(\frac{{1}}{{2}}\right)}^{{{u}}_{{1}}}}{{8}}& {\mathrm{otherwise}}\end{array}\right\\right){}\left(\left\{\begin{array}{cc}{0}& {-}{{u}}_{{1}}{<}{-2}\\ \left(\genfrac{}{}{0}{}{{7}}{{2}{-}{{u}}_{{1}}}\right){}{\left(\frac{{1}}{{2}}\right)}^{{2}{-}{{u}}_{{1}}}{}{\left(\frac{{1}}{{2}}\right)}^{{5}{+}{{u}}_{{1}}}& {\mathrm{otherwise}}\end{array}\right\\right)$ (6)
 > $\mathrm{evalf}\left(\mathrm{ProbabilityFunction}\left(X,2,\mathrm{inert}\right)\right)$
 ${0.03222656250}$ (7)
 > $\mathrm{ProbabilityFunction}\left(X,2,\mathrm{numeric}\right)$
 ${0.03222656250}$ (8)

Now we use the output = both option on a Poisson random variable, which is discrete.

 > $\mathrm{probability},\mathrm{graph}≔\mathrm{ProbabilityFunction}\left(\mathrm{PoissonRandomVariable}\left(4\right),7,\mathrm{output}=\mathrm{both}\right):$
 > $\mathrm{probability}$
 $\frac{{1024}{}{{ⅇ}}^{{-4}}}{{315}}$ (9)
 > $\mathrm{graph}$

References

 Stuart, Alan, and Ord, Keith. Kendall's Advanced Theory of Statistics. 6th ed. London: Edward Arnold, 1998. Vol. 1: Distribution Theory.

Compatibility

 • The Student[Statistics][ProbabilityFunction] command was introduced in Maple 18.