# Discrete random variable

A random variable is said to be discrete if the set of values it can take (its support) has either a finite or an infinite but countable number of elements. Its probability distribution can be characterized through a function called probability mass function.

## Definition

The following is a formal definition.

Definition A random variable is discrete if its support is countable and there exist a function , called probability mass function of , such thatwhere is the probability that will take the value .

A discrete random variable is often said to have a discrete probability distribution.

## Examples

Here are some examples.

### Example 1

Let be a random variable that can take only three values (, and ), each with probability . Then, is a discrete variable. Its support isand its probability mass function is

So, for example, the probability that will be equal to isand the probability that will be equal to isbecause does not belong to the support of .

### Example 2

Let be a random variable. Let its support be the set of natural natural numbers, that is,and its probability mass function be

Note that differently from the previous example, where the support was finite, in this example the support is infinite.

What is the probability that will be equal to ? Since is a natural number, it belongs to the support of and its probability is

What is the probability that will be equal to ? Since is not a natural number, it does not belong to the support. As a consequence, its probability is

## Probability of a set of numbers

How do we compute the probability that the realization of a discrete variable will belong to a given set of numbers ?

This is accomplished by summing the values of the probability mass function over all the elements of :

Example Consider the variable introduced in Example 2 above. Suppose we want to compute the probability that belongs to the setThen,

## Expected value

The expected value of a discrete random variable is computed with the formula

Note that the sum is over the whole support .

Example Consider a variable having supportand probability mass functionIts expected value is

## Variance

By using the definition of varianceand the formula for the expected value illustrated in the previous section, we can write the variance of a discrete random random variable as

Example Take the variable in the previous example. We have already calculated its expected value:Its variance is

## Common discrete distributions

The next table contains some examples of discrete distributions that are frequently encountered in probability theory and statistics.

Name of the discrete distribution Support Type of support
Bernoulli {0,1} Finite
Binomial {0,1,2,...,n} Finite
Poisson The set of all non-negative integer numbers Infinite but countable

## More details

You can read a thorough explanation of discrete random variables in the lecture entitled Random variables.

You can also find more details about the probability mass function in this glossary entry.