# One-Dimensional Random Variables

 English Português Français ‎Español Italiano Nederlands

A random variable is one-dimensional if the experiment only considers outcome.

## Discrete random variable

Definition: A random variable is called discrete if the set of all possible outcomes ${\displaystyle x_{1},x_{2},\dots }$ is finite or countable.

Density function

Definition: The density function ${\displaystyle f}$ gives the probability that the random variable ${\displaystyle X}$ is to ${\displaystyle x_{i}}$. The probability of ${\displaystyle x_{i}}$ is ${\displaystyle f(x_{i})}$. ${\displaystyle P(X=x_{i})=f(x_{i})\qquad i=1,2,\dots }$ ${\displaystyle f(x_{i})\geq 0,\qquad \sum \limits _{i}f(x_{i})=1}$ The density function can be plotted using a histogram.

Distribution function

Definition: The distribution function ${\displaystyle F}$ of a random variable ${\displaystyle X}$ evaluated at a realization ${\displaystyle x}$ is defined as the probability that the value of the random variable ${\displaystyle X}$ is not greater than ${\displaystyle x}$. ${\displaystyle F(x)=P(X\leq x)=\sum \limits _{x_{i}\leq x}f(x_{i})}$ The distribution function of a discrete random variable is a step function that only increases only at increments of ${\displaystyle x_{i}}$. The distribution functions increases in increments of ${\displaystyle f(x_{i})}$. The distribution function is also constant between the points ${\displaystyle x_{i}}$ and ${\displaystyle x_{i+1}}$. The distribution function allows us to compute the probabilities of other events involving ${\displaystyle X}$:${\displaystyle P(aa)=1-F(a)}$. The household sizes in Berlin in April 1998 are provided on page 64 in “Statistisches Jahrbuch” published by “Statistisches Landesamt Berlin”, Kulturbuch-Verlag Berlin.

Household size Number of households (1000)
1 820.7
2 564.7
3 222.9
4 and more 195.8
Sum 1804.1

Let ${\displaystyle X}$ denote the size of a randomly chosen household from Berlin in April 1998. We can observe the following outcomes:

 ${\displaystyle x_{1}=1\ }$ household with one person ${\displaystyle x_{2}=2\ }$ household with two persons ${\displaystyle x_{3}=3\ }$ household with three persons ${\displaystyle x_{4}=4\ }$ household with four or more persons

we choose the household, we can not say anything about its size. The value of the random variable can take any from the four possible outcomes. We let ${\displaystyle X=\ {\text{household size}}}$ denote the random variable in this experiment. ${\displaystyle X}$ is discrete, because the set of all possible outcomes is finite—the outcome must take a value from set of 1, 2, 3, or 4. The probabilities are given by the frequency distribution of the households in Berlin. This density function provides an overview of all possible outcomes together with their probabilities.

Household size ${\displaystyle x_{j}}$ ${\displaystyle f(x_{j})}$
1 0.4549
2 0.3130
3 0.1236
4 0.1085
Sum 1.0000

The probability that a household (from Berlin in April 1998) contains two persons (${\displaystyle X=2}$) is equal to ${\displaystyle 0.313}$. The distribution function ${\displaystyle F(x)=P(X\leq x)}$ is:

Household size ${\displaystyle x_{j}}$ ${\displaystyle F(x)}$
1 0.4549
2 0.7679
3 0.8915
4 1.0000

Similarly, the distribution function provides the probability that a household has at most two members (${\displaystyle X\leq 2}$) is equal to ${\displaystyle 0.7679}$. The distribution function also allows us to compute the probabilities of other outcomes, e.g.

• probability that a household has more than two members (${\displaystyle X>2}$) is ${\displaystyle P(X>2)=1-F(2)=1-0.7679=0.2321}$ or ${\displaystyle P(X>2)=f(3)+f(4)=0.1236+0.1085=0.2321}$.
• probability that a household has more than one member but less than four members is equal to${\displaystyle P(1 or ${\displaystyle P(1.

We count the number of tails (t) in three tosses of the coin. We define random variable ${\displaystyle X}$: ${\displaystyle X=\{\,{\text{The number of tails in three tosses of a coin}}\,\}}$ with the following four outcomes ${\displaystyle x_{1}=0;x_{2}=1;x_{3}=2;x_{4}=3}$.

Event ${\displaystyle E_{j}}$ Probability ${\displaystyle P(E_{j})}$ Number of tails (t) ${\displaystyle x_{j}}$ Probability function ${\displaystyle P(X=x_{j})=f(x_{j})}$
${\displaystyle E_{1}=\{hhh\}}$ ${\displaystyle P(E_{1})=0.125}$ ${\displaystyle x_{1}=0}$ ${\displaystyle f(x_{1})=0.125}$
${\displaystyle E_{2}=\{hho\}}$ ${\displaystyle P(E_{2})=0.125}$
${\displaystyle E_{3}=\{hoh\}}$ ${\displaystyle P(E_{3})=0.125}$ ${\displaystyle x_{2}=1}$ ${\displaystyle f(x_{2})=0.375}$
${\displaystyle E_{4}=\{ohh\}}$ ${\displaystyle P(E_{4})=0.125}$
${\displaystyle E_{5}=\{hoo\}}$ ${\displaystyle P(E_{5})=0.125}$
${\displaystyle E_{6}=\{oho\}}$ ${\displaystyle P(E_{6})=0.125}$ ${\displaystyle x_{3}=2}$ ${\displaystyle f(x_{3})=0.375}$
${\displaystyle E_{7}=\{ooh\}}$ ${\displaystyle P(E_{7})=0.125}$
${\displaystyle E_{8}=\{ooo\}}$ ${\displaystyle P(E_{8})=0.125}$ ${\displaystyle x_{4}=3}$ ${\displaystyle f(x_{4})=0.125}$

The calculation of the probabilities ${\displaystyle P(E_{j})}$ is based on the Multiplication Theorem for independent random events.

Distribution function of discrete random variable:

The distribution function is obtained by summing the probabilities of the different values of the random variable ${\displaystyle X}$. For instance ${\displaystyle F(1)=f(0)+f(1)=0.125+0.375=0.5}$ Distribution function: ${\displaystyle F(x)=\left\{{\begin{array}{ll}0&{\text{for}}\ x<0\\0.125\,&{\text{for}}\ 0\leq x<1\\0.500\,&{\text{for}}\ 1\leq x<2\\0.875\,&{\text{for}}\ 2\leq x<3\\1.000\,&{\text{for}}\ 3\leq x\end{array}}\right.}$

Distribution function of discrete random variable: