A random variable is a real valued function of the elements of sample space S which maps each possible outcome to a real number specified by some rule. Random variables are denoted by capital Alphabet like X.

If the random variable takes on finite or countably an infinite number of values then the random variable is a discrete random variable and if it takes uncountably infinite values then it is a continuous random variable.

As we said earlier that the mapping is done by some rule; Probability mass function [latex]P_X(x)[/latex] defines that rule.

[latex]P_X(x)[/latex] of a random variable is a function that assigns the probability to X when it takes a specific value x. i.e. [latex]P_X(x) = P(X=x)[/latex]

Rules of PMF:

- [latex]0 \leq P_X(x) \leq 1[/latex]
- [latex]\sum_{x} P_X(x) = 1[/latex]

**Types of Random Variables:**

**Bernoulli random variable: **This simple random variable can take on only two possible outcomes. As an example of flipping of a coin can be represented by Bernoulli random variable. The experiments are called Bernoulli trials and it is common to associate {0,1} with Bernoulli random variable. PMF of Bernoulli random variable is defined by:

[latex]P_X(0) = 1-p \; \; , \;\; P_X(1) = p[/latex]

If the experiment is unbiased then [latex]p[/latex] will be equal to 0.5 . It is most used in representing binary digits from the source in digital communication.

**Binomial Random variable: ** If we repeat Bernoulli trials n times and the outcome of each trial is independent from other trials then lets say we want to find how many times 1 occurred then this can be found by using Binomial Random variable which represent the number of times the outcome 1 has occurred in the sequence of n trials. Bernoulli random variable can take on values from 0 to n and its PMF is given by:

[latex]P_X(k) = \left( ^n_k \right) p^k(1-p)^{n-k} \;,\;\;\; k=0,1,2,\ldots,n[/latex]

where [latex]k[/latex] is the number of times 1 has occurred and [latex]P_X(k)[/latex] represents the probability of the set of all outcomes which have exactly [latex]k[/latex] [latex]1’s[/latex] and [latex]n-k[/latex] [latex]0’s[/latex]

**Poisson Random Variable: **If in Binomial random variable the number of repeated trials n is very large and the probability of success in each individual trial p is very small then binomial can be approximated by Poisson random variable. PMF of Poisson random variable is given as:

[latex]P_X(m) = \frac{\alpha ^m}{m!} e^{- \alpha} \;,\;\;\; m=0,1,2,\ldots[/latex]

where [latex]\alpha = \lim_{n\to \infty} np[/latex]

The three types of random variable explained above are discrete random variables and all of them are classified by their PMF (Probability Mass Function) there are also other types of discrete random variable as well including Geometric Radom variable.

Continuous random variables are described by their CDF (Cumulative Density function) and their PDF (Probability density function) including famous gaussian distribution, exponential distribution, uniform distribution etc.

PDF is for continuous random variable and PMF is for discrete random variables.

Before jumping onto continuous random variables we would like you to solve a couple of problems related to discrete random variable, baye’s rule, independence, joint, conditional probability etc. Please see some practice problems here.