# Definition:Expectation

## Definition

### Definition 1

The **expectation** of a random variable is the arithmetic mean of its values.

### Definition 2

The **expectation** of a random variable $X$ is the first moment about the origin of $X$.

This page has been identified as a candidate for refactoring of advanced complexity.In particular: Extract the following discussion into a separate transcluded page, as it does not form part of the definitionUntil this has been finished, please leave
`{{Refactor}}` in the code.
Because of the underlying complexity of the work needed, it is recommended that you do not embark on a refactoring task until you have become familiar with the structural nature of pages of $\mathsf{Pr} \infty \mathsf{fWiki}$.To discuss this page in more detail, feel free to use the talk page.When this work has been completed, you may remove this instance of `{{Refactor}}` from the code. |

The expectation of an arbitrary integrable random variable can be handled with a single definition.

The general definition given here suffices for this purpose.

Particular types of random variable give convenient formulas for computing their expectation.

In particular, familiar formulas for the expectation of integrable discrete random variables (in terms of their mass function) and integrable absolutely continuous random variables (in terms of their density function) can be obtained.

However, in elementary discussions of probability theory (say, of (early) undergraduate level), tools in measure theory are not usually accessible, so it is more usual to give these formulas *as definitions* instead.

On this page we present all three definitions, and then give proofs of consistency.

We also give a slightly less usual formula for the expectation of a general integrable continuous random variables, given as a Riemann-Stieltjes integral, and again prove consistency.

This page has been identified as a candidate for refactoring of advanced complexity.In particular: The below should be results rather than definitionsUntil this has been finished, please leave
`{{Refactor}}` in the code.
Because of the underlying complexity of the work needed, it is recommended that you do not embark on a refactoring task until you have become familiar with the structural nature of pages of $\mathsf{Pr} \infty \mathsf{fWiki}$.To discuss this page in more detail, feel free to use the talk page.When this work has been completed, you may remove this instance of `{{Refactor}}` from the code. |

### General Definition

Let $\struct {\Omega, \Sigma, \Pr}$ be a probability space.

Let $X$ be an integrable real-valued random variable on $\struct {\Omega, \Sigma, \Pr}$.

The **expectation of $X$**, written $\expect X$, is defined by:

- $\ds \expect X = \int X \rd \Pr$

where the integral sign denotes the $\Pr$-integral of $X$.

### Discrete Random Variable

Let $\struct {\Omega, \Sigma, \Pr}$ be a probability space.

Let $X$ be a real-valued discrete random variable on $\struct {\Omega, \Sigma, \Pr}$.

The **expectation of $X$**, written $\expect X$, is defined as:

- $\expect X := \ds \sum_{x \mathop \in \image X} x \map \Pr {X = x}$

whenever the sum is absolutely convergent, that is, when:

- $\ds \sum_{x \mathop \in \image X} \size {x \map \Pr {X = x} } < \infty$

### Absolutely Continuous Random Variable

Let $\struct {\Omega, \Sigma, \Pr}$ be a probability space.

Let $X$ be an absolutely continuous random variable on $\struct {\Omega, \Sigma, \Pr}$.

Let $f_X$ be the probability density function of $X$.

The **expectation of $X$**, written $\expect X$, is defined by:

- $\ds \expect X = \int_{-\infty}^\infty x \map {f_X} x \rd x$

whenever:

- $\ds \int_{-\infty}^\infty \size x \map {f_X} x \rd x < \infty$

### Continuous Random Variable

Let $\struct {\Omega, \Sigma, \Pr}$ be a probability space.

Let $X$ be a continuous random variable on $\struct {\Omega, \Sigma, \Pr}$.

Let $F_X$ be the cumulative distribution function of $X$.

The **expectation of $X$**, written $\expect X$, is defined by:

- $\ds \expect X = \int_\R x \rd F_X$

whenever:

- $\ds \int_\R \size x \rd F_X < \infty$

with the integrals being taken as Riemann-Stieltjes integrals.

## Also known as

The **expectation** of a random variable $X$ is also called the **expected value of $X$** or the **mean value of $X$**.

For a given random variable, the **expectation** is often denoted $\mu$.

The terminology is appropriate, as it can be seen that an **expectation** is an example of a normalized weighted mean.

This follows from the fact that a probability mass function is a normalized weight function.

Various forms of $E$ can be seen to denote **expectation**:

- $\map E X$
- $\map {\mathrm E} X$
- $E \sqbrk X$
- $\mathop {\mathbb E} \sqbrk X$

and so on.

$\mathsf{Pr} \infty \mathsf{fWiki}$ uses $\expect X$ for notational consistency.

## Also see

- Results about
**expectation**can be found**here**.

## Historical Note

The concept of **expectation** was first introduced by Christiaan Huygens in his *De Ratiociniis in Ludo Aleae* ($1657$).

The notation $\expect X$ was coined by William Allen Whitworth in his *Choice and Chance: An Elementary Treatise on Permutations, Combinations, and Probability, 5th ed.* of $1901$.

## Linguistic Note

Don't you **dare** call it expectoration, you disgusting children.

## Technical Note

The $\LaTeX$ code for \(\expect {X}\) is `\expect {X}`

.

When the argument is a single character, it is usual to omit the braces:

`\expect X`