# Random Variables

A **random variable**, $ X $, is a function that assigns to each element in the sample space a unique value. The **sample space** is the domain of $X$. The value assigned to each element in the sample space is the *probability* for that particular element in the sample space occurring. The sum of the probabilities over the sample space must equal 1, and the probability that the random variable takes on a value $ x $ must be between 0 and 1, inclusive.

As an example, consider the random variable $ X $ which is defined by the function $ f(x)=1 $ on the interval $ 0 \le x \le 1. $ This is indeed a probability density function because $ 0 \leq P(X) \leq 1 $ and all the probabilities in the sample space taken together (the area) sum to 1. This particular pdf defines a **uniform distribution**.

This pdf defines a **continuous random variable** because the domain takes on all real values in the sample space. PDF's that are not continuous are **discrete** which means the sample space is finite. The interval $(0,1)$ is not finite.