Skip to content

Commit

Permalink
Added variance to lecture 2.
Browse files Browse the repository at this point in the history
  • Loading branch information
ebilionis committed Jan 4, 2016
1 parent b35be61 commit c2465b2
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 3 deletions.
14 changes: 12 additions & 2 deletions hw/hw_01.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,18 @@
"p(x_1 \\le X \\le x_2|I) = F(x_2) - F(x_1).\n",
"$$\n",
"\n",
"3. **Note**: There is no need to remember anything of what follows. The purpose of this exercise is to get familiar with the laws of probability. \n",
"Let $X,Y,Z$, and $W$ be random variables. "
"4. Let $X$ be a random variable. Prove that:\n",
"$$\n",
"\\mathbb{V}[X] = \\mathbb{E}[X^2] - \\left(\\mathbb{E}[X]\\right)^2.\n",
"$$\n",
"\n",
"Let $X$ be the following random variable:\n",
"$$\n",
"X = \\begin{cases}\n",
"1,& \\theta,\\\\\n",
"0,& 1-\\theta,\n",
"\\end{cases}\n",
"$$"
]
},
{
Expand Down
25 changes: 25 additions & 0 deletions lectures/lec_02.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,31 @@
"\\mathbb{E}[X|Y=y] := \\mathbb{E}[X|Y=y,I] = \\int xp(x|y)dx.\n",
"$$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Variance of a Random Variable\n",
"\n",
"The variance of $X$ is defined to be:\n",
"$$\n",
"\\mathbb{V}[X] = \\int (x - \\mathbb{E})^2p(x)dx.\n",
"$$\n",
"It is easy to prove (and a very useful formulat to remember), that:\n",
"$$\n",
"\\mathbb{V}[X] = \\mathbb{E}[X^2] - \\left(\\mathbb{E}[X]\\right)^2.\n",
"$$"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
33 changes: 32 additions & 1 deletion lectures/lec_03.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,37 @@
"+ Learn about some famous continous PDFs"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Discrete random variables\n",
"\n",
"### Coin flipping: Heads = 1, Tails = 0\n",
"\n",
"Let $X$ be the following random variable:\n",
"$$\n",
"X = \\begin{cases}\n",
"1,& \\theta,\\\\\n",
"0,& 1-\\theta,\n",
"\\end{cases}\n",
"$$\n",
"where $\\theta\\in[0,1]$ is the probability of getting heads (i.e., 1).\n",
"The PDF of this random variable has two values:\n",
"$$\n",
"p(X=1|\\theta) = \\theta,\n",
"$$\n",
"and\n",
"$$\n",
"p(X=0|\\theta) = 1-\\theta.\n",
"$$\n",
"\n",
"The expected value is:\n",
"$$\n",
"\\mathbb{E}[X|\\theta] = \\sum_x xp(X=x|\\theta) = 1\\times p(X=1|\\theta) + 0\\times p(X=0|\\theta) = \\theta.\n",
"$$"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -424,7 +455,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.10"
"version": "2.7.11"
},
"latex_envs": {
"bibliofile": "biblio.bib",
Expand Down

0 comments on commit c2465b2

Please sign in to comment.