Probability

Probability[pred, xDistributeddist]
gives the probability for an event that satisfies the predicate pred under the assumption that x follows the probability distribution dist.

Probability[pred, xDistributeddata]
gives the probability for an event that satisfies the predicate pred under the assumption that x follows the probability distribution given by data.

Probability[pred, {x1, x2, ...}Distributeddist]
gives the probability that an event satisfies pred under the assumption that follows the multivariate distribution dist.

Probability[pred, {x1Distributeddist1, x2Distributeddist2, ...}]
gives the probability that an event satisfies pred under the assumption that , , ... are independent and follow the distributions , , ....

Probability[pred1Conditionedpred2, ...]
gives the conditional probability of given .

Details and OptionsDetails and Options

  • can be entered as x EscdistEsc dist or .
  • can be entered as EsccondEsc or .
  • For a continuous distribution dist, the probability of pred is given by where is the probability density function of dist and the integral is taken over the domain of dist.
  • For a discrete distribution dist, the probability of pred is given by where is the probability density function of dist and the summation is taken over the domain of dist.
  • For a dataset data, the probability of pred is given by Sum[Boole[pred], {x, data}]/Length[data].
  • Univariate data is given as a list of values and multivariate data is given as a list of vectors .
  • Probability[pred, {x1Distributeddist1, x2Distributeddist2}] corresponds to Probability[Probability[pred, x2Distributeddist2], x1Distributeddist1] so that the last variable is summed or integrated first.
  • N[Probability[...]] calls NProbability for probabilities that cannot be evaluated symbolically.
  • The following options can be given:
  • Assumptions$Assumptionsassumptions to make about parameters
    GenerateConditionsFalsewhether to generate conditions on parameters
    MethodAutomaticwhat method to use

ExamplesExamplesopen allclose all

Basic Examples (3)Basic Examples (3)

Compute the probability of a simple event:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=
In[4]:=
Click for copyable input
Out[4]=

Compute the probability of nonlinear and logical combination of inequalities:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=
In[4]:=
Click for copyable input
Out[4]=

Compute a conditional probability:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
New in 8
New to Mathematica? Find your learning path »
Have a question? Ask support »