{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Random Variables, Expectation, Random Vectors, and Stochastic Processes\n", "\n", "## Random Variables\n", "A _real-valued random variable_ is a mapping from outcome space $\\mathcal{S}$ to the real line $\\Re$.\n", "A _real-valued random variable_ $X$ can be characterized by its probability distribution, which specifies (for a suitable collection of subsets of the real line $\\Re$ that comprises a sigma-algebra), the chance that the value of $X$ will be in each such subset.\n", "There are technical requirements regarding _measurability_, which generally we will ignore.\n", "Perhaps the most natural mathematical setting for probability theory involves _Lebesgue integration_;\n", "we will largely ignore the difference between a _Riemann integral_ and a _Lebesgue integral_.\n", "\n", "Let $P_X$ denote the probability distribution of the random variable $X$. \n", "Then if $A \\subset \\Re$, $P_X(A) = {\\mathbb P} \\{ X \\in A \\}$.\n", "We write $X \\sim P_X$,\n", "pronounced \"$X$ is distributed as $P_X$\" or \"$X$ has distribution $P_X$.\" \n", "\n", "If two random variables $X$ and $Y$ have the same distribution, we write $X \\sim Y$ and we say that $X$ and $Y$\n", "are _identically distributed_.\n", "\n", "Real-valued random variables can be _continuous_, _discrete_, or _mixed (general)_.\n", "\n", "Continuous random variables have _probability density functions_ with respect to Lebesgue measure.\n", "If $X$ is a continuous random variables, there is some nonnegative function $f(x)$,\n", "the probability density of $X$, such that\n", "for any (suitable) set $A \\subset \\Re$,\n", "$$\n", " {\\mathbb P} \\{ X \\in A \\} = \\int_A f(x) dx.\n", "$$\n", "Since ${\\mathbb P} \\{ X \\in \\Re \\} = 1$, it follows that $\\int_{-\\infty}^\\infty f(x) dx = 1$.\n", "\n", "_Example._ \n", "Let $f(x) = \\lambda e^{-\\lambda x}$ for $x \\ge 0$, with $\\lambda > 0$ fixed, and $f(x) = 0$ otherwise.\n", "Clearly $f(x) \\ge 0$.\n", "$$\n", " \\int_{-\\infty}^\\infty f(x) dx = \\int_0^\\infty \\lambda e^{-\\lambda x} dx\n", " = - e^{-\\lambda x}|_0^\\infty = - 0 + 1 = 1.\n", "$$\n", "Hence, $\\lambda e^{-\\lambda x}$ can be the probability density of a continuous random variable.\n", "A random variable with this density is said to be _exponentially distributed_.\n", "Exponentially distributed random variables are used to model radioactive decay and the failure\n", "of items that do not \"fatigue.\" For instance, the lifetime of a semiconductor after an initial\n", "\"burn-in\" period is often modeled as an exponentially distributed random variable.\n", "It is also a common model for the occurrence of earthquakes (although it does not fit the data well).\n", "\n", "_Example._\n", "Let $a$ and $b$ be real numbers with $a < b$, and let $f(x) = \\frac{1}{b-a}$, $x \\in [a, b]$ and \n", "$f(x)=0$, otherwise. \n", "Then $f(x) \\ge 0$ and $\\int_{-\\infty}^\\infty f(x) dx = \\int_a^b \\frac{1}{b-a} = 1$,\n", "so $f(x)$ can be the probability density function of a continuous random variable.\n", "A random variable with this density is sad to be _uniformly distributed on the interval $[a, b]$_.\n", "\n", "Discrete random variables assign all their probability to some _countable_ set of points $\\{x_i\\}_{i=1}^n$,\n", "where $n$ might be infinite.\n", "Discrete random variables have _probability mass functions_.\n", "If $X$ is a discrete random variable, there is a nonnegative function $p$, the probability mass function\n", "of $X$, such that\n", "for any set $A \\subset \\Re$,\n", "$$\n", " {\\mathbb P} \\{X \\in A \\} = \\sum_{i: x_i \\in A} p(x_i).\n", "$$\n", "The value $p(x_i) = {\\mathbb P} \\{X = x_i\\}$, and $\\sum_{i=1}^\\infty p(x_i) = 1$.\n", "\n", "_Example._\n", "Fix $\\lambda > 0$.\n", "Let $x_i = i-1$ for $i=1, 2, \\ldots$, and let $p(x_i) = e^{-\\lambda} \\lambda^{x_i}/x_i!$.\n", "Then $p(x_i) > 0$ and \n", "$$ \n", "\\sum_{i=1}^\\infty p(x_i) = e^{-\\lambda} \\sum_{j=0}^\\infty \\lambda^j/j! = e^{-\\lambda} e^{\\lambda} = 1.\n", "$$\n", "Hence, $p(x)$ is the probability mass function of a discrete random variable.\n", "A random variable with this probability mass function is said to be _Poisson distributed (with parameter\n", "$\\lambda$)_.\n", "Poisson-distributed random variables are often used to model rare events.\n", "\n", "\n", "_Example._\n", "Let $x_i = i$ for $i=1, \\ldots, n$, and let $p(x_i) = 1/n$ and $p(x) = 0$, otherwise.\n", "Then $p(x) \\ge 0$ and $\\sum_{x_i} p(x_i) = 1$.\n", "Hence, $p(x)$ can be the probability mass function of a discrete random variable.\n", "A random variable with this probability mass function is said to be _uniformly distributed on $1, \\ldots, n$_.\n", "\n", "_Example._\n", "Let $x_i = i-1$ for $i=1, \\ldots, n+1$, and let $p(x_i) = {n \\choose x_i} p^{x_i} (1-p)^{n-x_i}$, and\n", "$p(x) = 0$ otherwise.\n", "Then $p(x) \\ge 0$ and \n", "$$\n", "\\sum_{x_i} p(x_i) = \\sum_{j=0}^n {n \\choose j} p^j (1-p)^{n-j} = 1,\n", "$$\n", "by the binomial theorem.\n", "Hence $p(x)$ is the probability mass function of a discrete random variable.\n", "A random variable with this probability mass function is said to be _binomially distributed\n", "with parameters $n$ and $p$_.\n", "The number of successes in $n$ independent trials that each have the same probability $p$ of success\n", "has a binomial distribution with parameters $n$ and $p$\n", "For instance, the number of times a fair die lands with 3 spots showing in 10 independent rolls has\n", "a binomial distribution with parameters $n=10$ and $p = 1/6$.\n", "\n", "For general random variables, the chance that $X$ is in some subset of $\\Re$ cannot be written as\n", "a sum or as a Riemann integral; it is more naturally represented as a Lebesgue integral (with respect to\n", "a measure other than Lebesgue measure).\n", "For example, imagine a random variable $X$ that has probability $\\alpha$ of being equal to zero;\n", "and if $X$ is not zero, it has a uniform distribution on the interval $[0, 1]$.\n", "Such a random variable is neither continuous nor discrete.\n", "\n", "Most of the random variables in this class are either discrete or continuous.\n", "\n", "If $X$ is a random variable such that, for some constant $x_1 \\in \\Re$, ${\\mathbb P}(X = x_1) = 1$, $X$\n", "is called a _constant random variable_." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "