Wolfram Language Fast Introduction for Math Students
Get Started »

Probability

The Wolfram Language contains a wide range of functions for probability, as well as hundreds of symbolic distributions.

Calculate factorials using mathematical notation:

In[1]:=
Click for copyable input
5!
Out[1]=

For combinations, use Binomial:

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

Compute probabilities for a binomial distribution:

(Type ESCdistESC for the symbol.)
In[1]:=
Click for copyable input
Probability[x == 1, x \[Distributed] BinomialDistribution[1, 1/2]]
Out[1]=

Calculate the expectation of a polynomial expression:

In[2]:=
Click for copyable input
Expectation[2 x + 3, x \[Distributed] NormalDistribution[]]
Out[2]=

Get the PDF for a normal distribution in symbolic form:

In[1]:=
Click for copyable input
PDF[NormalDistribution[0, 1], x]
Out[1]=

Make a Plot of the result:

In[2]:=
Click for copyable input
Plot[%, {x, -5, 5}, Filling -> Axis]
Out[2]=

Free-form input can be used to calculate the probability of real-world events:

In[1]:=
X
birthday problem 18 people
Out[1]=

QUICK REFERENCE: Combinatorial Functions »

QUICK REFERENCE: Probability & Statistics »