Movatterモバイル変換


[0]ホーム

URL:


Search for probability and statistics terms on Statlect
StatLect
Index >Fundamentals of probability

Random variable

by, PhD

A random variable is a variable whose value depends on the outcome of a probabilistic experiment. Its value is a priori unknown, but it becomes known once the outcome of the experiment is realized.

Table of Contents

Table of contents

  1. Definition

  2. Example

  3. Notation

  4. Types of random variables

  5. Discrete random variables

  6. Continuous random variables

  7. Random variables in general

  8. More details

    1. Derivative of the distribution function of a continuous variable

    2. Continuous random variables and zero-probability events

    3. A more rigorous definition of random variable

  9. Solved exercises

    1. Exercise 1

    2. Exercise 2

    3. Exercise 3

    4. Exercise 4

    5. Exercise 5

    6. Exercise 6

    7. More exercises

Definition

Denote byOmega the set of all possible outcomes of a probabilistic experiment, called asample space.

A random variable associates a real number to each element ofOmega, as stated by the following definition.

Definition Arandom variableX is a function from the sample spaceOmega to the set of real numbersR:[eq1]

In rigorous (measure-theoretic) probability theory, the functionX is also required to be measurable (seea more rigorous definition of random variable).

The real number[eq2] associated to asample pointomega in Omega is called arealization of the random variable.

The set of all possible realizations is calledsupport and is denoted byR_X.

Example

This example shows how the realizations of a random variable are associated with the outcomes of a probabilistic experiment.

Suppose that we flip a coin. The possible outcomes are either tail ($T$) or head (H), that is,[eq3]

The two outcomes are assigned equal probabilities:[eq4]

If tail ($T$) is the outcome, we win one dollar, if head (H) is the outcome we lose one dollar.

The amountX we win (or lose) is a random variable, defined as follows:[eq5]

The probability of winning one dollar is[eq6]

The probability of losing one dollar is[eq7]

The probability of losing two dollars is[eq8]

Notation

Some remarks on notation are in order:

  1. The dependence ofX onomega is often omitted, that is, we simply writeX instead of[eq9].

  2. If[eq10], the exact meaning of the notation[eq11] is the following:[eq12]

  3. If[eq10], we sometimes use the notation[eq14] with the following meaning:[eq15]In this case,$QTR{rm}{P}_{X}$ is to be interpreted as a probability measure on the set of real numbers, induced by the random variableX. Often, statisticians construct probabilistic models where a random variableX is defined by directly specifying$QTR{rm}{P}_{X}$, without specifying the sample spaceOmega.

Types of random variables

Most of the time, statisticians deal with two special kinds of random variables:

  1. discrete random variables;

  2. continuous random variables.

These two types are described in the next sections.

Discrete random variables

Here is the first kind.

Definition A random variableX isdiscrete if

  1. its supportR_X is acountable set;

  2. there is a function[eq16], called theprobability mass function (or pmf or probability function) ofX, such that, for any$xin U{211d} $:[eq17]

The following is an example of a discrete random variable.

Example ABernoulli random variable is an example of a discrete random variable. It can take only two values:1 with probability$q$ and0 with probability$1-q$, where[eq18]. Its support is[eq19]. Its probability mass function is[eq20]

Probability mass functions are characterized by two fundamental properties.

  1. Non-negativity:[eq21] for any$xin U{211d} $;

  2. Sum over the support equals1:[eq22].

Any probability mass function must satisfy these two properties.

Moreover, any function satisfying these two properties is a legitimate probability mass function.

These and other properties of probability mass functions are discussed more in detail in the lecture onLegitimate probability mass functions.

Continuous random variables

Continuous variables are defined as follows.

Definition A random variableX iscontinuous (or absolutely continuous) if and only if

  1. its supportR_X is not countable;

  2. there is a function[eq23], called the probability density function (or pdf or density function) ofX, such that, for any interval[eq24]:[eq25]

The page on theprobability density function explains why we need integrals to deal with continuous variables.

We now illustrate the definition with an example.

Example Auniform random variable (on the interval$left[ 0,1ight] $) is an example of a continuous variable. It can take any value in the interval$left[ 0,1ight] $. All sub-intervals of equal length are equally likely. Its support is[eq26]. Its probability density function is[eq27]The probability that the realization ofX belongs, for example, to the interval[eq28] is[eq29]

Probability density functions are characterized by two fundamental properties:

  1. Non-negativity:[eq30] for any$xin U{211d} $;

  2. Integral overR equals1:[eq31].

Any probability density function must satisfy these two properties.

Moreover, any function satisfying these two properties is a legitimate probability density function.

The lecture onLegitimate probability density functions contains a detailed discussion of these facts.

Random variables in general

Random variables, also those that are neither discrete nor continuous, are often characterized in terms of their distribution function.

DefinitionLetX be a random variable. The distribution function (or cumulative distribution function or cdf ) ofX is a function[eq32] such that[eq33]

If we know the distribution function of a random variableX, then we can easily compute the probability thatX belongs to an interval[eq34] as[eq35]

Proof

Note that[eq36]where the two sets on the right hand side are disjoint. Hence, by additivity:[eq37]By rearranging terms, we get[eq35]

Want to learn more about the cdf? Checkhere.

More details

In the following subsections you can find more details on random variables and univariate probability distributions.

Derivative of the distributionfunction of a continuous variable

Note that, ifX is continuous, then[eq39]

Hence, by taking the derivative with respect tox of both sides of the above equation, we obtain[eq40]

Continuous random variablesand zero-probability events

Note that, ifX is a continuous random variable, the probability thatX takes on any specific value$xin R_{X}$ is equal to zero:[eq41]

Thus, the event[eq42] is a zero-probability event for any$xin R_{X}$.

The lecture onZero-probability events contains a thorough discussion of this apparently paradoxical fact: although it can happen that[eq43], the event[eq44] has zero probability of happening.

A more rigorous definition ofrandom variable

Random variables can be defined in a more rigorous manner by using the terminology of measure theory, and in particular the concepts of sigma-algebra, measurable set and probability space introduced at the end of the lecture onprobability.

Definition Let[eq45] be aprobability space, whereOmega is a sample space,[eq46] is a sigma-algebra of events (subsets ofOmega) and$QTR{rm}{P}$ is a probability measure on[eq47]. Let[eq48] be the Borel sigma-algebra of the set of real numbersR (i.e., the smallest sigma-algebra containing all the open subsets ofR). A function[eq49] such that[eq50]for any[eq51] is said to be a random variable onOmega.

This definition ensures that the probability that the realization of the random variableX will belong to a set[eq51] can be defined as[eq53]where the probability on the right-hand side is well defined because the set[eq54] is measurable.

One question remains to be answered: why did we introduce the exotic concept of Borel sigma-algebra?

Clearly, if we want to assign probabilities to subsets ofR (to which the realizations of the random variableX could belong), then we need to define a sigma-algebra of subsets ofR (remember that we need a sigma-algebra in order to define probability rigorously).

But why can't we consider the simpler to understand set of all possible subsets ofR, which is a sigma-algebra?

The short answer is that we are not able to define a probability measure on sigma-algebras larger (i.e., containing more subsets ofR) than the Borel sigma-algebra: whenever we try to do so, we end up finding some uncountable sets for which the sigma-additivity property of probability does not hold (i.e., their probability is different from the sum of the probabilities of their parts) or such that their probability is not equal to one minus the probability of their complements.

Solved exercises

Below you can find some exercises with explained solutions.

Exercise 1

LetX be a discrete random variable. Let its supportR_X be[eq55]

Let its probability mass function[eq56] be[eq57]

Calculate the following probability:[eq58]

Solution

By the additivity of probability, we have that[eq59]

Exercise 2

LetX be a discrete random variable. Let its supportR_X be the set of the first$20$ natural numbers:[eq60]

Let its probability mass function[eq56] be[eq62]

Compute the probability[eq63]

Solution

By using the additivity of probability, we obtain[eq64]

Exercise 3

LetX be a discrete random variable. Let its supportR_X be[eq65]

Let its probability mass function[eq56] be[eq67]where[eq68] is thebinomial coefficient.

Calculate the probability[eq69]

Solution

First note that, by additivity:[eq70]

Therefore, in order to compute[eq71], we need to evaluate the probability mass function at the three points$x=0,$,$x=1$ and$x=2$:[eq72]

Finally,[eq73]

Exercise 4

LetX be a continuous random variable. Let its supportR_X be[eq74]

Let its probability density function[eq75] be[eq76]

Compute[eq77]

Solution

The probability that a continuous variable takes a value in a given interval is equal to the integral of the probability density function over that interval:[eq78]

Exercise 5

LetX be a continuous variable. Let its supportR_X be[eq79]

Let its probability density function[eq75] be[eq81]

Compute[eq82]

Solution

As in the previous exercise, the probability thatX takes a value in a given interval is equal to the integral of its density function over that interval:[eq83]

Exercise 6

LetX be a continuous variable. Let its supportR_X be[eq84]

Let its probability density function[eq75] be[eq86]where$lambda >0$.

Compute[eq87]

Solution

As in the previous exercise, we need to compute an integral:[eq88]

More exercises

Looking for more exercises? Try StatLect'sprobability exercises page.

How to cite

Please cite as:

Taboga, Marco (2021). "Random variable", Lectures on probability theory and mathematical statistics. Kindle Direct Publishing. Online appendix. https://www.statlect.com/fundamentals-of-probability/random-variables.

The books

Most of the learning materials found on this website are now available in a traditional textbook format.

Probability and statisticsMatrix algebra
Featured pages
Explore
Main sections
About
Glossary entries
Share
  • To enhance your privacy,
  • we removed the social buttons,
  • butdon't forget to share.

[8]ページ先頭

©2009-2025 Movatter.jp