{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Exercises ##"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**1.** Show that if $r > 1$ and $s > 1$ then the mode of the beta $(r, s)$ distribution is $(r-1)/(r+s-2)$. Remember to ignore multiplicative constants and take the log before maximizing."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**2.** A coin lands heads with chance $X$ where $X$ has the beta $(2, 2)$ density. The coin is tossed five times. That is, for every $p \\in (0, 1)$, conditionally given $X=p$ the tosses are i.i.d. Bernoulli $(p)$ random variables.\n",
"\n",
"(a) What is the chance that the first toss lands heads?\n",
"\n",
"(b) Given that the first toss lands heads, what is the chance that the second toss lands heads?\n",
"\n",
"(c) Given that four out of the first five tosses land heads, find the posterior distribution and posterior mean of $X$.\n",
"\n",
"(d) Find the chance that four out of the first five tosses land heads, and compare it with the chance that four out of five tosses of a fair coin land heads."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**3.** The chance of heads of a random coin is picked according to the beta $(r, s)$ distribution. The coin is tossed repeatedly.\n",
"\n",
"(a) What is the chance that the first three tosses are heads and the next three tosses are tails?\n",
"\n",
"(b) Given that the first three tosses are heads and the next three tosses are tails, what is the chance that the seventh toss is a head?\n",
"\n",
"(c) Given that three out of the first six tosses are heads, what is the chance that the seventh toss is a head? Compare with the answer to (b)."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**4.** Person A creates a coin by picking its chance of heads uniformly on $(0, 1)$. In three tosses of that coin, Person A gets two heads.\n",
"\n",
"Independently of Person A, Person B creates a coin by picking its chance of heads uniformly on $(0, 1)$. In three tosses of that coin, Person B gets one head.\n",
"\n",
"(a) Given the data, what is the distribution of the chance of heads of Person A's coin?\n",
"\n",
"(b) Given the data, what is the distribution of the chance of heads of Person B's coin?\n",
"\n",
"(c) Given the data, what is the probability that Person A's coin has a higher chance of heads than Person B's coin? You should be able to do this by using beta facts, without any direct integration."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}