# Random variable

## Definition

A Random variable is a measurable map from a probability space to any measurable space

Let [ilmath](\Omega,\mathcal{A},\mathbb{P})[/ilmath] be a probability space and let [ilmath]X:(\Omega,\mathcal{A})\rightarrow(V,\mathcal{U}) [/ilmath] be a random variable

Then:

$X^{-1}(U\in\mathcal{U})\in\mathcal{A}$, but anything $\in\mathcal{A}$ is [ilmath]\mathbb{P} [/ilmath]-measurable! So we see:

$\mathbb{P}(X^{-1}(U\in\mathcal{U}))\in[0,1]$ which we may often write as: $\mathbb{P}(X=U)$ for simplicity (see Mathematicians are lazy)

## Notation

Often a measurable space that is the domain of the RV will be a probability space, given as $(\Omega,\mathcal{A},\mathbb{P})$, and we may write either:

• [ilmath]X:(\Omega,\mathcal{A},\mathbb{P})\rightarrow(V,\mathcal{U}) [/ilmath]
• [ilmath]X:(\Omega,\mathcal{A})\rightarrow(V,\mathcal{U}) [/ilmath]

With the understanding we write [ilmath]\mathbb{P} [/ilmath] in the top one only because it is convenient to remind ourselves what probability measure we are using.

## Pitfall

Note that it is only guaranteed that $X^{-1}(U\in\mathcal{U})\in\mathcal{A}$ but it is not guaranteed that $X(A\in\mathcal{A})\in\mathcal{U}$, it may sometimes be the case.

For example consider the trivial [ilmath]\sigma[/ilmath]-algebra $\mathcal{U}=\{\emptyset,V\}$

However If you consider $X:(\Omega,\mathcal{A},\mathbb{P})\rightarrow(V,\{\emptyset,V\})$ then this is just the random variable "something happens" underneath it all, or if $V=\{2,\cdots,12\}$ the event that the sum of the scores is $\ge 2$.

## Example

### Discrete random variable

Recall the roll two die example from probability spaces, we will consider the RV [ilmath]X[/ilmath] = the sum of the scores

Recall the die example from probability spaces (which is restated less verbosely here), there:

Component Definition
[ilmath]\Omega[/ilmath] $\Omega=\{(a,b)|\ a,b\in\mathbb{N},\ a,b\in[0,6]\}$
[ilmath]\mathcal{A} [/ilmath] $\mathcal{A}=\mathcal{P}(\Omega)$
[ilmath]\mathbb{P} [/ilmath] $\mathbb{P}(A) = \frac{1}{36}|A|$

Let us define the Random variable that is the sum of the scores on the die, that is $X:(\Omega,\mathcal{A},\mathbb{P})\rightarrow(\{2,\cdots,12\},\mathcal{P}(\{2,\cdots,12\}))$.

It should be clear that $(\{2,\cdots,12\},\mathcal{P}(\{2,\cdots,12\}))$ is a measurable space however we need not consider a measure on it.

Writing [ilmath]X[/ilmath] out explicitly is hard but there are two parts to it:

Warning - the first bullet point is a suspected claim

• We can look at what generates a space, we need only consider the single events really, that is to say:
$X(A\in\mathcal{A})\cup X(B\in\mathcal{A})=X(A\cup B\in\mathcal{A})$, so we need only look at [ilmath]X[/ilmath] of the individual events

TODO: Prove this

• We can write it more explicitly as:
$X(A\in\mathcal{A})=\{a+b|(a,b)\in A\}$

#### Example of pitfall

Take $X:(\Omega,\mathcal{P}(\Omega),\mathbb{P})\rightarrow(V,\mathcal{U})$, if we define $\mathcal{U}=\{\emptyset,V\}$ then clearly:

$X(\{(1,2)\})=\{3\}\notin\mathcal{U}$. Yet it is still measurable.

So an example! $\mathbb{P}(X^{-1}(\{5\}))=\mathbb{P}(X=5)=\mathbb{P}(\{(1,4),(4,1),(2,3),(3,2)\})=\frac{4}{36}=\frac{1}{9}$