General facts about Random Variables

Definitions

A random variable is an object defined by:

  • a set of possible values
  • a probability distribution over the set
    The set of values can be continuous or discrete (or mixed).
    The probability distribution if a non-negative normalized function. It quantifies the probability that the random variable take value

Example 1. Our set is , then we have a function for for which

Example 2. Our set is , then the following properties for the probability distribution function hold:

Moments

The average of a function is defined as

is the -th moment of
is the average
is the variance

Note. Moments are not always defined: the series

or the integral

might not converge.

Joint Distribution and Independence

If we have multiple random variables , , ,
We can define the joint probability distribution , which characterize the probability that the random variables take simultaneously the same values.

Let's focus on the case with two random variables and . We have the joint pdf .
We can obtain the marginal distribution function of (the probability that takes a given value ) as

Two random variables are independent if

The covariance is defined as

If two RVs are independent, the covariance is equal to zero (the opposite is not true)

Conditional Probability and Bayes' Formula

The distribution of conditioned to is defined as

which implies Bayes' formula

Moment Generating Function

The moment generating function is defined as

By Taylor expanding one gets

and therefore

where (and by normalization)

For multivariate distributions we can similarly define

if and are independent

Central Limit Theorem

Suppose that we have variables and we want to know the distribution of their sum where

The moment generating function associated to the probability density will be given by

if the variables are independent and identically distributed accordingly to a distribution we get

from which we obtain

or equivalently

This implies that if we write

the value of for a sum of independent random variable is the sum of the value of for the individual random variables
These quantitities are called cumulants
( is the mean, is the variance, higher cumulant have a more complicated expression as function of simple moments, see here)

If we are interested in summing many variables we might get a very large sum
so it’s convienent to consider variables with small mean and variances. In particular we can (always!) write

where is a random variable with mean and variance
By inserting this choice in the equations above we get

which corresponds to

in the limit of we obtain

which corresponds to a Gaussian distribution

Tossing coins and sampling

Coin with probability of Head and probability of Tail
Toss it times. What is the probability of heads?

Imagine a sequence

If a sequences of length has heads, the probability of observing exactly that sequence is

Each coin has the same probability of turning head or tail.
But there are many sequences with the same number of heads! How many?
Let's call this number (the number of tosses of elements with heads)

Let's forget for a sec about tosses and coins. Imagine we have people
There are ways to order these people is a line
Of these people, wear a red t-shirt and with a blue t-shirt.
We have that

where the number of ways to order people is equal to the number of sequences with red t-shirt, times the number of ways to reorder the people with a red t-shirt ( ways) times the number of ways to reorder the people with blue t-shirt ()
We have

And therefore the binomial distribution reads