A random variable maps each possible outcome where is the sample space to a real number. Random variables can represent anything.

Example

If we flip a coin 5 times, we can have a random variable that is the number of heads. is a set such that , because you can at most flip 5 heads.

We can ask about the probability of an event occurring for a random variable. For example, asking is asking the probability of the event that the number of heads we flip is 4 or greater.

In reality, this is equivalent to . We are considering the set of outcomes such that when it’s mapped to , its value is 4 or greater.

You can also define a random variable by explicitly stating how it maps outcomes to numbers. For example, we can have a such that if the flip is heads, and if the flip is tails. This would be an Indicator variable.

Discrete random variable

A r.v. is called discrete if there is a countable set of values that can equal. can be a finite set, or a countably infinite set, but not an uncountable set.

The countable set of values such that the PMF is called the support of . This should be .

In problem sets, we need to specify the support whenever we give a PMF for a random variable.

Continuous random variable

Continuous r.v.s can take on any real value in for some interval.

It doesn’t make sense to define a PMF for a continuous variable . Asking for a specific value of makes no sense when it is defined on a continuous interval.

  • If equals the high temperature in Philly, then . Intuitively, we’re asking for the probability that equals a single number out of an infinite number of values.
  • In fact, for any constant , if is continuous, then .

Formal definition

A r.v. has a continuous distribution if its CDF is:

  • Differentiable (and therefore continuous everywhere)
  • Or continuous everywhere, and differentiable at all but a finite number of points.

If has such a continuous distribution, then we say is a continuous random variable.

Using the continuous distribution instead

We define the support of the random variable as the set of all such that the PDF of is greater than zero. That is, .

The probability that exists within an interval , however, is defined. This is just integrating over the PDF from to .

Note that because again, the probability that exactly or is zero.

Expectation

Since is continuous, we now use an integral instead of a summation to find the expected value.

where is the PDF when (remember that this really is an infinitesimal range).

  • Only holds when integral converges absolutely ( is finite). Otherwise, is undefined.
  • In this course we usually assume is well-defined.