ℹ️ Skipped - page is already crawled
| Filter | Status | Condition | Details |
|---|---|---|---|
| HTTP status | PASS | download_http_code = 200 | HTTP 200 |
| Age cutoff | PASS | download_stamp > now() - 6 MONTH | 0 months ago |
| History drop | PASS | isNull(history_drop_reason) | No drop reason |
| Spam/ban | PASS | fh_dont_index != 1 AND ml_spam_score = 0 | ml_spam_score=0 |
| Canonical | PASS | meta_canonical IS NULL OR = '' OR = src_unparsed | Not set |
| Property | Value |
|---|---|
| URL | https://www.statlect.com/probability-distributions/beta-distribution |
| Last Crawled | 2026-04-17 12:58:55 (5 hours ago) |
| First Indexed | 2016-05-05 07:46:26 (9 years ago) |
| HTTP Status Code | 200 |
| Meta Title | Beta distribution | Properties, proofs, exercises |
| Meta Description | The beta distribution explained, with examples, solved exercises and detailed proofs of important results. |
| Meta Canonical | null |
| Boilerpipe Text | The Beta distribution is a continuous probability distribution often used to
model the uncertainty about the probability of success of an experiment.
Table of contents
How the distribution is used
Uncertainty about the probability of success
Data collection
Updating of priors
Definition
Expected value
Variance
Higher moments
Moment generating function
Characteristic function
Distribution function
More details
Relation to the uniform distribution
Relation to the binomial distribution
Solved exercises
Exercise 1
Exercise 2
Exercise 3
How the distribution is used
The Beta distribution can be used to analyze probabilistic experiments that
have only two possible outcomes:
success, with probability
;
failure, with probability
.
These experiments are called Bernoulli experiments.
Uncertainty about the probability of success
Suppose that
is unknown and all its possible values are deemed equally likely.
This uncertainty can be described by assigning to
a
uniform distribution
on the interval
.
This is appropriate because:
,
being a
probability
, can take only values between
and
;
the uniform distribution assigns equal probability density to all points in
the interval, which reflects the fact that no possible value of
is, a priori, deemed more likely than all the others.
Data collection
Now, suppose that:
we perform
independent repetitions of the experiment;
we observe
successes and
failures.
Updating of priors
After performing the experiments, we want to know how we should revise the
distribution initially assigned to
,
in order to properly take into account the information provided by the
observed outcomes.
In other words, we want to calculate the
conditional
distribution
of
(also called posterior distribution), conditional on the number of successes
and failures we have observed.
The result of this calculation is a Beta distribution. In particular, the
conditional distribution of
,
conditional on having observed
successes out of
trials, is a Beta distribution with parameters
and
.
Definition
The Beta distribution is characterized as follows.
A random variable having a Beta distribution is also called a Beta random
variable.
The following is a proof that
is a
legitimate probability density function
.
Proof
Expected value
The
expected value
of a Beta random variable
is
Proof
It
can be derived as
follows:
Variance
The
variance
of a Beta random variable
is
Proof
Higher moments
The
-th
moment
of a Beta random variable
is
Proof
By
the definition of moment, we
have
where in step
we have used recursively the fact that
.
Moment generating function
The
moment generating function
of a Beta
random variable
is defined for any
and it
is
Proof
The above formula for the moment generating function might seem impractical to
compute because it involves an infinite sum as well as products whose number
of terms increase indefinitely.
However, the
function
is
a function, called
Confluent
hypergeometric function of the first kind
, that has been extensively
studied in many branches of mathematics. Its properties are well-known and
efficient algorithms for its computation are available in most software
packages for scientific computation.
Characteristic function
The
characteristic function
of a Beta random
variable
is
Proof
The
derivation of the characteristic function is almost identical to the
derivation of the moment generating function (just replace
with
in that proof).
Comments made about the moment generating function, including those about the
computation of the Confluent hypergeometric function, apply also to the
characteristic function, which is identical to the mgf except for the fact
that
is replaced with
.
Distribution function
The distribution function of a Beta random variable
is
where
the
function
is
called
incomplete Beta function
and is usually computed by means of specialized computer algorithms.
Proof
More details
In the following subsections you can find more details about the Beta
distribution.
Relation to the uniform distribution
The following proposition states the relation between the Beta and the uniform
distributions.
Proposition
A Beta distribution with parameters
and
is a uniform distribution on the interval
.
Proof
Relation to the binomial distribution
The following proposition states the relation between the Beta and the
binomial distributions.
Proposition
Suppose
is a random variable having a Beta distribution with parameters
and
.
Let
be another random variable such that its distribution conditional on
is a
binomial distribution
with parameters
and
.
Then, the conditional distribution of
given
is a Beta distribution with parameters
and
.
Proof
We are dealing with one continuous random
variable
and one discrete random variable
(together, they form what is called a random vector with mixed coordinates).
With a slight abuse of notation, we will proceed as if also
were continuous, treating its probability mass function as if it were a
probability density function. Rest assured that this can be made fully
rigorous (by defining a probability density function with respect to a
counting measure
on the support of
).
By assumption
has a binomial distribution conditional on
,
so that its
conditional
probability mass function
is
where
is a
binomial coefficient
.
Also, by assumption
has a Beta distribution, so that is probability density function
is
Therefore,
the
joint
probability density function
of
and
is
Thus,
we have factored the joint probability density function
as
where
is
the probability density function of a Beta distribution with parameters
and
,
and the function
does not depend on
.
By a result proved in the lecture entitled
Factorization of joint probability density
functions
, this implies that the probability density function of
given
is
Thus,
as we wanted to demonstrate, the conditional distribution of
given
is a Beta distribution with parameters
and
.
By combining this proposition and the previous one, we obtain the following
corollary.
Proposition
Suppose that
is a random variable having a uniform distribution. Let
be another random variable such that its distribution conditional on
is a binomial distribution with parameters
and
.
Then, the conditional distribution of
given
is a Beta distribution with parameters
and
.
This proposition constitutes a formal statement of what we said in the
introduction of this lecture in order to motivate the Beta distribution.
Remember that the number of successes obtained in
independent repetitions of a random experiment having probability of success
is a binomial random variable with parameters
and
.
According to the proposition above, when the probability of success
is a priori unknown and all possible values of
are deemed equally likely (they have a uniform distribution), observing the
outcome of the
experiments leads us to revise the distribution assigned to
,
and the result of this revision is a Beta distribution.
Solved exercises
Below you can find some exercises with explained solutions.
Exercise 1
A production plant produces items that have a probability
of being defective.
The plant manager does not know
,
but from past experience she expects this probability to be equal to
.
Furthermore, she quantifies her uncertainty about
by attaching a
standard
deviation
of
to her
estimate.
After consulting with an expert in statistics, the manager decides to use a
Beta distribution to model her uncertainty about
.
How should she set the two parameters of the distribution in order to match
her priors about the expected value and the standard deviation of
?
Solution
We know that the expected value of a Beta
random variable with parameters
and
is
while
its variance
is
The
two parameters need to be set in such a way
that
This
is accomplished by finding a solution to the following system of two equations
in two
unknowns:
where
for notational convenience we have set
and
.
The first equation
gives
or
By
substituting this into the second equation, we
get
or
Then
we divide the numerator and denominator on the left-hand side by
:
By
computing the products, we
get
By
taking the reciprocals of both sides, we
have
By
multiplying both sides by
,
we
obtain
Thus
the value of
is
and
the value of
is
By
plugging our numerical values into the two formulae, we
obtain
Exercise 2
After choosing the parameters of the Beta distribution so as to represent her
priors about the probability of producing a defective item (see previous
exercise), the plant manager now wants to update her priors by observing new
data.
She decides to inspect a production lot of 100 items, and she finds that 3 of
the items in the lot are defective.
How should she change the parameters of the Beta distribution in order to take
this new information into account?
Solution
Under the hypothesis that the items are
produced independently of each other, the result of the inspection is a
binomial random variable with parameters
and
.
But updating a Beta distribution based on the outcome of a binomial random
variable gives as a result another Beta distribution. Moreover, the two
parameters
and
of the updated Beta distribution
are
Exercise 3
After updating the parameters of the Beta distribution (see previous
exercise), the plant manager wants to compute again the expected value and the
standard deviation of the probability of finding a defective item.
Can you help her?
Solution
We just need to use the formulae for the
expected value and the variance of a Beta
distribution:
and
plug in the new values we have found for
and
,
that
is,
The
result
is
How to cite
Please cite as:
Taboga, Marco (2021). "Beta distribution", Lectures on probability theory and mathematical statistics. Kindle Direct Publishing. Online appendix. https://www.statlect.com/probability-distributions/beta-distribution. |
| Markdown | 
[StatLect](https://www.statlect.com/)
[Index](https://www.statlect.com/) \> [Probability distributions](https://www.statlect.com/probability-distributions/)
# Beta distribution
by [Marco Taboga](https://www.statlect.com/about/#author), PhD
The Beta distribution is a continuous probability distribution often used to model the uncertainty about the probability of success of an experiment.

Table of contents
1. [How the distribution is used](https://www.statlect.com/probability-distributions/beta-distribution#hid2)
1. [Uncertainty about the probability of success](https://www.statlect.com/probability-distributions/beta-distribution#hid3)
2. [Data collection](https://www.statlect.com/probability-distributions/beta-distribution#hid4)
3. [Updating of priors](https://www.statlect.com/probability-distributions/beta-distribution#hid5)
2. [Definition](https://www.statlect.com/probability-distributions/beta-distribution#hid6)
3. [Expected value](https://www.statlect.com/probability-distributions/beta-distribution#hid7)
4. [Variance](https://www.statlect.com/probability-distributions/beta-distribution#hid8)
5. [Higher moments](https://www.statlect.com/probability-distributions/beta-distribution#hid9)
6. [Moment generating function](https://www.statlect.com/probability-distributions/beta-distribution#hid10)
7. [Characteristic function](https://www.statlect.com/probability-distributions/beta-distribution#hid11)
8. [Distribution function](https://www.statlect.com/probability-distributions/beta-distribution#hid12)
9. [More details](https://www.statlect.com/probability-distributions/beta-distribution#hid13)
1. [Relation to the uniform distribution](https://www.statlect.com/probability-distributions/beta-distribution#hid14)
2. [Relation to the binomial distribution](https://www.statlect.com/probability-distributions/beta-distribution#hid15)
10. [Solved exercises](https://www.statlect.com/probability-distributions/beta-distribution#hid16)
1. [Exercise 1](https://www.statlect.com/probability-distributions/beta-distribution#hid17)
2. [Exercise 2](https://www.statlect.com/probability-distributions/beta-distribution#hid18)
3. [Exercise 3](https://www.statlect.com/probability-distributions/beta-distribution#hid19)
## How the distribution is used
The Beta distribution can be used to analyze probabilistic experiments that have only two possible outcomes:
- success, with probability ;
- failure, with probability .
These experiments are called Bernoulli experiments.

### Uncertainty about the probability of success
Suppose that  is unknown and all its possible values are deemed equally likely.
This uncertainty can be described by assigning to  a [uniform distribution](https://www.statlect.com/probability-distributions/uniform-distribution) on the interval ![\$left\[ 0,1 ight\] \$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==).
This is appropriate because:
- , being a [probability](https://www.statlect.com/fundamentals-of-probability/probability), can take only values between  and ;
- the uniform distribution assigns equal probability density to all points in the interval, which reflects the fact that no possible value of  is, a priori, deemed more likely than all the others.
### Data collection
Now, suppose that:
- we perform  independent repetitions of the experiment;
- we observe  successes and  failures.
### Updating of priors
After performing the experiments, we want to know how we should revise the distribution initially assigned to , in order to properly take into account the information provided by the observed outcomes.
In other words, we want to calculate the [conditional distribution](https://www.statlect.com/fundamentals-of-probability/conditional-probability-distributions) of  (also called posterior distribution), conditional on the number of successes and failures we have observed.
The result of this calculation is a Beta distribution. In particular, the conditional distribution of , conditional on having observed  successes out of  trials, is a Beta distribution with parameters  and .
## Definition
The Beta distribution is characterized as follows.
Definition Let  be a [continuous random variable](https://www.statlect.com/glossary/absolutely-continuous-random-variable). Let its [support](https://www.statlect.com/glossary/support-of-a-random-variable) be the unit interval:![\[eq1\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)Let ![\[eq2\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). We say that  has a **Beta distribution** with shape parameters  and  if and only if its [probability density function](https://www.statlect.com/glossary/probability-density-function) is![\[eq3\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)where  is the [Beta function](https://www.statlect.com/mathematical-tools/beta-function).
A random variable having a Beta distribution is also called a Beta random variable.
The following is a proof that ![\[eq4\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is a [legitimate probability density function](https://www.statlect.com/fundamentals-of-probability/legitimate-probability-density-functions).
Proof
Non-negativity descends from the facts that ![\[eq5\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is non-negative when ![\[eq6\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![\[eq7\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==), and that ![\[eq8\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is strictly positive (it is a ratio of Gamma functions, which are strictly positive when their arguments are strictly positive - see the lecture entitled [Gamma function](https://www.statlect.com/mathematical-tools/gamma-function)). That the integral of ![\[eq9\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) over  equals  is proved as follows:![\[eq10\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)where we have used the integral representation ![\[eq11\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)a proof of which can be found in the lecture entitled [Beta function](https://www.statlect.com/mathematical-tools/beta-function).
## Expected value
The [expected value](https://www.statlect.com/fundamentals-of-probability/expected-value) of a Beta random variable  is![\[eq12\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)
Proof
It can be derived as follows:![\[eq13\]](https://www.statlect.com/images/beta-distribution__40.png)
## Variance
The [variance](https://www.statlect.com/fundamentals-of-probability/variance) of a Beta random variable  is![\[eq14\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)
Proof
It can be derived thanks to the usual [variance formula](https://www.statlect.com/glossary/variance-formula) (![\[eq15\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)):![\[eq16\]](https://www.statlect.com/images/beta-distribution__44.png)
## Higher moments
The \-th [moment](https://www.statlect.com/fundamentals-of-probability/moments) of a Beta random variable  is![\[eq17\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)
Proof
By the definition of moment, we have![\[eq18\]](https://www.statlect.com/images/beta-distribution__48.png)
where in step  we have used recursively the fact that ![\[eq19\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==).
## Moment generating function
The [moment generating function](https://www.statlect.com/fundamentals-of-probability/moment-generating-function) of a Beta random variable  is defined for any  and it is![\[eq20\]](https://www.statlect.com/images/beta-distribution__53.png)
Proof
By using the definition of moment generating function, we obtain![\[eq21\]](https://www.statlect.com/images/beta-distribution__54.png)Note that the moment generating function exists and is well defined for any  because the integral![\[eq22\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)is guaranteed to exist and be finite, since the integrand![\[eq23\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)is continuous in  over the bounded interval ![\$left\[ 0,1 ight\] \$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==).
The above formula for the moment generating function might seem impractical to compute because it involves an infinite sum as well as products whose number of terms increase indefinitely.
However, the function![\[eq24\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)is a function, called [Confluent hypergeometric function of the first kind](http://mathworld.wolfram.com/ConfluentHypergeometricFunctionoftheFirstKind.html), that has been extensively studied in many branches of mathematics. Its properties are well-known and efficient algorithms for its computation are available in most software packages for scientific computation.
## Characteristic function
The [characteristic function](https://www.statlect.com/fundamentals-of-probability/characteristic-function) of a Beta random variable  is![\[eq25\]](https://www.statlect.com/images/beta-distribution__62.png)
Proof
The derivation of the characteristic function is almost identical to the derivation of the moment generating function (just replace  with  in that proof).
Comments made about the moment generating function, including those about the computation of the Confluent hypergeometric function, apply also to the characteristic function, which is identical to the mgf except for the fact that  is replaced with .
## Distribution function
The distribution function of a Beta random variable  is![\[eq26\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)where the function![\[eq27\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)is called [incomplete Beta function](https://www.statlect.com/mathematical-tools/beta-function#incomplete) and is usually computed by means of specialized computer algorithms.
Proof
For , ![\[eq28\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==), because  cannot be smaller than . For , ![\[eq29\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) because  is always smaller than or equal to . For ![\[eq30\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==),![\[eq31\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)
## More details
In the following subsections you can find more details about the Beta distribution.
### Relation to the uniform distribution
The following proposition states the relation between the Beta and the uniform distributions.
Proposition A Beta distribution with parameters  and  is a uniform distribution on the interval ![\$left\[ 0,1 ight\] \$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==).
Proof
When  and , we have that ![\[eq32\]](https://www.statlect.com/images/beta-distribution__85.png)Therefore, the probability density function of a Beta distribution with parameters  and  can be written as ![\[eq33\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)But the latter is the probability density function of a uniform distribution on the interval ![\$left\[ 0,1 ight\] \$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==).
### Relation to the binomial distribution
The following proposition states the relation between the Beta and the binomial distributions.
Proposition Suppose  is a random variable having a Beta distribution with parameters  and . Let  be another random variable such that its distribution conditional on  is a [binomial distribution](https://www.statlect.com/probability-distributions/binomial-distribution) with parameters  and . Then, the conditional distribution of  given  is a Beta distribution with parameters  and .
Proof
We are dealing with one continuous random variable  and one discrete random variable  (together, they form what is called a random vector with mixed coordinates). With a slight abuse of notation, we will proceed as if also  were continuous, treating its probability mass function as if it were a probability density function. Rest assured that this can be made fully rigorous (by defining a probability density function with respect to a [counting measure](https://en.wikipedia.org/wiki/Counting_measure) on the support of ). By assumption  has a binomial distribution conditional on , so that its [conditional probability mass function](https://www.statlect.com/glossary/conditional-probability-mass-function) is ![\[eq34\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)where  is a [binomial coefficient](https://www.statlect.com/glossary/binomial-coefficient). Also, by assumption  has a Beta distribution, so that is probability density function is![\[eq35\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)Therefore, the [joint probability density function](https://www.statlect.com/glossary/joint-probability-density-function) of  and  is ![\[eq36\]](https://www.statlect.com/images/beta-distribution__113.png)Thus, we have factored the joint probability density function as![\[eq37\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)where![\[eq38\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)is the probability density function of a Beta distribution with parameters  and , and the function ![\[eq39\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) does not depend on . By a result proved in the lecture entitled [Factorization of joint probability density functions](https://www.statlect.com/fundamentals-of-probability/factorization-of-joint-probability-density-functions), this implies that the probability density function of  given  is![\[eq40\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)Thus, as we wanted to demonstrate, the conditional distribution of  given  is a Beta distribution with parameters  and .
By combining this proposition and the previous one, we obtain the following corollary.
Proposition Suppose that  is a random variable having a uniform distribution. Let  be another random variable such that its distribution conditional on  is a binomial distribution with parameters  and . Then, the conditional distribution of  given  is a Beta distribution with parameters  and .
This proposition constitutes a formal statement of what we said in the introduction of this lecture in order to motivate the Beta distribution.
Remember that the number of successes obtained in  independent repetitions of a random experiment having probability of success  is a binomial random variable with parameters  and .
According to the proposition above, when the probability of success  is a priori unknown and all possible values of  are deemed equally likely (they have a uniform distribution), observing the outcome of the  experiments leads us to revise the distribution assigned to , and the result of this revision is a Beta distribution.
## Solved exercises
Below you can find some exercises with explained solutions.
### Exercise 1
A production plant produces items that have a probability  of being defective.
The plant manager does not know , but from past experience she expects this probability to be equal to .
Furthermore, she quantifies her uncertainty about  by attaching a [standard deviation](https://www.statlect.com/glossary/standard-deviation) of  to her  estimate.
After consulting with an expert in statistics, the manager decides to use a Beta distribution to model her uncertainty about .
How should she set the two parameters of the distribution in order to match her priors about the expected value and the standard deviation of ?
Solution
We know that the expected value of a Beta random variable with parameters  and  is![\[eq41\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)while its variance is![\[eq42\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)The two parameters need to be set in such a way that![\[eq43\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)This is accomplished by finding a solution to the following system of two equations in two unknowns:![\[eq44\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)where for notational convenience we have set  and . The first equation gives![\[eq45\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)or![\[eq46\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)By substituting this into the second equation, we get![\[eq47\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)or![\[eq48\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)Then we divide the numerator and denominator on the left-hand side by :![\[eq49\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)By computing the products, we get![\[eq50\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)By taking the reciprocals of both sides, we have![\[eq51\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)By multiplying both sides by , we obtain![\[eq52\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)Thus the value of  is![\[eq53\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)and the value of  is![\[eq54\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)By plugging our numerical values into the two formulae, we obtain![\[eq55\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)
### Exercise 2
After choosing the parameters of the Beta distribution so as to represent her priors about the probability of producing a defective item (see previous exercise), the plant manager now wants to update her priors by observing new data.
She decides to inspect a production lot of 100 items, and she finds that 3 of the items in the lot are defective.
How should she change the parameters of the Beta distribution in order to take this new information into account?
Solution
Under the hypothesis that the items are produced independently of each other, the result of the inspection is a binomial random variable with parameters  and . But updating a Beta distribution based on the outcome of a binomial random variable gives as a result another Beta distribution. Moreover, the two parameters  and  of the updated Beta distribution are![\[eq56\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)
### Exercise 3
After updating the parameters of the Beta distribution (see previous exercise), the plant manager wants to compute again the expected value and the standard deviation of the probability of finding a defective item.
Can you help her?
Solution
We just need to use the formulae for the expected value and the variance of a Beta distribution:![\[eq57\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)and plug in the new values we have found for  and , that is,![\[eq58\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)The result is![\[eq59\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)
## How to cite
Please cite as:
Taboga, Marco (2021). "Beta distribution", Lectures on probability theory and mathematical statistics. Kindle Direct Publishing. Online appendix. https://www.statlect.com/probability-distributions/beta-distribution.
The books
Most of the learning materials found on this website are now available in a traditional textbook format.
[Probability and statistics](https://www.statlect.com/about/book)[Matrix algebra](https://www.statlect.com/about/linear-algebra-book)
Featured pages
- [Likelihood ratio test](https://www.statlect.com/fundamentals-of-statistics/likelihood-ratio-test)
- [Conditional probability](https://www.statlect.com/fundamentals-of-probability/conditional-probability)
- [Point estimation](https://www.statlect.com/fundamentals-of-statistics/point-estimation)
- [Convergence in probability](https://www.statlect.com/asymptotic-theory/convergence-in-probability)
- [Delta method](https://www.statlect.com/asymptotic-theory/delta-method)
- [F distribution](https://www.statlect.com/probability-distributions/F-distribution)
Explore
- [Independent events](https://www.statlect.com/fundamentals-of-probability/independent-events)
- [Bayes rule](https://www.statlect.com/fundamentals-of-probability/Bayes-rule)
- [Set estimation](https://www.statlect.com/fundamentals-of-statistics/set-estimation)
Main sections
- [Mathematical tools](https://www.statlect.com/mathematical-tools/)
- [Fundamentals of probability](https://www.statlect.com/fundamentals-of-probability/)
- [Probability distributions](https://www.statlect.com/probability-distributions/)
- [Asymptotic theory](https://www.statlect.com/asymptotic-theory/)
- [Fundamentals of statistics](https://www.statlect.com/fundamentals-of-statistics/)
- [Glossary](https://www.statlect.com/glossary/)
About
- [About Statlect](https://www.statlect.com/about/)
- [Contacts](https://www.statlect.com/about/contacts)
- [Cookies, privacy and terms of use](https://www.statlect.com/about/cookies-privacy-policy-and-terms-of-use)
Glossary entries
- [IID sequence](https://www.statlect.com/glossary/IID-sequence)
- [Discrete random variable](https://www.statlect.com/glossary/discrete-random-variable)
- [Type II error](https://www.statlect.com/glossary/Type-II-error)
- [Mean squared error](https://www.statlect.com/glossary/mean-squared-error)
- [Loss function](https://www.statlect.com/glossary/loss-function)
- [Continuous mapping theorem](https://www.statlect.com/asymptotic-theory/continuous-mapping-theorem)
Share
- To enhance your privacy,
- we removed the social buttons,
- but **don't forget to share**. |
| Readable Markdown | The Beta distribution is a continuous probability distribution often used to model the uncertainty about the probability of success of an experiment.

Table of contents
1. [How the distribution is used](https://www.statlect.com/probability-distributions/beta-distribution#hid2)
1. [Uncertainty about the probability of success](https://www.statlect.com/probability-distributions/beta-distribution#hid3)
2. [Data collection](https://www.statlect.com/probability-distributions/beta-distribution#hid4)
3. [Updating of priors](https://www.statlect.com/probability-distributions/beta-distribution#hid5)
2. [Definition](https://www.statlect.com/probability-distributions/beta-distribution#hid6)
3. [Expected value](https://www.statlect.com/probability-distributions/beta-distribution#hid7)
4. [Variance](https://www.statlect.com/probability-distributions/beta-distribution#hid8)
5. [Higher moments](https://www.statlect.com/probability-distributions/beta-distribution#hid9)
6. [Moment generating function](https://www.statlect.com/probability-distributions/beta-distribution#hid10)
7. [Characteristic function](https://www.statlect.com/probability-distributions/beta-distribution#hid11)
8. [Distribution function](https://www.statlect.com/probability-distributions/beta-distribution#hid12)
9. [More details](https://www.statlect.com/probability-distributions/beta-distribution#hid13)
1. [Relation to the uniform distribution](https://www.statlect.com/probability-distributions/beta-distribution#hid14)
2. [Relation to the binomial distribution](https://www.statlect.com/probability-distributions/beta-distribution#hid15)
10. [Solved exercises](https://www.statlect.com/probability-distributions/beta-distribution#hid16)
1. [Exercise 1](https://www.statlect.com/probability-distributions/beta-distribution#hid17)
2. [Exercise 2](https://www.statlect.com/probability-distributions/beta-distribution#hid18)
3. [Exercise 3](https://www.statlect.com/probability-distributions/beta-distribution#hid19)
## How the distribution is used
The Beta distribution can be used to analyze probabilistic experiments that have only two possible outcomes:
- success, with probability ;
- failure, with probability .
These experiments are called Bernoulli experiments.

### Uncertainty about the probability of success
Suppose that  is unknown and all its possible values are deemed equally likely.
This uncertainty can be described by assigning to  a [uniform distribution](https://www.statlect.com/probability-distributions/uniform-distribution) on the interval ![\$left\[ 0,1 ight\] \$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==).
This is appropriate because:
- , being a [probability](https://www.statlect.com/fundamentals-of-probability/probability), can take only values between  and ;
- the uniform distribution assigns equal probability density to all points in the interval, which reflects the fact that no possible value of  is, a priori, deemed more likely than all the others.
### Data collection
Now, suppose that:
- we perform  independent repetitions of the experiment;
- we observe  successes and  failures.
### Updating of priors
After performing the experiments, we want to know how we should revise the distribution initially assigned to , in order to properly take into account the information provided by the observed outcomes.
In other words, we want to calculate the [conditional distribution](https://www.statlect.com/fundamentals-of-probability/conditional-probability-distributions) of  (also called posterior distribution), conditional on the number of successes and failures we have observed.
The result of this calculation is a Beta distribution. In particular, the conditional distribution of , conditional on having observed  successes out of  trials, is a Beta distribution with parameters  and .
## Definition
The Beta distribution is characterized as follows.
A random variable having a Beta distribution is also called a Beta random variable.
The following is a proof that ![\[eq4\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is a [legitimate probability density function](https://www.statlect.com/fundamentals-of-probability/legitimate-probability-density-functions).
Proof
## Expected value
The [expected value](https://www.statlect.com/fundamentals-of-probability/expected-value) of a Beta random variable  is![\[eq12\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)
Proof
It can be derived as follows:![\[eq13\]](https://www.statlect.com/images/beta-distribution__40.png)
## Variance
The [variance](https://www.statlect.com/fundamentals-of-probability/variance) of a Beta random variable  is![\[eq14\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)
Proof
## Higher moments
The \-th [moment](https://www.statlect.com/fundamentals-of-probability/moments) of a Beta random variable  is![\[eq17\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)
Proof
By the definition of moment, we have![\[eq18\]](https://www.statlect.com/images/beta-distribution__48.png)
where in step  we have used recursively the fact that ![\[eq19\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==).
## Moment generating function
The [moment generating function](https://www.statlect.com/fundamentals-of-probability/moment-generating-function) of a Beta random variable  is defined for any  and it is![\[eq20\]](https://www.statlect.com/images/beta-distribution__53.png)
Proof
The above formula for the moment generating function might seem impractical to compute because it involves an infinite sum as well as products whose number of terms increase indefinitely.
However, the function![\[eq24\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)is a function, called [Confluent hypergeometric function of the first kind](http://mathworld.wolfram.com/ConfluentHypergeometricFunctionoftheFirstKind.html), that has been extensively studied in many branches of mathematics. Its properties are well-known and efficient algorithms for its computation are available in most software packages for scientific computation.
## Characteristic function
The [characteristic function](https://www.statlect.com/fundamentals-of-probability/characteristic-function) of a Beta random variable  is![\[eq25\]](https://www.statlect.com/images/beta-distribution__62.png)
Proof
The derivation of the characteristic function is almost identical to the derivation of the moment generating function (just replace  with  in that proof).
Comments made about the moment generating function, including those about the computation of the Confluent hypergeometric function, apply also to the characteristic function, which is identical to the mgf except for the fact that  is replaced with .
## Distribution function
The distribution function of a Beta random variable  is![\[eq26\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)where the function![\[eq27\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)is called [incomplete Beta function](https://www.statlect.com/mathematical-tools/beta-function#incomplete) and is usually computed by means of specialized computer algorithms.
Proof
## More details
In the following subsections you can find more details about the Beta distribution.
### Relation to the uniform distribution
The following proposition states the relation between the Beta and the uniform distributions.
Proposition A Beta distribution with parameters  and  is a uniform distribution on the interval ![\$left\[ 0,1 ight\] \$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==).
Proof
### Relation to the binomial distribution
The following proposition states the relation between the Beta and the binomial distributions.
Proposition Suppose  is a random variable having a Beta distribution with parameters  and . Let  be another random variable such that its distribution conditional on  is a [binomial distribution](https://www.statlect.com/probability-distributions/binomial-distribution) with parameters  and . Then, the conditional distribution of  given  is a Beta distribution with parameters  and .
Proof
We are dealing with one continuous random variable  and one discrete random variable  (together, they form what is called a random vector with mixed coordinates). With a slight abuse of notation, we will proceed as if also  were continuous, treating its probability mass function as if it were a probability density function. Rest assured that this can be made fully rigorous (by defining a probability density function with respect to a [counting measure](https://en.wikipedia.org/wiki/Counting_measure) on the support of ). By assumption  has a binomial distribution conditional on , so that its [conditional probability mass function](https://www.statlect.com/glossary/conditional-probability-mass-function) is ![\[eq34\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)where  is a [binomial coefficient](https://www.statlect.com/glossary/binomial-coefficient). Also, by assumption  has a Beta distribution, so that is probability density function is![\[eq35\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)Therefore, the [joint probability density function](https://www.statlect.com/glossary/joint-probability-density-function) of  and  is ![\[eq36\]](https://www.statlect.com/images/beta-distribution__113.png)Thus, we have factored the joint probability density function as![\[eq37\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)where![\[eq38\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)is the probability density function of a Beta distribution with parameters  and , and the function ![\[eq39\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) does not depend on . By a result proved in the lecture entitled [Factorization of joint probability density functions](https://www.statlect.com/fundamentals-of-probability/factorization-of-joint-probability-density-functions), this implies that the probability density function of  given  is![\[eq40\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)Thus, as we wanted to demonstrate, the conditional distribution of  given  is a Beta distribution with parameters  and .
By combining this proposition and the previous one, we obtain the following corollary.
Proposition Suppose that  is a random variable having a uniform distribution. Let  be another random variable such that its distribution conditional on  is a binomial distribution with parameters  and . Then, the conditional distribution of  given  is a Beta distribution with parameters  and .
This proposition constitutes a formal statement of what we said in the introduction of this lecture in order to motivate the Beta distribution.
Remember that the number of successes obtained in  independent repetitions of a random experiment having probability of success  is a binomial random variable with parameters  and .
According to the proposition above, when the probability of success  is a priori unknown and all possible values of  are deemed equally likely (they have a uniform distribution), observing the outcome of the  experiments leads us to revise the distribution assigned to , and the result of this revision is a Beta distribution.
## Solved exercises
Below you can find some exercises with explained solutions.
### Exercise 1
A production plant produces items that have a probability  of being defective.
The plant manager does not know , but from past experience she expects this probability to be equal to .
Furthermore, she quantifies her uncertainty about  by attaching a [standard deviation](https://www.statlect.com/glossary/standard-deviation) of  to her  estimate.
After consulting with an expert in statistics, the manager decides to use a Beta distribution to model her uncertainty about .
How should she set the two parameters of the distribution in order to match her priors about the expected value and the standard deviation of ?
Solution
We know that the expected value of a Beta random variable with parameters  and  is![\[eq41\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)while its variance is![\[eq42\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)The two parameters need to be set in such a way that![\[eq43\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)This is accomplished by finding a solution to the following system of two equations in two unknowns:![\[eq44\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)where for notational convenience we have set  and . The first equation gives![\[eq45\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)or![\[eq46\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)By substituting this into the second equation, we get![\[eq47\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)or![\[eq48\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)Then we divide the numerator and denominator on the left-hand side by :![\[eq49\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)By computing the products, we get![\[eq50\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)By taking the reciprocals of both sides, we have![\[eq51\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)By multiplying both sides by , we obtain![\[eq52\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)Thus the value of  is![\[eq53\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)and the value of  is![\[eq54\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)By plugging our numerical values into the two formulae, we obtain![\[eq55\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)
### Exercise 2
After choosing the parameters of the Beta distribution so as to represent her priors about the probability of producing a defective item (see previous exercise), the plant manager now wants to update her priors by observing new data.
She decides to inspect a production lot of 100 items, and she finds that 3 of the items in the lot are defective.
How should she change the parameters of the Beta distribution in order to take this new information into account?
Solution
Under the hypothesis that the items are produced independently of each other, the result of the inspection is a binomial random variable with parameters  and . But updating a Beta distribution based on the outcome of a binomial random variable gives as a result another Beta distribution. Moreover, the two parameters  and  of the updated Beta distribution are![\[eq56\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)
### Exercise 3
After updating the parameters of the Beta distribution (see previous exercise), the plant manager wants to compute again the expected value and the standard deviation of the probability of finding a defective item.
Can you help her?
Solution
We just need to use the formulae for the expected value and the variance of a Beta distribution:![\[eq57\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)and plug in the new values we have found for  and , that is,![\[eq58\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)The result is![\[eq59\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)
## How to cite
Please cite as:
Taboga, Marco (2021). "Beta distribution", Lectures on probability theory and mathematical statistics. Kindle Direct Publishing. Online appendix. https://www.statlect.com/probability-distributions/beta-distribution. |
| Shard | 126 (laksa) |
| Root Hash | 3586688910177265926 |
| Unparsed URL | com,statlect!www,/probability-distributions/beta-distribution s443 |