├── .gitignore ├── src ├── chapters │ ├── 1 │ │ ├── sections │ │ │ ├── axioms_of_probability │ │ │ │ ├── problems │ │ │ │ │ ├── 46.tex │ │ │ │ │ ├── 44.tex │ │ │ │ │ ├── 45.tex │ │ │ │ │ ├── 43.tex │ │ │ │ │ └── 47.tex │ │ │ │ └── index.tex │ │ │ ├── story_proofs │ │ │ │ ├── index.tex │ │ │ │ └── problems │ │ │ │ │ ├── 19.tex │ │ │ │ │ ├── 18.tex │ │ │ │ │ ├── 17.tex │ │ │ │ │ └── 21.tex │ │ │ ├── inclusion_exclusion │ │ │ │ ├── index.tex │ │ │ │ └── problems │ │ │ │ │ ├── 55.tex │ │ │ │ │ ├── 53.tex │ │ │ │ │ ├── 52.tex │ │ │ │ │ └── 49.tex │ │ │ ├── counting │ │ │ │ ├── problems │ │ │ │ │ ├── 13.tex │ │ │ │ │ ├── 1.tex │ │ │ │ │ ├── 4.tex │ │ │ │ │ ├── 11.tex │ │ │ │ │ ├── 3.tex │ │ │ │ │ ├── 2.tex │ │ │ │ │ ├── 14.tex │ │ │ │ │ ├── 12.tex │ │ │ │ │ ├── 6.tex │ │ │ │ │ └── 5.tex │ │ │ │ └── index.tex │ │ │ ├── mixed_practice │ │ │ │ ├── index.tex │ │ │ │ └── problems │ │ │ │ │ ├── 58.tex │ │ │ │ │ ├── 60.tex │ │ │ │ │ ├── 59.tex │ │ │ │ │ ├── 57.tex │ │ │ │ │ └── 56.tex │ │ │ └── naive_definition_of_probability │ │ │ │ ├── problems │ │ │ │ ├── 27.tex │ │ │ │ ├── 39.tex │ │ │ │ ├── 40.tex │ │ │ │ ├── 30.tex │ │ │ │ ├── 23.tex │ │ │ │ ├── 37.tex │ │ │ │ ├── 41.tex │ │ │ │ ├── 38.tex │ │ │ │ ├── 26.tex │ │ │ │ ├── 35.tex │ │ │ │ ├── 36.tex │ │ │ │ └── 32.tex │ │ │ │ └── index.tex │ │ └── index.tex │ ├── 2 │ │ ├── sections │ │ │ ├── conditioning_on_evidence │ │ │ │ ├── problems │ │ │ │ │ ├── 19.tex │ │ │ │ │ ├── 15.tex │ │ │ │ │ ├── 11.tex │ │ │ │ │ ├── 6.tex │ │ │ │ │ ├── 18.tex │ │ │ │ │ ├── 21.tex │ │ │ │ │ ├── 29.tex │ │ │ │ │ ├── 4.tex │ │ │ │ │ ├── 5.tex │ │ │ │ │ ├── 16.tex │ │ │ │ │ ├── 27.tex │ │ │ │ │ ├── 3.tex │ │ │ │ │ ├── 20.tex │ │ │ │ │ ├── 10.tex │ │ │ │ │ ├── 8.tex │ │ │ │ │ ├── 7.tex │ │ │ │ │ ├── 12.tex │ │ │ │ │ ├── 9.tex │ │ │ │ │ ├── 14.tex │ │ │ │ │ ├── 17.tex │ │ │ │ │ ├── 28.tex │ │ │ │ │ └── 13.tex │ │ │ │ └── index.tex │ │ │ ├── first-step_analysis_and_gamblers_ruin │ │ │ │ ├── problems │ │ │ │ │ ├── 53.tex │ │ │ │ │ ├── 52.tex │ │ │ │ │ ├── 54.tex │ │ │ │ │ └── 49.tex │ │ │ │ └── index.tex │ │ │ ├── independence_and_conditional_independence │ │ │ │ ├── problems │ │ │ │ │ ├── 37.tex │ │ │ │ │ ├── 36.tex │ │ │ │ │ ├── 38.tex │ │ │ │ │ ├── 34.tex │ │ │ │ │ └── 33.tex │ │ │ │ └── index.tex │ │ │ ├── simpsons_paradox │ │ │ │ ├── index.tex │ │ │ │ └── problems │ │ │ │ │ ├── 58.tex │ │ │ │ │ └── 57.tex │ │ │ ├── monty_hall │ │ │ │ ├── index.tex │ │ │ │ └── problems │ │ │ │ │ ├── 41.tex │ │ │ │ │ ├── 45.tex │ │ │ │ │ ├── 46.tex │ │ │ │ │ ├── 42.tex │ │ │ │ │ ├── 44.tex │ │ │ │ │ ├── 43.tex │ │ │ │ │ └── 47.tex │ │ │ └── mixed_problems │ │ │ │ ├── problems │ │ │ │ ├── 63.tex │ │ │ │ ├── 71.tex │ │ │ │ ├── 68.tex │ │ │ │ ├── 72.tex │ │ │ │ ├── 67.tex │ │ │ │ ├── 69.tex │ │ │ │ ├── 65.tex │ │ │ │ ├── 60.tex │ │ │ │ ├── 62.tex │ │ │ │ ├── 66.tex │ │ │ │ ├── 61.tex │ │ │ │ ├── 64.tex │ │ │ │ └── 70.tex │ │ │ │ └── index.tex │ │ └── index.tex │ ├── 3 │ │ ├── sections │ │ │ ├── pmfs_and_cdfs │ │ │ │ ├── problems │ │ │ │ │ ├── 3.tex │ │ │ │ │ ├── 13.tex │ │ │ │ │ ├── 8.tex │ │ │ │ │ ├── 14.tex │ │ │ │ │ ├── 1.tex │ │ │ │ │ ├── 12.tex │ │ │ │ │ ├── 5.tex │ │ │ │ │ ├── 10.tex │ │ │ │ │ ├── 7.tex │ │ │ │ │ ├── 2.tex │ │ │ │ │ ├── 4.tex │ │ │ │ │ └── 9.tex │ │ │ │ └── index.tex │ │ │ ├── named_distributions │ │ │ │ ├── problems │ │ │ │ │ ├── 16.tex │ │ │ │ │ ├── 17.tex │ │ │ │ │ ├── 19.tex │ │ │ │ │ ├── 15.tex │ │ │ │ │ ├── 23.tex │ │ │ │ │ ├── 26.tex │ │ │ │ │ ├── 32.tex │ │ │ │ │ ├── 27.tex │ │ │ │ │ ├── 36.tex │ │ │ │ │ ├── 34.tex │ │ │ │ │ ├── 20.tex │ │ │ │ │ ├── 22.tex │ │ │ │ │ ├── 33.tex │ │ │ │ │ ├── 31.tex │ │ │ │ │ ├── 30.tex │ │ │ │ │ └── 24.tex │ │ │ │ └── index.tex │ │ │ ├── mixed_practice │ │ │ │ ├── index.tex │ │ │ │ └── problems │ │ │ │ │ ├── 47.tex │ │ │ │ │ └── 46.tex │ │ │ └── independence_of_rvs │ │ │ │ ├── problems │ │ │ │ ├── 39.tex │ │ │ │ ├── 38.tex │ │ │ │ ├── 41.tex │ │ │ │ ├── 43.tex │ │ │ │ └── 40.tex │ │ │ │ └── index.tex │ │ └── index.tex │ ├── 4 │ │ ├── sections │ │ │ ├── LOTUS │ │ │ │ ├── index.tex │ │ │ │ └── problems │ │ │ │ │ ├── 62.tex │ │ │ │ │ └── 63.tex │ │ │ ├── expectations_and_variances │ │ │ │ ├── problems │ │ │ │ │ ├── 12.tex │ │ │ │ │ ├── 1.tex │ │ │ │ │ ├── 2.tex │ │ │ │ │ ├── 5.tex │ │ │ │ │ ├── 14.tex │ │ │ │ │ ├── 11.tex │ │ │ │ │ ├── 3.tex │ │ │ │ │ ├── 6.tex │ │ │ │ │ ├── 9.tex │ │ │ │ │ ├── 7.tex │ │ │ │ │ ├── 15.tex │ │ │ │ │ ├── 17.tex │ │ │ │ │ ├── 10.tex │ │ │ │ │ ├── 16.tex │ │ │ │ │ └── 8.tex │ │ │ │ └── index.tex │ │ │ ├── mixed_practice │ │ │ │ ├── problems │ │ │ │ │ ├── 88.tex │ │ │ │ │ ├── 80.tex │ │ │ │ │ ├── 89.tex │ │ │ │ │ ├── 90.tex │ │ │ │ │ ├── 91.tex │ │ │ │ │ ├── 87.tex │ │ │ │ │ ├── 92.tex │ │ │ │ │ ├── 79.tex │ │ │ │ │ └── 86.tex │ │ │ │ └── index.tex │ │ │ ├── poisson_approximation │ │ │ │ ├── index.tex │ │ │ │ └── problems │ │ │ │ │ ├── 71.tex │ │ │ │ │ ├── 69.tex │ │ │ │ │ └── 73.tex │ │ │ ├── indicator_r.v.s │ │ │ │ ├── problems │ │ │ │ │ ├── 38.tex │ │ │ │ │ ├── 42.tex │ │ │ │ │ ├── 49.tex │ │ │ │ │ ├── 52.tex │ │ │ │ │ ├── 40.tex │ │ │ │ │ ├── 41.tex │ │ │ │ │ ├── 46.tex │ │ │ │ │ ├── 43.tex │ │ │ │ │ ├── 45.tex │ │ │ │ │ ├── 50.tex │ │ │ │ │ ├── 39.tex │ │ │ │ │ ├── 60.tex │ │ │ │ │ ├── 54.tex │ │ │ │ │ ├── 53.tex │ │ │ │ │ ├── 56.tex │ │ │ │ │ └── 59.tex │ │ │ │ └── index.tex │ │ │ └── named_distributions │ │ │ │ ├── problems │ │ │ │ ├── 29.tex │ │ │ │ ├── 24.tex │ │ │ │ ├── 33.tex │ │ │ │ ├── 20.tex │ │ │ │ ├── 26.tex │ │ │ │ ├── 28.tex │ │ │ │ ├── 30.tex │ │ │ │ └── 31.tex │ │ │ │ └── index.tex │ │ └── index.tex │ ├── 5 │ │ ├── sections │ │ │ ├── uniform_and_universality │ │ │ │ ├── index.tex │ │ │ │ └── problems │ │ │ │ │ ├── 14.tex │ │ │ │ │ └── 13.tex │ │ │ ├── normal │ │ │ │ ├── index.tex │ │ │ │ └── problems │ │ │ │ │ ├── 28.tex │ │ │ │ │ ├── 35.tex │ │ │ │ │ ├── 20.tex │ │ │ │ │ └── 26.tex │ │ │ ├── exponential │ │ │ │ ├── index.tex │ │ │ │ └── problems │ │ │ │ │ ├── 45.tex │ │ │ │ │ ├── 39.tex │ │ │ │ │ ├── 47.tex │ │ │ │ │ └── 37.tex │ │ │ ├── pdfs_and_cdfs │ │ │ │ ├── problems │ │ │ │ │ ├── 2.tex │ │ │ │ │ ├── 3.tex │ │ │ │ │ ├── 7.tex │ │ │ │ │ ├── 5.tex │ │ │ │ │ ├── 1.tex │ │ │ │ │ ├── 6.tex │ │ │ │ │ └── 8.tex │ │ │ │ └── index.tex │ │ │ └── mixed_practice │ │ │ │ ├── problems │ │ │ │ ├── 58.tex │ │ │ │ ├── 57.tex │ │ │ │ ├── 50.tex │ │ │ │ ├── 56.tex │ │ │ │ ├── 51.tex │ │ │ │ ├── 62.tex │ │ │ │ ├── 52.tex │ │ │ │ └── 59.tex │ │ │ │ └── index.tex │ │ └── index.tex │ └── 6 │ │ ├── sections │ │ ├── moment_generating_functions │ │ │ ├── index.tex │ │ │ └── problems │ │ │ │ └── 15.tex │ │ └── means_medians_modes_moments │ │ │ ├── problems │ │ │ ├── 1.tex │ │ │ └── 2.tex │ │ │ └── index.tex │ │ └── index.tex ├── preamble.tex └── index.tex ├── .github └── workflows │ └── makefile.yml ├── add-pdf-url.py ├── Makefile ├── my.cfg └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | _publish.R 5 | _book 6 | _bookdown_files 7 | rsconnect 8 | output 9 | -------------------------------------------------------------------------------- /src/chapters/2/sections/conditioning_on_evidence/problems/19.tex: -------------------------------------------------------------------------------- 1 | See \url{https://math.stackexchange.com/q/3292400/649082} -------------------------------------------------------------------------------- /src/chapters/3/sections/pmfs_and_cdfs/problems/3.tex: -------------------------------------------------------------------------------- 1 | $P(Y \leq k) = P(X \leq \frac{k-\mu}{\sigma}) = F(\frac{k-\mu}{\sigma}).$ -------------------------------------------------------------------------------- /src/chapters/3/sections/named_distributions/problems/16.tex: -------------------------------------------------------------------------------- 1 | $$P(X=k|X \in B) = \frac{\frac{1}{|C|}}{\frac{|B|}{|C|}} = \frac{1}{|B|}$$ -------------------------------------------------------------------------------- /src/chapters/3/sections/named_distributions/problems/17.tex: -------------------------------------------------------------------------------- 1 | $$P(X \leq 100) = \sum_{i=0}^{100}\binom{110}{i}(0.9)^{i}(0.1)^{110-i}$$ -------------------------------------------------------------------------------- /src/chapters/2/sections/first-step_analysis_and_gamblers_ruin/problems/53.tex: -------------------------------------------------------------------------------- 1 | See \url{https://math.stackexchange.com/a/2706032/649082} -------------------------------------------------------------------------------- /src/chapters/2/sections/independence_and_conditional_independence/problems/37.tex: -------------------------------------------------------------------------------- 1 | See \url{https://math.stackexchange.com/a/3789043/649082} -------------------------------------------------------------------------------- /src/chapters/3/sections/pmfs_and_cdfs/problems/13.tex: -------------------------------------------------------------------------------- 1 | $$P(X=a) = \sum_{z \in Z}P(Z=z)P(X=a|Z=z) = \sum_{z \in Z}P(Z=z)P(Y=a|Z=z) = P 2 | (Y=a).$$ -------------------------------------------------------------------------------- /src/chapters/3/sections/pmfs_and_cdfs/problems/8.tex: -------------------------------------------------------------------------------- 1 | $P(X=k) = \frac{\binom{k-1}{4}}{\binom{100}{5}}$ for $k \geq 5$. 2 | 3 | $P(X=k) = 0$ for $k < 5$. -------------------------------------------------------------------------------- /src/chapters/1/sections/axioms_of_probability/problems/46.tex: -------------------------------------------------------------------------------- 1 | $B_{k} = C_{k} - C_{k+1}$. Since $C_{k+1} \subseteq C_{k}$, 2 | $P(B_{k}) = P(C_{k}) - P(C_{k+1})$. -------------------------------------------------------------------------------- /src/chapters/6/sections/moment_generating_functions/index.tex: -------------------------------------------------------------------------------- 1 | \section{Moment Generating Functions} 2 | 3 | \subsection{problem 15} 4 | \input{problems/15} 5 | -------------------------------------------------------------------------------- /src/chapters/4/sections/LOTUS/index.tex: -------------------------------------------------------------------------------- 1 | \section{LOTUS} 2 | 3 | \subsection{problem 62} 4 | \input{problems/62} 5 | 6 | \subsection{problem 63} 7 | \input{problems/63} -------------------------------------------------------------------------------- /src/chapters/4/sections/expectations_and_variances/problems/12.tex: -------------------------------------------------------------------------------- 1 | Since $P(X=k) = P(X=-k)$, $\sum_{i=1}^{n}(iP(X=i) + (-i)P(X=-i)) = 0$. Hence, 2 | $\text{E}(X) = 0$. -------------------------------------------------------------------------------- /src/chapters/3/sections/mixed_practice/index.tex: -------------------------------------------------------------------------------- 1 | \section{Mixed Practice} 2 | 3 | \subsection{problem 46} 4 | \input{problems/46} 5 | 6 | \subsection{problem 47} 7 | \input{problems/47} -------------------------------------------------------------------------------- /src/chapters/2/sections/simpsons_paradox/index.tex: -------------------------------------------------------------------------------- 1 | \section{Simpson's Paradox} 2 | 3 | \subsection{problem 57} 4 | \input{problems/57} 5 | 6 | \subsection{problem 58} 7 | \input{problems/58} 8 | -------------------------------------------------------------------------------- /src/chapters/1/sections/axioms_of_probability/problems/44.tex: -------------------------------------------------------------------------------- 1 | Since $B = (B-A) \cup A$, $P(B) = P(A) + P(B - A)$ by the second axiom of 2 | probability. Rearranging terms, 3 | $$P(B-A) = P(B) - P(A)$$ -------------------------------------------------------------------------------- /src/chapters/4/sections/LOTUS/problems/62.tex: -------------------------------------------------------------------------------- 1 | $\text{E}(2^{X}) = \sum_{k=0}^{\infty}2^{k}P(X=k) = e^{-\lambda}\sum_{k=0}^{\infty} 2 | \frac{(2\lambda)^{k}}{k!} = e^{-\lambda}e^{2\lambda} = e^{\lambda}$. -------------------------------------------------------------------------------- /src/chapters/5/sections/uniform_and_universality/index.tex: -------------------------------------------------------------------------------- 1 | \section{Uniform and Universality} 2 | 3 | \subsection{problem 13} 4 | \input{problems/13} 5 | \subsection{problem 14} 6 | \input{problems/14} 7 | -------------------------------------------------------------------------------- /src/chapters/6/sections/means_medians_modes_moments/problems/1.tex: -------------------------------------------------------------------------------- 1 | 2 | The median is \((a+b)/2\), the solution to \(P(X 0$. -------------------------------------------------------------------------------- /src/chapters/4/sections/expectations_and_variances/problems/5.tex: -------------------------------------------------------------------------------- 1 | Let $X \sim \text{DUniform}(n)$. 2 | 3 | $$E(X) = \frac{1}{n}\sum_{i=1}^{n}i = \frac{1}{2}(n+1)$$ 4 | 5 | $$\text{Var}(X) = E(X^{2}) - (E(X))^{2} = \frac{1}{n}\sum_{i=1}^{n}i^{2} - ( 6 | \frac{1}{2}(n+1))^{2} = \frac{1}{6}(n+1)(2n+1) - \frac{1}{4}(n+1)^{2}$$ -------------------------------------------------------------------------------- /src/chapters/4/sections/poisson_approximation/index.tex: -------------------------------------------------------------------------------- 1 | \section{Poisson approximation} 2 | 3 | \subsection{problem 69} 4 | \input{problems/69} 5 | 6 | \subsection{problem 71} 7 | \input{problems/71} 8 | 9 | \subsection{problem 72} 10 | \input{problems/72} 11 | 12 | \subsection{problem 73} 13 | \input{problems/73} 14 | -------------------------------------------------------------------------------- /src/chapters/1/sections/inclusion_exclusion/problems/53.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | 3 | \item $62^{8} - 36^{8}$ 4 | 5 | \item $62^{8} - 36^{8} - 36^{8} + 10^{8}$ 6 | 7 | \item $62^{8} - 36^{8} - 36^{8} - 10^{8} + 2(62^{8} - 36^{8} - 52^{8} + 26^{8}) 8 | + 62^{8} - 36^{8} - 36^{8} + 10^{8}$ 9 | 10 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/4/sections/mixed_practice/problems/80.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item $X \sim \text{FS}(\frac{20-m+1}{20}) \implies \text{E}(X) = \frac{20} 3 | {20-m+1}$ 4 | 5 | \item $\text{E}(\sqrt{X}) = \sum_{x \in X}\sqrt{x}P(X = x) = \sum_{i=1}^ 6 | {20}\sqrt{i}(\frac{m-1}{20})^{i-1}\frac{20-m+1}{20}$ 7 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/1/sections/axioms_of_probability/problems/45.tex: -------------------------------------------------------------------------------- 1 | $B \bigtriangleup A = (A \cup B) - (A \cap B)$. By problem $44$, 2 | \begin{flalign} 3 | P(B \bigtriangleup A) & = P(A \cup B) - P(A \cap B) \nonumber && \\ 4 | & = P(A) + P(B) - P(A \cap B) - P(A \cap B) \nonumber && \\ 5 | & = P(A) + P(B) - 2P(A \cap B) \nonumber 6 | \end{flalign} -------------------------------------------------------------------------------- /src/chapters/2/sections/conditioning_on_evidence/problems/6.tex: -------------------------------------------------------------------------------- 1 | Let $H$ be the event that $7$ tosses of a coin land Heads. 2 | Let $A$ be the event that a randomly selected coin is double-headed. 3 | $$P(A|H) = \frac{P(A)P(H|A)}{P(A)P(H|A) + P(A^{c})P(H|A^{c})} = 4 | \frac{\frac{1}{100}}{\frac{1}{100} + \frac{99}{100}*\left(\frac{1}{2}\right)^{7}}$$ -------------------------------------------------------------------------------- /src/chapters/2/sections/first-step_analysis_and_gamblers_ruin/index.tex: -------------------------------------------------------------------------------- 1 | \section{First-step Analysis and Gambler's Ruin} 2 | 3 | \subsection{problem 49} 4 | \input{problems/49} 5 | 6 | \subsection{problem 52} 7 | \input{problems/52} 8 | 9 | \subsection{problem 53} 10 | \input{problems/53} 11 | 12 | \subsection{problem 54} 13 | \input{problems/54} -------------------------------------------------------------------------------- /src/chapters/3/sections/named_distributions/problems/15.tex: -------------------------------------------------------------------------------- 1 | \[ F_X(x) = P(X \le x) = \begin{cases} 2 | 0 &, \text{ if } x < 1\\ 3 | \frac{\lfloor x \rfloor}{n} &, \text{ if } 1 \le x \le n\\ 4 | 1 &, \text{ if } x > n 5 | \end{cases} 6 | \] 7 | 8 | where $\lfloor x \rfloor$ equals the largest integer that is less than or equal to $x$ . -------------------------------------------------------------------------------- /src/chapters/1/sections/counting/problems/1.tex: -------------------------------------------------------------------------------- 1 | There are \[\binom{11}{4}\] ways to select $4$ positions for $I$, \[\binom{7}{4}\] 2 | 3 | ways to select $4$ postions for $S$, \[\binom{3}{2}\] ways to selection $2$ 4 | positions for $P$ leaving us with a single choice of position for $M$. In total, 5 | we get 6 | \[\binom{11}{4}\binom{7}{4}\binom{3}{2}\binom{1}{1}\] permutations. -------------------------------------------------------------------------------- /src/chapters/5/sections/pdfs_and_cdfs/problems/2.tex: -------------------------------------------------------------------------------- 1 | Take \(\text{Unif}(0, \frac{1}{2})\), \\ 2 | \[f(x) = \{ 2, x \in (0, \frac{1}{2})\}\] 3 | \[\int_C f(x) dx = 1\] where \(C\) is the complete space. 4 | Say, \(f(x) > 1\) in a given domain \(X\) \\ 5 | \(f(x) > 0\), so \(\int_D f(x) dx \le \int_C f(x) dx \) \\ 6 | Here \(\int_D 1 dx < \int_D f(x) dx\) \\ 7 | We can say, \(|D| < 1\) -------------------------------------------------------------------------------- /src/chapters/1/sections/axioms_of_probability/index.tex: -------------------------------------------------------------------------------- 1 | \section{Axioms Of Probability} 2 | 3 | \subsection{problem 43} 4 | \input{problems/43} 5 | 6 | \subsection{problem 44} 7 | \input{problems/44} 8 | 9 | \subsection{problem 45} 10 | \input{problems/45} 11 | 12 | \subsection{problem 46} 13 | \input{problems/46} 14 | 15 | \subsection{problem 47} 16 | \input{problems/47} 17 | -------------------------------------------------------------------------------- /src/chapters/4/sections/expectations_and_variances/problems/14.tex: -------------------------------------------------------------------------------- 1 | $\text{E}(X) = c\sum_{i=1}^{\infty}p^{k} = c(\frac{1}{1-p} - 1) = -\frac{1}{\log(1-p)}\frac{p}{1-p}$ 2 | 3 | $\text{E}(X) = \text{E}(X^{2}) - (\text{E}(X))^{2} = c \sum_{i=1}^{\infty}ip^{i} 4 | - (-\frac{1}{\log(1-p)}\frac{p}{1-p})^{2} = -\frac{1}{\log(1-p)} \frac{p}{ 5 | (p-1)^{2}} - (-\frac{1}{\log(1-p)}\frac{p}{1-p})^{2}$ -------------------------------------------------------------------------------- /src/chapters/4/sections/LOTUS/problems/63.tex: -------------------------------------------------------------------------------- 1 | $\text{E}(2^{X}) = \sum_{k=0}^{\infty}2^{k}(1-p)^{k}p = p\sum_{k=0}^{\infty} 2 | (2-2p)^{k} = \frac{p}{2p-1}$ when $2-2p < 1 \implies p > \frac{1}{2}$. 3 | 4 | $\text{E}(2^{-X}) = \sum_{k=0}^{\infty}2^{-k}(1-p)^{k}p = p\sum_{k=0}^ 5 | {\infty}(\frac{1-p}{2})^{k} = \frac{p}{\frac{1+p}{2}} = \frac{2p}{1+p}$ when $ 6 | \frac{1-p}{2} < 1$ which is always true. -------------------------------------------------------------------------------- /src/chapters/4/sections/indicator_r.v.s/problems/38.tex: -------------------------------------------------------------------------------- 1 | Let $I_{j}$ be the indicator random variable for $j$-th person drawing the slip 2 | of paper containing their name. 3 | 4 | Let $X = \sum_{j=1}^{n}I_{j}$ be the number of people who draw their name. Then, 5 | by 6 | linearity of expectation, 7 | $\text{E}(X) = \text{E}(\sum_{j=1}^{n}I_{j}) = \sum_{j=1}^{n}\text{E}(I_{j}) = 8 | \sum_{j=1}^{n}\frac{1}{n} = 1$. -------------------------------------------------------------------------------- /src/chapters/4/sections/indicator_r.v.s/problems/42.tex: -------------------------------------------------------------------------------- 1 | Let $I_{j}$ be the indicator variable for the $j$-th toy being of a new type. 2 | The number of toy types after collecting $t$ toys is $X = \sum_{j=1}^{t}I_{j}$. 3 | $P(I_{j}=1) = (\frac{n-1}{n})^{j-1}$. Thus, $$\text{E}(X) = \text{E}(\sum_{j=1}^ 4 | {t}I_{j}) = \sum_{j=1}^{t}\text{E}(I_{j}) = \sum_{j=1}^{t}(\frac{n-1}{n})^{j-1} 5 | = n - n(\frac{n-1}{n})^{t}$$ -------------------------------------------------------------------------------- /src/chapters/1/sections/story_proofs/problems/19.tex: -------------------------------------------------------------------------------- 1 | Since the subsets have size $5$, a middle element can range from $3$ to $n+1$. 2 | Let us label middle elements as $k+1$. Then, there are ${k \choose 2}$ choises 3 | of elements for the left half of a subset and 4 | ${n+3-(k+1) \choose 2} = {n+2-k \choose 2}$ choices for the right half. 5 | 6 | Taking the sum as $k+1$ ranges from $3$ to $n+1$, we get the desired result. -------------------------------------------------------------------------------- /src/chapters/3/sections/named_distributions/problems/23.tex: -------------------------------------------------------------------------------- 1 | Let $I_{i}$ be the indicator of the $i$-th person voting for Kodos. 2 | Then, $P(I_{i}=1) = p_{1}p_{2}p_{3}.$ Since the voters make their decisions 3 | independently, we have $n$ independent Bernoulli trials, which is precisely the 4 | story for a Binomial distribution. 5 | 6 | Thus, 7 | 8 | $$P(X = k) = \binom{n}{k}(p_{1}p_{2}p_{3})^{k}(1- p_{1}p_{2}p_{3})^{n-k}$$ -------------------------------------------------------------------------------- /src/chapters/1/sections/mixed_practice/index.tex: -------------------------------------------------------------------------------- 1 | \section{Mixed Practice} 2 | 3 | \subsection{problem 56} 4 | \input{problems/56} 5 | 6 | \subsection{problem 57} 7 | \input{problems/57} 8 | 9 | \subsection{problem 58} 10 | \input{problems/58} 11 | 12 | \subsection{problem 59} 13 | \input{problems/59} 14 | 15 | \subsection{problem 60} 16 | \input{problems/60} 17 | 18 | \subsection{problem 62} 19 | \input{problems/62} -------------------------------------------------------------------------------- /src/chapters/1/sections/naive_definition_of_probability/problems/27.tex: -------------------------------------------------------------------------------- 1 | For each of the $k$ names, we sample a memory location from $1$ to $n$ with 2 | equal probability, with replacement. This is exactly the setup of the birthday 3 | problem. Hence, the probability that at least one memory location has more than 4 | $1$ value is $$P(A) = 1 - P(A^{c}) = 1 - \frac{n(n-1) \dots (n-k+1)}{n^{k}}$$ 5 | Also, $P(A) = 1$ if $n < k$. -------------------------------------------------------------------------------- /src/chapters/3/sections/independence_of_rvs/problems/38.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item Let $Y = X + 1$. Then, $X$ and $Y$ are clearly dependent, and $P(X < Y) = 3 | 1$. 4 | 5 | \item Let $X$ be the value of a toss of a six sided die, with values $1$ to $6$. 6 | Let $Y$ be the value of a toss of a six sided die, with values $7$ to $12$. 7 | Tosses of the two die are independent, but $P(X < Y) = 1$. 8 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/4/sections/indicator_r.v.s/problems/49.tex: -------------------------------------------------------------------------------- 1 | Let $I_{j}$ be the indicator variable for the $j$-th prize being selected. The 2 | value recieved from the $j$-th prize is $jI_{j}$. Then, the total value 3 | $X$ is $\sum_{j=1}^{n}(jI_{j})$. $\text{E}(X) = \sum_{j=1}^{n}jP(I_{j}=1) = \sum_ 4 | {j=1}^{n}j\frac{\binom{n-1}{k-1}}{\binom{n}{k}} = \sum_ 5 | {j=1}^{n}j\frac{k}{n} = \frac{k}{n}\frac{n(n+1)}{2} = \frac{k(n+1)}{2}.$ 6 | -------------------------------------------------------------------------------- /src/chapters/1/sections/mixed_practice/problems/58.tex: -------------------------------------------------------------------------------- 1 | Explanation: https://math.stackexchange.com/questions/1936525/inclusion-exclusion-problem 2 | \begin{enumerate}[label=(\alph*)] 3 | \item Let $A$ be the event that at least $9$ widgets need to be tested. 4 | $$P(A) = 1 - P(A^{c}) = 1 - \frac{\binom{8}{3}3!9!}{12!}$$ 5 | 6 | \item Similar to part $a$, $$P(A) = 1 - P(A^{c}) = 1 - \frac{\binom{9}{3}3!9!}{12!}$$ 7 | \end{enumerate} 8 | -------------------------------------------------------------------------------- /src/chapters/4/sections/named_distributions/problems/29.tex: -------------------------------------------------------------------------------- 1 | Random variable $f(X)$ takes values that are the probabilities of a random value 2 | taken by $X$. Since $X \sim \text{Geom}(p)$, $f(X) \in \{ (1-p)^{k}p | k \in 3 | \mathbb{Z}_{\geq 0} \}$, and each value $(1-p)^{k}p$ of $f(X)$ occurs with 4 | probability $(1-p)^{k}p$. Thus, 5 | 6 | $$\text{E}(X) = \sum_{k=0}^{\infty}((1-p)^{k}p)^{2} = -\frac{p}{p-2}$$ for $|p - 7 | 1|^{2} < 1$. -------------------------------------------------------------------------------- /src/chapters/2/sections/independence_and_conditional_independence/index.tex: -------------------------------------------------------------------------------- 1 | \section{Independence and Conditional Independence} 2 | 3 | \subsection{problem 33} 4 | \input{problems/33} 5 | 6 | \subsection{problem 34} 7 | \input{problems/34} 8 | 9 | \subsection{problem 36} 10 | \input{problems/36} 11 | 12 | \subsection{problem 37} 13 | \input{problems/37} 14 | 15 | \subsection{problem 38} 16 | \input{problems/38} 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/chapters/5/sections/pdfs_and_cdfs/index.tex: -------------------------------------------------------------------------------- 1 | \section{PDFs and CDFs} 2 | 3 | \subsection{problem 1} 4 | \input{problems/1} 5 | \subsection{problem 2} 6 | \input{problems/2} 7 | \subsection{problem 3} 8 | \input{problems/3} 9 | \subsection{problem 5} 10 | \input{problems/5} 11 | \subsection{problem 6} 12 | \input{problems/6} 13 | \subsection{problem 7} 14 | \input{problems/7} 15 | \subsection{problem 8} 16 | \input{problems/8} 17 | -------------------------------------------------------------------------------- /src/chapters/3/sections/independence_of_rvs/index.tex: -------------------------------------------------------------------------------- 1 | \section{Independence of r.v.s} 2 | 3 | \subsection{problem 38} 4 | \input{problems/38} 5 | 6 | \subsection{problem 39} 7 | \input{problems/39} 8 | 9 | \subsection{problem 40} 10 | \input{problems/40} 11 | 12 | \subsection{problem 41} 13 | \input{problems/41} 14 | 15 | \subsection{problem 43} 16 | \input{problems/43} 17 | 18 | \subsection{problem 44} 19 | \input{problems/44} 20 | -------------------------------------------------------------------------------- /src/chapters/3/sections/named_distributions/problems/26.tex: -------------------------------------------------------------------------------- 1 | If $X \sim HGeom(w, b, n)$, then $n - X \sim HGeom(b, w, n)$. 2 | 3 | If $X$ counts the number of items sampled from the set of $w$ items in a 4 | sample of size $n$, then $n - X$ counts the number of items from the set of $b$ 5 | items in the same sample. 6 | 7 | To see this, notice that 8 | 9 | $$P(n - X = k) = P(X = n - k) = \frac{\binom{w}{n-k}\binom{b}{k}}{\binom{w+b} 10 | {n}}$$ -------------------------------------------------------------------------------- /src/chapters/2/sections/conditioning_on_evidence/problems/18.tex: -------------------------------------------------------------------------------- 1 | $P(A | B) = \frac{P(A \cap B)}{P(B)} = \frac{P(B) - P(B \cap A^c)}{P(B)} = 1 - \frac{P(B \cap A^c)}{P(B)}.$ 2 | 3 | Note that $P(A^c) = P(A^c \cap B) + P(A^c \cap B^c)$. 4 | Hence, $P(B \cap A^c) = P(A^c) - P(A^c \cap B^c) = 0 - P(A^c \cap B^c) = -P(A^c \cap B^c)$. 5 | 6 | Since probabilities are nonnegative, this implies $P(B \cap A^c) = P(A^c \cap B^c) = 0$. 7 | 8 | Thus, $P(A | B) = 1$. -------------------------------------------------------------------------------- /src/chapters/3/sections/independence_of_rvs/problems/41.tex: -------------------------------------------------------------------------------- 1 | Let $X$ be the event that Tom woke up at $8$ in the morning. Let $Y$ be the 2 | event 3 | that Tom has blue eyes. Let $Z$ be the event that Tom made it to his $7$ a.m. 4 | class. 5 | 6 | Clearly Tom's eye color is independent of the time he woke up and whether he 7 | made it to his early morning class or not. However, if Tom woke up at $8$, then 8 | he definitely did not make it to his $7$ am class. -------------------------------------------------------------------------------- /src/chapters/4/sections/indicator_r.v.s/problems/52.tex: -------------------------------------------------------------------------------- 1 | Let $I_{j}$ be the indicator variable for the $j$-toss landing on an outcome 2 | different from the previous toss for $2 \leq j \leq n$. Then, the total number 3 | of such tosses is $X = \sum_{j=2}^{n}I_{j}$. The total number of runs 4 | is $Y = X + 1$. Since $\text{E}(X) = \sum_{j=2}^{n}P(I_ 5 | {j}=1) = \sum_{j=2}^{n}\frac{1}{2} = \frac{n-1}{2}$, $\text{E}(Y) = \frac{n-1} 6 | {2} + 1 = \frac{n+1}{2}$. -------------------------------------------------------------------------------- /src/chapters/3/sections/named_distributions/problems/32.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item The problem fits the story of Hypergeometric distributions. 3 | 4 | $$P(X = k) = \frac{\binom{s}{k}\binom{100-s}{10-k}}{\binom{100}{10}}$$ 5 | for $0 \leq k \leq s$. 6 | 7 | \item 8 | \begin{verbatim} 9 | > x = 75 10 | > y_interval <- sum(dhyper(7:10, x, 100-x, 10)) 11 | > y_interval 12 | [1] 0.7853844 13 | \end{verbatim} 14 | \end{enumerate} 15 | -------------------------------------------------------------------------------- /src/chapters/3/sections/pmfs_and_cdfs/problems/14.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item $$1 - P(X = 0) = 1 - e^{-\lambda}$$ 3 | 4 | $$P(X \geq 2) = 1 - P(X = 0) - P(X = 1) = (1 - e^{-\lambda}) - e^ 5 | {-\lambda}\lambda$$ 6 | 7 | \item $$P(X = k | X > 0) = \frac{P(X = k)}{P(X > 0)} = \begin{cases} 8 | 0 & \text{if } k = 0 \\ 9 | \frac{\lambda^{k}}{(e^{\lambda} - 1)k!} & \text{if } k \geq 1 10 | \end{cases}$$ 11 | 12 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/2/sections/monty_hall/index.tex: -------------------------------------------------------------------------------- 1 | \section{Monty Hall} 2 | 3 | \subsection{problem 41} 4 | \input{problems/41} 5 | 6 | \subsection{problem 42} 7 | \input{problems/42} 8 | 9 | \subsection{problem 43} 10 | \input{problems/43} 11 | 12 | \subsection{problem 44} 13 | \input{problems/44} 14 | 15 | \subsection{problem 45} 16 | \input{problems/45} 17 | 18 | \subsection{problem 46} 19 | \input{problems/46} 20 | 21 | \subsection{problem 47} 22 | \input{problems/47} -------------------------------------------------------------------------------- /src/chapters/3/sections/pmfs_and_cdfs/problems/1.tex: -------------------------------------------------------------------------------- 1 | If the $k$-th person's arrival results in the first birthday match, the first 2 | $k-1$ people have $365*364*\cdots*(365-k+2)$ choices of birthday assignments 3 | such that no two people have the same birthday. The $k$-th person has $k-1$ 4 | choices of birthdays, since their birthday must match that of one of the first 5 | $k-1$ people. 6 | 7 | Thus, 8 | 9 | $$P(X=k) = \frac{365*364*\cdots*(365-k+2)}{365^{k-1}} \frac{k-1}{365}$$ -------------------------------------------------------------------------------- /src/chapters/4/sections/indicator_r.v.s/problems/40.tex: -------------------------------------------------------------------------------- 1 | Let $I_{j}$ be the indicator random variable for HTH pattern starting on the 2 | $j$-th toss. Since the tosses are independent, $P(I_{j}=1) = \frac{1}{8}$ for $1 3 | \leq j \leq n-2$. 4 | 5 | Let $X = \sum_{j=1}^{n-2}I_{j}$ be the number of HTH patterns in $n$ independent 6 | coin tosses. Then, $$\text{E}(X) = \text{E}(\sum_{j=1}^{n-2}I_{j}) = \sum_{j=1}^ 7 | {n-2}\text{E}(I_{j}) = \sum_{j=1}^{n-2}\frac{1}{8} = \frac{n-2}{8}$$ -------------------------------------------------------------------------------- /src/chapters/4/sections/expectations_and_variances/problems/11.tex: -------------------------------------------------------------------------------- 1 | Note that $31 = 2^{4} + 2^{3} + 2^{2} + 2^{1} + 1$. Thus, Martin can play at 2 | most $5$ rounds. For every possible win, Martin makes $1$ dollar. If the game 3 | reaches the fifth round, it is also possible that Martin loses and walks away 4 | with nothing. 5 | 6 | Let $X$ be Martin's winnings. 7 | 8 | Then, 9 | 10 | $$\text{E}(X) = \sum_{i=1}^{5}(\frac{1}{2^{i}} 1) + (\frac{1}{2^{5}} 11 | 0) \approx 0.97$$ -------------------------------------------------------------------------------- /src/chapters/4/sections/expectations_and_variances/problems/3.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item Let $D$ be the value of the die roll. 3 | $$E(D) = \frac{1}{6}(1 + 2 + 3 + 4 + 5 + 6) = 3.5$$ 4 | 5 | \item Let $T_{4}$ be the total sum of the four die rolls, and let $D_{i}$ be 6 | the value of the $i$-th roll. Note that $T_{4} = D_ 7 | {1} + D_{2} + D_{3} + D_{4}$. Then, by linearity of expectation, 8 | 9 | $$E(T_{4}) = 4E(D_{i}) = 4*3.5 = 12.2$$ 10 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/5/sections/normal/problems/28.tex: -------------------------------------------------------------------------------- 1 | Starting from the fact given in the problem 2 | 3 | $$ 4 | P(|Y - \mu| < 1.96\sigma) \approx 0.95 5 | $$ 6 | 7 | $$ 8 | P(-1.96\sigma < Y-\mu < 1.96\sigma) \approx 0.95 9 | $$ 10 | 11 | $$ 12 | P(Y - 1.96\sigma < \mu < Y + 1.96\sigma) \approx 0.95 13 | $$ 14 | 15 | $$ 16 | P(\mu \in (Y-1.96\sigma,Y+1.96\sigma)) \approx 0.95 17 | $$ 18 | 19 | Therefore, the random interval that contains $\mu$ about 95\% of the time is $(Y-1.96\sigma,Y+1.96\sigma)$. 20 | -------------------------------------------------------------------------------- /src/chapters/1/sections/mixed_practice/problems/60.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item $n^{n}$ 3 | 4 | \item $\binom{2n-1}{n-1}$ 5 | 6 | \item The least likely bootstrap sample is one where $a_{1} = a_{2} = \cdots = a_{n}$. 7 | Such a sample occurs with probability $\frac{1}{n^{n}}$. The most likely 8 | bootstrap sample is one where all the terms are different. Such a sample 9 | occurs with probability $\frac{n!}{n^{n}}$. Thus, the ratio of the probabilities 10 | is $n!$ 11 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/2/sections/conditioning_on_evidence/problems/21.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | 3 | \item The sample space is $(H, H, H), (H, H, T), (H, T, H), (T, H, H)$. Since each 4 | outcome is equally likely, the answer is $\frac{1}{4}$. 5 | 6 | \item Since the last throw is independent of the first two, the probability 7 | that all three throws landed heads given two of them landed heads equals 8 | the probability that the third throw landed heads, which is $\frac{1}{2}$. 9 | 10 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/4/sections/indicator_r.v.s/problems/41.tex: -------------------------------------------------------------------------------- 1 | Let $I_{j}$ be the indicator variable for $j$-th card being red. Let $R_{j} = 2 | I_{j}I_{j+1}$ be the indicator variable for the $j$-th and $j+1$-st cards being 3 | red. Let $X = \sum_{j=1}^{51}R_{j}$ be the number of consecutive red pairs in a 4 | well shuffled deck of 52 cards. Then, $$\text{E}(X) = \text{E}(\sum_{j=1}^{51}R_ 5 | {j}) = \sum_{j=1}^{51}\text{E}(R_{j}) = \sum_{j=1}^{51}\frac{\binom{26}{2}}{ 6 | \binom{52}{2}} = 51\frac{\binom{26}{2}}{\binom{52}{2}}$$ -------------------------------------------------------------------------------- /src/chapters/1/sections/counting/problems/4.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item There are ${n \choose 2}$ matches. 3 | 4 | For a given match, there are two outcomes. Each match has two possible outcomes. 5 | We can use the multiplication rule to count the total possible outcomes. 6 | 7 | $$ 2^{{n \choose 2}} $$ 8 | 9 | \item Since every player plays every other player exactly once, the number of 10 | games is the number of ways to pair up $n$ people. 11 | 12 | $$ {n \choose 2} $$ 13 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/3/sections/named_distributions/problems/27.tex: -------------------------------------------------------------------------------- 1 | $X$ is not Binomial becuase the outcome of a card is not independent of the 2 | previous cards' outcomes. For instance, if the first $n-1$ cards match, then the 3 | probability of the last card matching is $1$. 4 | 5 | The Hypergeometric story requires sampling from two finite sets, but 6 | the matching cards isn't a set of predetermined size, so the story doesn't fit. 7 | 8 | $$P(X = k) = \frac{\binom{n}{k}!(n-k)}{n!}$$ 9 | 10 | where $!(n-k)$ is a subfactorial. -------------------------------------------------------------------------------- /src/chapters/5/sections/mixed_practice/problems/58.tex: -------------------------------------------------------------------------------- 1 | (a) 2 | \begin{flalign} 3 | \mathbb{E}[Y] & = \frac{1}{2} \cdot 0 + \int_{0}^{\infty} x f(x) dx \\ 4 | & = \int_{0}^{\infty} \frac{1}{\sqrt{2\pi}} x e^{-\frac{x^2}{2}} dx 5 | \end{flalign} 6 | 7 | (b) 8 | N is the first success distribution with \(p = \frac{1}{2}\) 9 | \(\mathbb{E}[N] = 2\) 10 | 11 | (c) 12 | \begin{equation} 13 | F_Y(y) = 14 | \begin{cases} 15 | 0 & y < 0 \\ 16 | \Phi(y) & y \ge 0 17 | \end{cases} 18 | \end{equation} -------------------------------------------------------------------------------- /src/chapters/3/sections/pmfs_and_cdfs/problems/12.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item \url{https://drive.google.com/file/d/1vAAxLU7hvihAHOEcHx8Nc-9xapGlzc-I/view?usp=sharing} 3 | 4 | \item Let $I \subset X$ be the subset of the support where $P_{1}(x) < P_{2} 5 | (x)$. Then $$\sum_{x \in X} P_{1}(x) = \sum_{x \in I}P_{1}(x) + \sum_{x \in 6 | X \setminus I}P_{1}(x) < \sum_{x \in I}P_{2}(x) + \sum_{x \in 7 | X \setminus I}P_{2}(x) = 1.$$ 8 | 9 | Thus, having such a property in PMFs is impossible. 10 | 11 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/4/sections/named_distributions/problems/24.tex: -------------------------------------------------------------------------------- 1 | One way to think about the problem is that the event $X < r$ counts all 2 | sequences of $n$ independent Bernoulli trials, where the number of failures is 3 | larger than $n - r$. If we 4 | extend the number of trials indefinitely, 5 | this implies that more than $n - r$ failures occured before the $r$-th success, 6 | because otherwise, we'd have $X \geq r$. The probability of this event is $P(Y 7 | > n - r)$. 8 | 9 | Implication in the reverse direction can be shown analogously. -------------------------------------------------------------------------------- /src/chapters/2/sections/independence_and_conditional_independence/problems/36.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | 3 | \item Since any applicant who is good at baseball is accepted to the college, 4 | the proportion of admitted students good at baseball is higher than the 5 | proportion of applicants good at baseball, because applicants include people who 6 | aren't good at either math or baseball. 7 | 8 | \item Let $S$ denote the sample space. Then, 9 | 10 | $P(A|B,C) = P(A|B) = P(A) = P(A|S) < P(A|C)$. 11 | 12 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/6/sections/moment_generating_functions/problems/15.tex: -------------------------------------------------------------------------------- 1 | (a). Since the MGF is uniquely determined from the distribution, and X and Y are identically distributed, \[M_{Y^2}(t) = M_{X^2}(t) = (1-2t)^{-\frac{1}{2}}.\] 2 | As X and Y are mutually independent, \[M_{W}(t) = M_{X^2+Y^2}(t) = M_{X^2}(t) \cdot M_{Y^2}(t).\] 3 | Hence, 4 | \[M_{W}(t) = \frac{1}{(1-2t)}.\] 5 | 6 | (b). Exponential distribution, with \(\lambda =\frac{1}{2}\). Note that this is a special case (as mentioned in the question) of the Gamma distribution (Chapter 8). 7 | -------------------------------------------------------------------------------- /src/chapters/2/sections/independence_and_conditional_independence/problems/38.tex: -------------------------------------------------------------------------------- 1 | Let $S$ be the event that an email is spam. Let $L = W_{1}^{c},...,W_{22}^{c}, 2 | W_{23},W_{24}^{c},...,W_{64}^{c},W_{64},W_{65},W_{66}^{c},...,W_{100}^{c}$ 3 | 4 | 5 | Let $q = \prod_{j}(1-p_{j})$ where $1 \leq j \leq 100: j \notin 23, 64, 6 | 65$. 7 | 8 | Let $x = \prod_{j}(1-r_{j})$ where $1 \leq j \leq 100: j \notin 23, 64, 65$. 9 | 10 | $$P(S|L) = \frac{P(S)P(L|S)}{P(L)} = \frac{pp_{23}p_{64}p_{65}q}{pp_{23}p_{64}p_ 11 | {65}q + (1-p)r_{23}r_{64}r_{65}x}.$$ -------------------------------------------------------------------------------- /src/chapters/4/sections/named_distributions/index.tex: -------------------------------------------------------------------------------- 1 | \section{Named Distributions} 2 | 3 | \subsection{problem 20} 4 | \input{problems/20} 5 | 6 | \subsection{problem 24} 7 | \input{problems/24} 8 | 9 | \subsection{problem 26} 10 | \input{problems/26} 11 | 12 | \subsection{problem 28} 13 | \input{problems/28} 14 | 15 | \subsection{problem 29} 16 | \input{problems/29} 17 | 18 | \subsection{problem 30} 19 | \input{problems/30} 20 | 21 | \subsection{problem 31} 22 | \input{problems/31} 23 | 24 | \subsection{problem 33} 25 | \input{problems/33} -------------------------------------------------------------------------------- /src/chapters/4/sections/named_distributions/problems/33.tex: -------------------------------------------------------------------------------- 1 | Suppose $w = r = 1$. The white ball is equally likely to be any of the $w+b$ 2 | balls. Also, note that the event {\it $k$-th drawn ball is the white ball } is 3 | equivalent to the event {\it $k-1$ black balls are drawn until the white ball is 4 | drawn}. Thus, for $X \sim \text{NHGeom}(1, n-1, 1)$, $P(X = k) = P(k+1\text{-th 5 | drawn ball is white}) = \frac{1}{n}$ for $0 \leq k \leq n-1$. 6 | 7 | $P(X = k) = \frac{\binom{1+k-1}{1-1}\binom{1+n-1-1-k}{1-1}}{ 8 | \binom{1+n-1}{1}} = \frac{1}{n}$ -------------------------------------------------------------------------------- /src/chapters/1/sections/counting/problems/11.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item Each of the $n$ inputs has $m$ choices for an output, resulting in 3 | $$m^{n}$$ possible functions. 4 | 5 | \item If $n \geq m$, at least two inputs will be mapped to the same output, 6 | so no one-to-one function is possible. 7 | 8 | If $n < m$, the first input has $m$ choices, the second input has $m - 1$ 9 | choices, and so on. The total number of one-to-one functions then is 10 | $$m(m-1)(m-2)\dots(m-n+1) = \frac{m!}{(m-n)!} $$ 11 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/2/sections/mixed_problems/problems/63.tex: -------------------------------------------------------------------------------- 1 | This problem is similar to the variations on example 2.2.5 (Two Children) in the 2 | textbook. 3 | 4 | It is true that conditioned on specific two of the three coins matching, the 5 | probability of the third coin matching is $\frac{1}{2},$ but the way the problem 6 | statement is phrased, \textit{at least two} of the coins match. According to the 7 | Two Children problem, the result is no longer $\frac{1}{2}.$ In fact, 8 | the probability of all the coins matching given at least two match is $\frac{1} 9 | {4}.$ -------------------------------------------------------------------------------- /src/chapters/4/sections/indicator_r.v.s/problems/46.tex: -------------------------------------------------------------------------------- 1 | Let $X \sim \text{NHGeom}(4,48,1)$ be the number of non-aces before the 2 | first ace. Then, $\text{E}(X) = \frac{rb}{w+1} = \frac{1*48}{5} = 9.6$. 3 | 4 | Let $Y \sim \text{NHGeom}(4, 48, 2)$ be the number of non-aces before the second 5 | ace is drawn. Then, $\text{E}(X) = \frac{rb}{w+1} = \frac{2*48}{5} = 19.2$ 6 | 7 | Let $Z = Y - X$. Notice that $Z$ represents the number of non-aces between the 8 | first and the second ace. $\text{E}(Z) = \text{E}(Y) - \text{E}(X) = 19.2 - 9.6 = 9 | 9.6$. 10 | -------------------------------------------------------------------------------- /src/chapters/2/sections/conditioning_on_evidence/problems/29.tex: -------------------------------------------------------------------------------- 1 | Let $G_{i}$ be the event that the $i$-th child is a girl. Let $C_{i}$ be the 2 | event that the $i$-th child has property $C$. 3 | 4 | $P(G_{1} \cap G_{2}|(G_{1} \cap C_{1} )\cup (G_{2} \cap C_{2})) = \frac{0.25 5 | (2p - p^{2})}{0.5p+ 0.5p - 0.25p^{2}} = \frac{0.5(2-p)}{2-0.5p} = 6 | \frac{2-p}{4-p}.$ 7 | 8 | This result confirms the idea that the more rare characteristic $C$ is, the 9 | closer we get to specifying which child we mean when we say that at least one of 10 | the children has $C$. -------------------------------------------------------------------------------- /src/chapters/5/sections/pdfs_and_cdfs/problems/3.tex: -------------------------------------------------------------------------------- 1 | (a) The new PDF is, 2 | \[g(x) = 2 F(x) f(x)\] 3 | \(g(x) \ge 0\) in the same range as f 4 | \begin{flalign} 5 | \ri g(x) dx & = \ri 2 F(x) f(x) dx \\ 6 | & = \ri d(F^2(x)) \\ 7 | & = \lim_{x \rightarrow \infty} F^2(x) - \lim_{x \rightarrow -\infty} F^2(x) \\ 8 | & = 1 - 0 9 | \end{flalign} 10 | 11 | (b) The new PDF is, 12 | \[g(X) = \frac{1}{2} (f(x) + f(-x))\] 13 | \begin{flalign} 14 | \ri g(x) dx & = \frac{1}{2} \ri f(x) dx + \frac{1}{2} \ri f(x) dx \\ 15 | & = 1 16 | \end{flalign} -------------------------------------------------------------------------------- /src/chapters/1/sections/counting/problems/3.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item Fred has $10$ choices for Monday, $9$ choices for Tuesday, $8$ choices 3 | for Wednesday, $7$ choices for Thursday and $6$ choices for Friday. 4 | 5 | $$ 10 \times 9 \times 8 \times 7 \times6 $$ 6 | 7 | \item For the first restaurant, Fred has $10$ choices. For all subsequent days, 8 | Fred has $9$ choices, since the only restriction is that he doesn't want to eat 9 | at the restaurant he ate at the previous day. 10 | 11 | $$ 10 \times 9^{4} $$ 12 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/2/sections/conditioning_on_evidence/problems/4.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | 3 | \item 4 | \begin{flalign} 5 | P(K|R) & = \frac{P(K)P(R|K)}{P(R)} \nonumber \\ 6 | & = \frac{P(K)P(R|K)}{P(K)P(R|K) + P(K^{c})P(R|K^{c})} \nonumber \\ 7 | & = \frac{p}{p + (1-p)\frac{1}{n}} \nonumber 8 | \end{flalign} 9 | 10 | \item Since $p + (1-p)\frac{1}{n} \leq 1$, $P(K|R) \geq p$ with strict 11 | equality only when $p = 1$. This result makes sense, since if Fred gets 12 | the answer right, it is more likely that he knew the answer. 13 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/1/sections/naive_definition_of_probability/problems/39.tex: -------------------------------------------------------------------------------- 1 | There are a total of $\binom{2N}{K}$ possible committees of $K$ people. 2 | There are $\binom{N}{j}$ ways to select $j$ couples for the committee. 3 | $K-2j$ people need to be selected from the remaining $N-j$ couples such 4 | that only one person is selected from a couple. First, we select $K-2j$ 5 | couples from the remaining $N-j$ couples. Then, for each of the selected 6 | couples, there are $2$ choices for committee membership. 7 | 8 | $$\frac{\binom{N}{j}\binom{N-j}{K-2j}2^{K-2j}}{\binom{2N}{K}}$$ -------------------------------------------------------------------------------- /src/chapters/2/sections/conditioning_on_evidence/problems/5.tex: -------------------------------------------------------------------------------- 1 | By symmetry, all 50 of the remaining cards are equally likely. Thus, the 2 | probability that the third card is an ace is $\frac{3}{50}$. 3 | 4 | We can reach the same answer using the definition of conditional probability. 5 | Let $A$ be the event that the first card is the Ace of Spades, $B$ be the event 6 | that the second card is the $8$ of Clubs and $C$ be the event that the third 7 | card is an ace. Then, 8 | $$P(C|A,B) = \frac{P(C,A,B)}{P(A,B)} = \frac{\frac{3*49!}{52!}}{\frac{50!}{52!}} 9 | = \frac{3}{50}$$ -------------------------------------------------------------------------------- /src/chapters/4/sections/indicator_r.v.s/problems/43.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item This problem is a special case of problem 42 with $t=k$ and $n-1$ floors. 3 | Thus, the expected number of stops is $(n-1) - (n-1)(\frac{n-2}{n-1})^{k}$. 4 | 5 | \item Let $I_{j}$ be the indicator variable for the $j$-th floor being selected 6 | for $2 \leq j \leq n$. Then, the number of stops is $X = \sum_{j=2}^{n}I_{j}$. 7 | Thus, $$\text{E}(X) = \text{E}(\sum_{j=2}^{n}I_{j}) = \sum_{j=2}^{n}\text{E}(I_ 8 | {j}) = \sum_{j=2}^{n}(1-(1 - p_{j})^{k})$$ 9 | \end{enumerate} 10 | -------------------------------------------------------------------------------- /src/chapters/3/sections/independence_of_rvs/problems/43.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item Let $X \equiv a$ (mod $b$) and $Y \equiv X + 1$ (mod $b$). Then, $\lim_{b 3 | \to \infty} P(X < Y) = 1$. 4 | 5 | For finite random variables $X$ and $Y$, the case of $P(X < Y) \geq 1$ is not 6 | possible, since then $Y$ can never achieve the smallest value of $X$, 7 | contradicting the assumption that $X$ and $Y$ have the same distribution. 8 | 9 | \item If $X$ and $Y$ are independent random variables with the same 10 | distribution, then $P(X < Y) \leq \frac{1}{2}$ 11 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/2/sections/mixed_problems/problems/71.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item To have $j$ toy types after sampling $i$ toys, we either have $j-1$ toy types after sampling $i-1$ toys, and the $i$-th toy is of a previously unseen type, or, we have $j$ toy types after sampling $i-1$ toys, and the $i$-th toy has an already seen type. 3 | 4 | Thus, $$p_{i,j} = p_{i-1,j-1} \frac{n-j+1}{n} + p_{i-1,j} \frac{j}{n}$$ 5 | 6 | \item Note that $p_{1,0} = 0, p_{1, 1} = 1$ and $p_{i, j} = 0$ for $j > i$. Using strong induction, a proof of the recursion in part $a$ follows. 7 | \end{enumerate} 8 | -------------------------------------------------------------------------------- /src/chapters/4/sections/mixed_practice/index.tex: -------------------------------------------------------------------------------- 1 | \section{Mixed practice} 2 | 3 | \subsection{problem 79} 4 | \input{problems/79} 5 | 6 | \subsection{problem 80} 7 | \input{problems/80} 8 | 9 | \subsection{problem 86} 10 | \input{problems/86} 11 | 12 | \subsection{problem 87} 13 | \input{problems/87} 14 | 15 | \subsection{problem 88} 16 | \input{problems/88} 17 | 18 | \subsection{problem 89} 19 | \input{problems/89} 20 | 21 | \subsection{problem 90} 22 | \input{problems/90} 23 | 24 | \subsection{problem 91} 25 | \input{problems/91} 26 | 27 | \subsection{problem 92} 28 | \input{problems/92} -------------------------------------------------------------------------------- /src/chapters/5/sections/mixed_practice/index.tex: -------------------------------------------------------------------------------- 1 | \section{Mixed Practice} 2 | 3 | \subsection{problem 50} 4 | \input{problems/50} 5 | 6 | \subsection{problem 51} 7 | \input{problems/51} 8 | 9 | \subsection{problem 52} 10 | \input{problems/52} 11 | 12 | \subsection{problem 56} 13 | \input{problems/56} 14 | 15 | \subsection{problem 57} 16 | \input{problems/57} 17 | 18 | \subsection{problem 58} 19 | \input{problems/58} 20 | 21 | \subsection{problem 59} 22 | \input{problems/59} 23 | 24 | \subsection{problem 61} 25 | \input{problems/61} 26 | 27 | \subsection{problem 62} 28 | \input{problems/62} -------------------------------------------------------------------------------- /src/chapters/5/sections/mixed_practice/problems/57.tex: -------------------------------------------------------------------------------- 1 | (a) 2 | \begin{flalign} 3 | \Phi(W)(t) & = P(\Phi(z)^2 \leq t) \\ 4 | & = P(\Phi(z) \leq \sqrt{t}) \\ 5 | & = P(z \leq \Phi^{-1}(\sqrt{t})) \\ 6 | & = \Phi(\Phi^{-1}(\sqrt{t})) \\ 7 | & = \sqrt{t} 8 | \end{flalign} 9 | 10 | (b) 11 | \(\mathbb{E}[W] = \int_{0}^{1} w^3 f_W(w) dw\) 12 | \(\mathbb{E}[W] = \int_{0}^{1} \Phi(z)^6 \phi(z) dz\) 13 | 14 | 15 | (c) 16 | \(P(X + 2Y < 2Z + 3) = P(X + 2Y - 2Z < 3)\) 17 | here, \(X + 2Y - 2Z \sim N(0, \sqrt{1^2 + 2^2 + 2^2}) \) 18 | So, \(P(X + 2Y < 2Z + 3) = \Phi(1)\) 19 | 20 | -------------------------------------------------------------------------------- /src/chapters/6/sections/means_medians_modes_moments/problems/2.tex: -------------------------------------------------------------------------------- 1 | Let k be the median, therefore $P(X \ge k) \ge \frac{1}{2}$ and $P(X \le k) \ge \frac{1}{2}$, therefore $P(X \le k) \le \frac{1}{2}$. \\ 2 | Hence, 3 | \begin{align*} 4 | P(X \le k) &= \frac{1}{2} \\ 5 | F(k) &= \frac{1}{2} \\ 6 | k &= \frac{\ln(2)}{\lambda} 7 | \end{align*} 8 | where F is the CDF of X. \\ 9 | 10 | Let c be the mode, $f$ be the PDF of X, since $f(x)$ is decreasing for all $x \ge 0$ ($f'(x) = -\lambda^{2}e^{-\lambda x}$) or is 0 otherwise, $f(x)$ has its maxima when $x=0$, hence, the mode is 0. 11 | -------------------------------------------------------------------------------- /src/chapters/6/index.tex: -------------------------------------------------------------------------------- 1 | %--------------------- 2 | \chapter{Moments} 3 | \label{ch:cp} 4 | \ifdefined\HCode 5 | \else 6 | { 7 | \startcontents[chapter] 8 | \printcontents[chapter]{}{1}{\setcounter{tocdepth}{1}} 9 | } 10 | \fi 11 | 12 | \subimport*{sections/means_medians_modes_moments/}{index} 13 | \subimport*{sections/moment_generating_functions/}{index} 14 | 15 | %--------------------- 16 | 17 | \ifdefined\HCode 18 | \PauseCutAt{section} 19 | \fi 20 | 21 | \ifdefined\HCode 22 | \else 23 | { 24 | \stopcontents[chapter] 25 | } 26 | \fi 27 | 28 | \ifdefined\HCode 29 | \ContCutAt{section} 30 | \fi 31 | -------------------------------------------------------------------------------- /src/chapters/4/sections/mixed_practice/problems/89.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item Since $\text{E}(N_{C}) = 115p_{C}$, $\text{Var}(N_{C}) = \sum_{k=0}^ 3 | {115}k^{2}p_{C}^{k} - (115p_{C})^{2}$. 4 | 5 | \item Let $I_{j}$ be the indicator random variable that CATCAT starts at 6 | position $j$. Then, the expected number of CATCAT is $\text{E}(X) = 110(p_{C}p_ 7 | {A}p_{T})^{2}$. 8 | 9 | \item In a sequence of length $6$, the desired options are CATxxx, xxxCAT. Thus, 10 | $P(\text{at least one CAT}) = 2(p_{C}p_{A}p_{T}(1 - p_{C}p_{A}p_{T})) + (p_{C}p_ 11 | {A}p_{T})^{2}$. 12 | 13 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/1/sections/counting/problems/2.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item If the first digit can't be $0$ or $1$, we have eight choices for the 3 | first digit. The remaining six digits can be anything from $0$ to $9$. Hence, 4 | the solution is 5 | $$ 8 \times 10^{6}$$ 6 | 7 | \item We can subtract the number of phone numbers that start with $911$ from 8 | the total number of phone numbers we found in the previous part. 9 | 10 | If a phone number starts with $911$, it has ten choices for each of the 11 | remaining four digits. 12 | 13 | $$ 8 \times 10^{6} - 10^{4} $$ 14 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/3/sections/named_distributions/problems/36.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item $$P(X = \frac{n}{2}) = \binom{n}{\frac{n}{2}}(\frac{1}{2})^{n}$$ 3 | 4 | \item Using Sterling's formula 5 | 6 | $$\binom{n}{\frac{n}{2}} = \frac{\sqrt{2\pi n}(\frac{n}{e})^ 7 | {n}}{\sqrt{2\pi \frac{n}{2}}(\frac{\frac{n}{2}}{e})^ 8 | {\frac{n}{2}}\sqrt{2\pi \frac{n}{2}}(\frac{\frac{n}{2}}{e})^ 9 | {\frac{n}{2}}} = \frac{\sqrt{2}2^{n}}{\sqrt{\pi n}}$$ 10 | 11 | Thus, 12 | 13 | $$P(X = \frac{n}{2}) = \sqrt{\frac{2}{\pi n}}2^{n} \frac{1}{2^{n}} = \frac{1} 14 | {\sqrt{\frac{\pi n}{2}}}$$ 15 | 16 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/3/sections/pmfs_and_cdfs/problems/5.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | 3 | \item $p(n)$ is clearly non-negative. Also, 4 | 5 | $$\sum_{n=0}^{\infty}p(n) = \frac{1}{2}\sum_{n=0}^{\infty}\frac{1}{2^{n}} = 6 | \frac{1}{2} * \frac{1}{1 - \frac{1}{2}} = 1.$$ 7 | 8 | Thus, $p(n)$ is a valid PMF. 9 | 10 | \item $$F(x) = \sum_{n=0}^{\lfloor x \rfloor}p(n) = \frac{1}{2}\sum_{n=0}^ 11 | {\lfloor x \rfloor}\frac{1}{2^{n}} = \frac{1}{2} * \frac{1 - \frac{1}{2^{\lfloor 12 | x \rfloor + 1}}}{1 - \frac{1}{2}} = 1 - \frac{1}{2^{\lfloor x \rfloor + 1}}$$ 13 | 14 | for $x \geq 0$ and $0$ for $x < 0$. 15 | 16 | 17 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/5/sections/pdfs_and_cdfs/problems/7.tex: -------------------------------------------------------------------------------- 1 | a. F(x) is continuous at its given endpoints: \(F(1) = \frac{2}{\pi}arcsin(1) = \frac{2}{\pi}\frac{\pi}{2} = 1\) and \(F(0) = 0\), and F(x) is differentiable between 0 and 1:\\ 2 | 3 | b. \(F'(x) = f(x) = \frac{2}{\pi}\frac{d}{dx}(arcsin(\sqrt{x})) = \frac{2}{\pi}(\frac{1}{\sqrt{1-x}})(\frac{1}{\sqrt{x}})\)\\ 4 | 5 | This is a valid PDF despite the discontinuities at 0 and 1 as the integral of \(f(x)\) from 0 to 1 converges, and \(f(x)\) is always positive - the same reason why \(\frac{1}{\sqrt{x}}\) has a discontinuity at \(x=0\) but can be integrated from 0 to any positive real number. 6 | -------------------------------------------------------------------------------- /src/chapters/4/sections/expectations_and_variances/problems/6.tex: -------------------------------------------------------------------------------- 1 | Let $N$ be the number of games played. Then the probability than $N=i$ is the 2 | probability of exactly $3$ wins in the first $i-1$ games, and the last game 3 | being a win. $P(N=i) = 2\binom{i-1}{3}(\frac{1}{2})^{3}(\frac{1}{2})^{i-1-3} 4 | \frac{1}{2} = 2\binom{i-1}{3}(\frac{1}{2})^{i}.$ Note that the factor of $2$ in 5 | $P(N=i)$ is to account for either of the two players winning after $i$ games. 6 | 7 | Then, $$\text{E}(N) = 2\sum_{i=4}^{7} i\binom{i-1}{3}(\frac{1}{2})^{i} 8 | \approx 9 | 5.81$$ 10 | 11 | $$\text{Var}(N) = \text{E}(N^{2}) - (\text{E}(N))^{2} \approx 1.06$$ -------------------------------------------------------------------------------- /src/chapters/1/sections/mixed_practice/problems/59.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item $\binom{15+9}{9}$ 3 | 4 | \item $\binom{5+9}{9}$ 5 | 6 | \item 7 | Each of 15 bars can be given to any of 10 children, so by orderd sampling with replcement 8 | formula we have $10^{15}$ combinations 9 | 10 | \item 11 | To count amount of suitable combinations, we can subtract amount of combination, where at 12 | least one child doesn't get any bars (is example of inclusion-exclusion usage case) from 13 | total amount of combinations.\\ 14 | $10^{15} - \sum_{i=1}^{9}\left(-1\right)^{i+1}\binom{10}{i}\left(10-i\right)^{15}$ 15 | \end{enumerate} 16 | -------------------------------------------------------------------------------- /src/chapters/2/sections/independence_and_conditional_independence/problems/34.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | 3 | \item $A$ and $B$ are not independent, since knowing that $A$ occured makes $G^ 4 | {c}$ more likely, which in turn makes $B$ makes more likely. 5 | 6 | \item $P(G|A^{c}) = \frac{P(G)P(A^{c}|G)}{P(G)P(A^{c}|G) + P(G^{c})P(A^{c}|G^ 7 | {c})} = \frac{g(1-p_{1})}{g(1-p_{1}) + (1-g)(1-p_{2})}$ 8 | 9 | \item $P(B|A^{c}) = P(G|A^{c})P(B|G, A^{c}) + P(G^{c}|A^{c})P(B|G^{c}, A^{c}) = 10 | \frac{g(1-p_{1})}{g(1-p_{1}) + (1-g)(1-p_{2})}p_{1} + 11 | (1 - \frac{g(1-p_{1})}{g(1-p_{1}) + (1-g)(1-p_{2})})p_{2}$ 12 | 13 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/4/sections/named_distributions/problems/20.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item This is not possible, since $Y$ has a non-zero probability of being a 3 | number larger than $100$, where as $X$ is capped at $100$. 4 | 5 | \item Let $X$ be the number of contestants who enter a tournament, and let $Y$ 6 | be the number of contestants who pass the first round. Clearly, $P(X \geq Y) = 7 | 1$. 8 | 9 | \item This is not possible, because if $X$ always produces values smaller or 10 | equal to the values produced by $Y$, then $\text{E}(X) \leq \text{E}(Y)$. 11 | However, $\text{E}(X) = 90$, and $\text{E}(Y) = 50$. 12 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/1/sections/naive_definition_of_probability/problems/40.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item Counting strictly increasing sequences of $k$ numbers amounts to counting 3 | the number of ways to select $k$ elements out of the $n$, since for any such 4 | selection, there is exactly one increasing ordering. Thus, the answer is 5 | $$\frac{\binom{n}{k}}{n^k}$$ 6 | 7 | \item The problem can be thought of sampling with replacement where order 8 | doesn't matter, since there is only one non decreasing ordering of a given 9 | sequence of $k$ numbers. Thus, the answer is 10 | $$\frac{\binom{n-1+k}{k}}{n^k}$$ 11 | 12 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/3/sections/named_distributions/problems/34.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item Let $Y$ be the number of Statistics students in the sample of size $m$. 3 | 4 | $$P(Y=k) = \sum_{i=k}^{n}P(X=i)P(Y=k|X=i) = \sum_{i=k}^{n}\binom{n}{i}p^{i} 5 | (1-p)^{n-i}\frac{\binom{i}{k}\binom{n-i}{m-k}}{\binom{n}{m}}$$ 6 | 7 | \item Consider a student in a random sample of size $m$. Independently of 8 | other students, the student has 9 | probability $p$ of being a statistics major. Then, the probability of $k$ 10 | students in the sample being statistics majors is $\binom{m}{k}p^{k}(1-p)^ 11 | {m-k}$. Thus, $Y \sim Binom(m,p)$. 12 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/4/sections/named_distributions/problems/26.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item Let $Z$ represent the number of flips until both Nick and Penny flip 3 | Heads. Then is $Z \sim \text{FS}(p_{1}p_{2})$, since Nick's and 4 | Penny's flips are independent. $\text{E}(Z) = \frac{1}{p_{1}p_{2}}$ 5 | 6 | \item The logic is analogous to part $a$, but success probability is $p_{1} + p_ 7 | {2} - p_{1}p_{2}$. 8 | 9 | \item $$P(X_{1} = X_{2}) = \sum_{k=1}^{\infty}(((1-p)^{2})^{k-1}p^{2}) = 10 | \frac{p}{2-p}$$ 11 | 12 | \item By symmetry, $$P(X_{1} < X_{2}) = \frac{1-(\frac{p}{2-p})}{2} = \frac{1-p} 13 | {2-p}$$ 14 | \end{enumerate} 15 | -------------------------------------------------------------------------------- /src/chapters/3/sections/pmfs_and_cdfs/problems/10.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item Let $P(n) = \frac{k}{n}$ for $n \in \mathbb{N}$. By principles of 3 | probability, $\sum_{n \in \mathbb{N}}P(n)$ must equal $1$. 4 | 5 | $$\sum_{n \in \mathbb{N}}P(n) = k\sum_{n \in \mathbb{N}}\frac{1}{n}.$$ The sum 6 | on the right side of the equality is a divergent, harmonic series. Hence. the 7 | aforementioned principle of probably is violated. Contradiction. 8 | 9 | \item $\sum_{n \in \mathbb{N}}\frac{1}{n^{2}} = \frac{\pi^{2}}{6}$. Thus, 10 | letting $k$ equal $\frac{6}{\pi^{2}}$, the principle of probability is 11 | satisfied. 12 | 13 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/3/sections/named_distributions/problems/20.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item $P(X=k) = \binom{n}{k}p^{k}(1-p)^{n-k}$ for $0 \leq k \leq 3$. 3 | 4 | \item To use the complement of the desired deven, $$P(X > 0) = 1 - P(X = 0) = 1 - 5 | (1- p)^{3} = 1 - (-p^{3} + 3p^{2} - 3p + 1) = p^{3} - 3p^{2} + 3p.$$ 6 | 7 | To prove the same by Inclusion-Exclusion, 8 | 9 | $$P(X > 0) = \sum_{i=1}^{3} P(I_{X_{i}}=1) - 3p^{2} + P(\cap_{i=1}^{3}I_{X_ 10 | {i}} = 11 | 1) = 3p -3p^{2} + p^{3}.$$ 12 | 13 | \item Since $p^{2}$ and $p^{3}$ go to $0$ asymptotically faster than $p$, when 14 | $p$ is small, $3p - 3p^{2} + p^{3} \approx 3p$. 15 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/3/sections/pmfs_and_cdfs/problems/7.tex: -------------------------------------------------------------------------------- 1 | To find the probability mass function (PMF) of $X$, we need to determine the probabilities of Bob reaching each level from 1 to 7. 2 | 3 | Level 1 is the highest level reached by Bob if he fails to pass level 1, which happens with probability $1-p_1$. 4 | Thus, $P(X=1) = 1 - p_1$. 5 | 6 | For $2 \leq j \leq 6$, $P(X = j)$ is the probability of reaching level $j$ but not reaching level $j+1$. 7 | This can be calculated as 8 | 9 | $P(X = j) = p_1 \cdots p_{j-1} (1 - p_j)$. 10 | 11 | Bob reaches level 7 if he passes each level from 1 to 6: 12 | 13 | $P(X = 7) = p_1 \, p_2 \, p_3 \, p_4 \, p_5 \, p_6$. 14 | -------------------------------------------------------------------------------- /src/chapters/1/sections/naive_definition_of_probability/problems/30.tex: -------------------------------------------------------------------------------- 1 | Suppose the word consists of $7$ letters. Once we choose the first letter, 2 | the seventh one has to be the same. Once we choose the second letter, the 3 | sixth one has to be the same. In general, we are free to choose $4$ letters. 4 | Hence, the probability that a $7$ letter word is a palindrome is 5 | $$\frac{26^{4}}{26^{7}} = \frac{1}{26^{3}}$$ 6 | 7 | If the word consists of $8$ letters, then there are $26^{8}$ possible words, 8 | but for a palindrome, the number of letters we are free to choose is still $4$. 9 | Hence, the probability is $$\frac{26^{4}}{26^{8}} = \frac{1}{26^{4}}$$ 10 | -------------------------------------------------------------------------------- /src/chapters/2/sections/conditioning_on_evidence/problems/16.tex: -------------------------------------------------------------------------------- 1 | $P(A) = P(B)P(A|B) + P(B^{c})P(A|B^{c})$. 2 | 3 | Given $P(A|B) \leq P(A)$, if $P(A|B^{c}) < P(A)$, then the right hand side of 4 | the equation above is strictly less than the left hand side, and we have a 5 | contradiction. 6 | 7 | We can intuitively think of this problem as asking "How likely is X to be 8 | elected as president?" and hearing "It depends" in response. The implication 9 | is that there exists some latent event (major states vote against X) that 10 | reduces the chances of X getting elected, and if we know that the former does 11 | not occure, the chances of X getting elected improve. -------------------------------------------------------------------------------- /src/chapters/2/sections/conditioning_on_evidence/problems/27.tex: -------------------------------------------------------------------------------- 1 | Let $G$ be the event that the suspect is guilty. Let $T$ be the event that 2 | one of the criminals has blood type $1$ and the other has blood type $2$. 3 | 4 | Thus, 5 | $$P(G|T) = \frac{P(G)P(T|G)}{P(G)P(T|G) + P(G^{c})P(T|G^{c})} = 6 | \frac{pp_{2}}{pp_{2} + (1-p)2p_{1}p_{2}} = \frac{p}{p + 2p_{1}(1 - p)}$$ 7 | 8 | For $P(G|T)$ to be larger than $p$, $p_{1}$ has to be smaller than $\frac{1} 9 | {2}$. This result makes sense, since if $p_{1} = \frac{1}{2}$, then half of the 10 | population has blood type $1$, and finding it at the crime scene gives us no 11 | information as to whether the suspect is guilty. -------------------------------------------------------------------------------- /src/chapters/3/sections/pmfs_and_cdfs/problems/2.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | 3 | \item Since the trials are independent, the probability that the first $k-1$ 4 | trials fail is $(\frac{1}{2})^{k-1}$, and the probability that the 5 | $k$-th trial is successful is $\frac{1}{2}$. Thus, for $k \geq 1$, 6 | 7 | $$P(X=k) = (\frac{1}{2})^{k-1}*\frac{1}{2}.$$ 8 | 9 | \item This problem reduces to part $a$ once a trial is performed. Whatever it's 10 | outcome, we label it failure and proceed to perform more trials until the 11 | opposite outcome is observed. Thus, for $k \geq 2$, 12 | 13 | $$P(X=k) = (\frac{1}{2})^{k-2} * \frac{1}{2}.$$ 14 | 15 | 16 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/2/sections/mixed_problems/problems/68.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item $$OR = \frac{P(D|C)}{P(D^{c}|C)} * \frac{P(D^{c}|C^{c})}{P 3 | (D|C^{c})}$$ 4 | 5 | Since the disease is rare among both exposed and not exposed groups, $P(D^{c}|C) 6 | \approx 1$ and $P(D^{c}|C^{c}) \approx 1$. Thus, 7 | 8 | $$OR \approx \frac{P(D|C)}{P(D|C^{c})} = RR$$ 9 | 10 | \item 11 | $$\frac{P(C,D)P(C^{c}, D^{c})}{P(C, D^{c}){P(C^{c}, D)}} = \frac{P(C)P(D|C)P 12 | (C^{c})P(D|C^{c})}{P(C)P(D^{c}|C)P(C^{c})P(D|C^{c})} = OR$$ 13 | 14 | \item Since $P(C, D)$ also equals $P(D)P(C|D)$, reversing the roles of $C$ and 15 | $D$ in part $b$ gives the result. 16 | 17 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/2/sections/mixed_problems/problems/72.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item 3 | $$p_{n} = a_{n}a + (1-a_{n})b = (a - b)a_{n} + b$$ 4 | 5 | $$a_{n+1} = a_{n}a + (1-a_{n})(1-b) = a_{n}(a + b - 1) + 1 - b$$ 6 | 7 | \item $$p_{n+1} = (a-b)a_{n+1} + b$$ 8 | $$p_{n+1} = (a-b)((a + b - 1)a_{n} + 1 - b) + b$$ 9 | $$p_{n+1} = (a-b)\left((a + b - 1)\frac{p_{n} - b}{a - b} + 1 - b\right) + b$$ 10 | $$p_{n+1} = (a + b - 1)p_{n} + a + b - 2ab$$ 11 | 12 | \item Let $p = \lim_{n \to \infty} p_{n}$. Taking the limit of both sides of the result of part $b$, we get 13 | $$p = (a + b - 1)p + a + b - 2ab$$ 14 | $$p = \frac{a + b - 2ab}{2 - (a + b)}$$ 15 | \end{enumerate} 16 | 17 | -------------------------------------------------------------------------------- /src/chapters/5/sections/pdfs_and_cdfs/problems/5.tex: -------------------------------------------------------------------------------- 1 | a. We have \(A = \pi R^{2}\), so \(E(A) = \pi E(R^{2})\). We have \(E(R^{2}) = \int_{0}^{1} x^{2}*1\,dx = 1/3\), since the PDF of R is always 1. Then \(E(A) = \pi/3\). \\ 2 | 3 | We have \(Var(A) = E(A^{2}) - E(A)^{2} = \pi^{2}E(R^{4}) - \pi^{2}/9\) using linearity. \(E(R^{4}) = \int_{0}^{1} x^{4}*1\,dx = 1/5\), so \(Var(A) = \pi^{2}/5 - \pi^{2}/9 = 4\pi^{2}/45\)\\ 4 | 5 | b. CDF: \(P(A\pi\). \\ 6 | 7 | PDF: \(\frac{d}{dk}(\sqrt{k/\pi}) = \frac{1}{2\sqrt{k\pi}}\) for \(0 P(A|B^{c}, C)$ and $P(A|B, C^{c}) > P(A|B^{c}, C^{c})$, $P 20 | (A|B) > P(A|B^{c})$, so Simpson's Paradox does not hold. 21 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/1/sections/naive_definition_of_probability/index.tex: -------------------------------------------------------------------------------- 1 | \section{Naive Definition Of Probability} 2 | 3 | \subsection{problem 23} 4 | \input{problems/23} 5 | 6 | \subsection{problem 26} 7 | \input{problems/26} 8 | 9 | \subsection{problem 27} 10 | \input{problems/27} 11 | 12 | \subsection{problem 30} 13 | \input{problems/30} 14 | 15 | \subsection{problem 32} 16 | \input{problems/32} 17 | 18 | \subsection{problem 35} 19 | \input{problems/35} 20 | 21 | \subsection{problem 36} 22 | \input{problems/36} 23 | 24 | \subsection{problem 37} 25 | \input{problems/37} 26 | 27 | \subsection{problem 38} 28 | \input{problems/38} 29 | 30 | \subsection{problem 39} 31 | \input{problems/39} 32 | 33 | \subsection{problem 40} 34 | \input{problems/40} 35 | 36 | \subsection{problem 41} 37 | \input{problems/41} -------------------------------------------------------------------------------- /src/chapters/4/sections/expectations_and_variances/problems/9.tex: -------------------------------------------------------------------------------- 1 | Let $X$ be the amount of money Fred walks away with. 2 | 3 | \begin{enumerate}[label=(\alph*)] 4 | 5 | \item $\text{E}(X) = 16000$. There is no variance under this scenario, since 6 | Fred's take home amout is fixed. 7 | 8 | \item $\text{E}(X) = \frac{1}{2}1000 + \frac{1}{2}\frac{3}{4}32000 + \frac{1}{2} 9 | \frac{1}{4}64000 = 20500. \text{Var}{X} = \text{E}(X^{2}) - (\text{E}(X))^{2} 10 | \approx 4.76 * 10^{8}.$ 11 | 12 | \item $\text{E}(X) = \frac{3}{4}1000 + \frac{1}{4}\frac{1}{2}32000 + \frac{1} 13 | {4}\frac{1}{2}64000 = 12750. \text{Var}{X} = \text{E}(X^{2}) - (\text{E}(X))^{2} 14 | \approx 4.78 * 10^{8}.$ 15 | 16 | \end{enumerate} 17 | 18 | Option $b$ has a higher expected win than option $c$, but it also has a higher 19 | variance. -------------------------------------------------------------------------------- /src/chapters/1/index.tex: -------------------------------------------------------------------------------- 1 | %--------------------- 2 | \chapter{Probability and Counting} 3 | \label{ch:pac} 4 | \ifdefined\HCode 5 | \else 6 | { 7 | \startcontents[chapter] 8 | \printcontents[chapter]{}{1}{\setcounter{tocdepth}{1}} 9 | } 10 | \fi 11 | 12 | \subimport*{sections/counting/}{index} 13 | \subimport*{sections/story_proofs/}{index} 14 | \subimport*{sections/naive_definition_of_probability/}{index} 15 | \subimport*{sections/axioms_of_probability/}{index} 16 | \subimport*{sections/inclusion_exclusion/}{index} 17 | \subimport*{sections/mixed_practice/}{index} 18 | %--------------------- 19 | 20 | \ifdefined\HCode 21 | \PauseCutAt{section} 22 | \fi 23 | 24 | \ifdefined\HCode 25 | \else 26 | { 27 | \stopcontents[chapter] 28 | } 29 | \fi 30 | 31 | \ifdefined\HCode 32 | \ContCutAt{section} 33 | \fi 34 | 35 | -------------------------------------------------------------------------------- /src/chapters/1/sections/axioms_of_probability/problems/43.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | 3 | \item Inequality can be demonstrated using the first property of probabilities, 4 | $$P(A \cup B) = P(A) + P(B) - P(A \cap B)$$ and the first axiom of probabilities, 5 | $$P(S) = 1.$$ 6 | 7 | $P(A) + P(B) - P(A \cap B) \leq 1 \implies P(A) + P(B) - 1 \leq P(A \cap B)$. 8 | 9 | Strict equality holds if and only if $A \cup B = S$ where $S$ is the sample space. 10 | 11 | \item Since $A \cap B \subseteq A \cup B$, $P(A \cap B) \leq P(A \cup B)$ by 12 | the second property of probabilites. 13 | 14 | Strict equality holds if and only if $A = B.$ 15 | 16 | \item Inequality follows directly from the first property of probabilities 17 | with strict equality if and only if $P(A \cap B) = 0.$ 18 | 19 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/1/sections/mixed_practice/problems/57.tex: -------------------------------------------------------------------------------- 1 | The desired event can be expressed as $\bigcup\limits_{i=1}^{10^{22}}A_{i}$, 2 | where $A_{i}$ is the event that the $i$-th molecule in my breath is shared 3 | with Caesar. We can compute the desired probability using inclusion exclusion. 4 | 5 | Since every molecule in the universe is equally likely to be shared with Caesar, 6 | and we assume our breath samples molecules with replacement, 7 | $P(\bigcap\limits_{i=1}^{n}A_{i}) = (\frac{1}{10^{22}})^{n}$. 8 | 9 | Thus, 10 | 11 | \begin{flalign} 12 | P(\bigcup\limits_{i=1}^{10^{22}}A_{i}) & = 13 | \sum_{i=1}^{10^{22}}(-1)^{i+1}\left(\frac{1}{10^{22}}\right)^{i} \nonumber && \\ 14 | & = \left(1 - \frac{1}{10^{22}}\right)^{10^{22}} \nonumber && \\ 15 | & \approx e^{-1} \nonumber 16 | \end{flalign} 17 | 18 | -------------------------------------------------------------------------------- /src/chapters/4/sections/named_distributions/problems/28.tex: -------------------------------------------------------------------------------- 1 | Let $I_{k}$ be the indicator variable for the $k$-th location, so that $I_{k}=1$ 2 | if 3 | $k$-th location has a treasure and $I_{k}=0$ otherwise. 4 | 5 | Let $X$ be number of locations William checks to get $t$ treasures, and $X_{j} 6 | \sim \text{HGeom} 7 | (t-1,n-1-(t-1),j)$ be the number of treasures found within $j$ checked 8 | locations. 9 | 10 | By symmetry. $P(I_{k}=1) = \frac{t}{n}$. Then, 11 | 12 | $$P(X = k) = P(I_{k}=1)P(X_{k-1}=t-1) = \frac{t}{n}\frac{\binom{t-1} 13 | {t-1}\binom{n-1-t+1}{k-1-t+1}}{ 14 | \binom{n-1}{k-1}} = \frac{t}{n}\frac{\binom{n-t}{k-t}}{\binom{n-1}{k-1}}$$ 15 | 16 | $$\text{E}(X) = \sum_{k=t}^{n}k P(I_{k}=1)P(X_{k-1}=t-1) = \sum_{k=t}^{n}(k 17 | \frac{t}{n}\frac{\binom{n-t}{k-t}}{\binom{n-1}{k-1}}) = \frac{(n+1)t}{t+1}$$ -------------------------------------------------------------------------------- /src/chapters/1/sections/naive_definition_of_probability/problems/38.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item There are $12$ choices of seats for Tyron and Cersei so that they sit 3 | next to each other ($11$ cases, where they take $i-1$ and $i$ positions and 4 | 1 case, where they take 1 and 12th position, because table is round). 5 | Tyron can sit to the left or to the right of Cersei. 6 | The remaining $10$ people can be ordered in $10!$ ways, so the answer is 7 | $$\frac{24\times10!}{12!} = \frac{2}{11}$$ 8 | 9 | \item There are $\binom{12}{2}$ choices of seats to be assigned to Tyron and 10 | Cersei, but only $12$ choices where they sit next to each other. 11 | Since every assignment of seats is equally likely the answer is 12 | $$\frac{12}{\binom{12}{2}} = \frac{2}{11}$$ 13 | 14 | \end{enumerate} 15 | -------------------------------------------------------------------------------- /src/chapters/2/sections/first-step_analysis_and_gamblers_ruin/problems/52.tex: -------------------------------------------------------------------------------- 1 | The problem is equivalent to betting $1$ increments and having $A$ start with 2 | $ki$ dollars, while $B$ starts with $k(N-i)$ dollars. 3 | 4 | Thus, $p < \frac{1}{2}$, 5 | 6 | $$p_{i} = \frac{1 - \left(\frac{q}{p}\right)^{ki}}{1 - \left(\frac{q}{p}\right)^ 7 | {kN}}.$$ 8 | 9 | Note that, 10 | 11 | $$\lim_{k \to \infty} \frac{1 - \left(\frac{q}{p}\right)^{ki}}{1 - \left( 12 | \frac{q}{p}\right)^{kN}} = \lim_{k \to \infty} \frac{-ki\left(\frac{q}{p}\right) 13 | ^{ki-1}}{-kN\left(\frac{q}{p}\right)^{kN-1}} = \frac{i}{N}\lim_{k \to \infty} 14 | \frac{1}{\left(\frac{q}{p}\right)^{k(N-i)}} = 0.$$ 15 | 16 | This result makes sense, since $p < \frac{1}{2}$ implies that $A$ should lose 17 | a game with high degree of certainty over the long run. 18 | -------------------------------------------------------------------------------- /src/chapters/5/sections/mixed_practice/problems/50.tex: -------------------------------------------------------------------------------- 1 | By symmetry, and by X and Y being independent and identically distributed, the chance that X should be smaller than Y should not be different than the chance that Y should be smaller than X. 2 | Furthermore, from independence, joint pdf, \(g(x, y) = f_X(x) f_Y(y)\) 3 | \begin{flalign} 4 | P (X < Y) & = \int_{y=-\infty}^{\infty} \int_{t = -\infty}^{y} f_X(x) f_Y(y) dt dy \\ 5 | & = \int_{y = -\infty}^{\infty} F(y) f(y) dy \\ 6 | & = \frac{1}{2} 7 | \end{flalign} 8 | When X and Y are not independent say X = Y + 1, (assume the existence of such X and Y), then, \(P(X < Y) = 0\) and \(P(Y < X) = 1\) 9 | When X and Y are not identically distributed, say \(X \sim \text{Unif}(0, 1)\) and \(Y \sim \text{Unif}(-1, 0)\) 10 | then, \(P(X < Y) = 1\) and \(P(Y < X) = 0\) 11 | -------------------------------------------------------------------------------- /.github/workflows/makefile.yml: -------------------------------------------------------------------------------- 1 | name: Makefile CI 2 | 3 | on: 4 | push: 5 | branches: [ "master" ] 6 | pull_request: 7 | branches: [ "master" ] 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - name: Clean Workspace 16 | uses: AutoModality/action-clean@v1.1.0 17 | 18 | - uses: actions/checkout@v3 19 | 20 | - uses: actions/setup-node@v3 21 | with: 22 | node-version: '16.20' 23 | 24 | - name: Build project 25 | run: make 26 | 27 | - name: Publish the web pages 28 | uses: peaceiris/actions-gh-pages@v3 29 | with: 30 | github_token: ${{ secrets.GITHUB_TOKEN }} 31 | publish_dir: ./output/html 32 | enable_jekyll: false 33 | if: github.ref_name == 'master' && github.event_name == 'push' 34 | -------------------------------------------------------------------------------- /src/chapters/2/index.tex: -------------------------------------------------------------------------------- 1 | %--------------------- 2 | \chapter{Conditional Probability} 3 | \label{ch:cp} 4 | \ifdefined\HCode 5 | \else 6 | { 7 | \startcontents[chapter] 8 | \printcontents[chapter]{}{1}{\setcounter{tocdepth}{1}} 9 | } 10 | \fi 11 | 12 | \subimport*{sections/conditioning_on_evidence/}{index} 13 | \subimport*{sections/independence_and_conditional_independence/}{index} 14 | \subimport*{sections/monty_hall/}{index} 15 | \subimport*{sections/first-step_analysis_and_gamblers_ruin/}{index} 16 | \subimport*{sections/simpsons_paradox/}{index} 17 | \subimport*{sections/mixed_problems/}{index} 18 | %--------------------- 19 | 20 | \ifdefined\HCode 21 | \PauseCutAt{section} 22 | \fi 23 | 24 | \ifdefined\HCode 25 | \else 26 | { 27 | \stopcontents[chapter] 28 | } 29 | \fi 30 | 31 | \ifdefined\HCode 32 | \ContCutAt{section} 33 | \fi -------------------------------------------------------------------------------- /src/chapters/4/sections/expectations_and_variances/problems/7.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item Let $R$ be the birthrank of the chosen child. Then, 3 | 4 | $P(R=3) = \frac{20}{100}\frac{1}{3} = \frac{4}{60}$ 5 | 6 | $P(R=2) = \frac{50}{100}\frac{1}{2} + \frac{20}{100}\frac{1}{3} = 7 | \frac{19}{60}$ 8 | 9 | $P(R=1) = \frac{30}{100} + \frac{50}{100}\frac{1}{2} + \frac{20}{100}\frac{1}{3} 10 | = \frac{37}{60}$ 11 | 12 | $\text{E}(R) = 1\frac{37}{60} + 2\frac{19}{60} + 3\frac{4}{60} = \frac{29}{20}$ 13 | 14 | $\text{Var}(R) = \text{E}(R^{2}) - (\text{E(R)})^{2} = \frac{149}{60} - 15 | \frac{841}{400} \approx 0.38$ 16 | 17 | \item 18 | $\text{E}(R) = 1\frac{100}{190} + 2\frac{70}{190} + 3\frac{20}{190} = 19 | \frac{30}{19}$ 20 | 21 | $\text{Var}(R) = \frac{56}{19} - (\frac{30}{19})^{2} \approx 0.45$ 22 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/4/sections/poisson_approximation/problems/71.tex: -------------------------------------------------------------------------------- 1 | Let $I_{j}$ be the indicator random variable for pair $j$ having the 2 | aforementioned property. $P(I_{j}=1) = \frac{1}{365^{2}}$, under the assumption 3 | that the probability of being born on a particular day is $\frac{1}{365}$. Note 4 | that since we don't know anything about the age of the kids, we are assuming 5 | their mothers are also equally likely to be born on any of the $365$ days. 6 | 7 | Then, the expected number of pairs with the aforementioned property is $\text{E} 8 | (X) = \binom{90}{2}\frac{1}{365^{2}} \approx 0.03$. 9 | 10 | Let $Z \sim \text{Poiss}(0.03)$ model the distribution of pairs with the desired 11 | property. Then, probability that there is at least one such pair is $1 - P(Z=0) 12 | = 1 - e^{-0.03} \approx 1 - (1 - 0.03) = 0.03 = \frac{3}{100}$. -------------------------------------------------------------------------------- /src/chapters/4/sections/indicator_r.v.s/problems/50.tex: -------------------------------------------------------------------------------- 1 | Let $C_{1}$ be a random chord that spans a minor arch of length $x$ on a circle 2 | of radius $r$. To generate a chord $C_{2}$, with endponts $A$ and $B$, such that 3 | $C_{2}$ intersects $C_{1}$, either $A$ is on the minor arch and $B$ is on the 4 | major arch, or $A$ is on the major arch and $B$ is on the minor arch. 5 | 6 | Let $I_{x}$ be the indicator variable for $C_{2}$ intersecting $C_{1}$ when the 7 | minor arch generated by $C_{1}$ has length $x$. 8 | Then, $P(I_{x}=1) = 2\frac{x}{2\pi*r} * \frac{2\pi*r - x}{2\pi*r}$. 9 | 10 | Since the length 11 | of the minor arch $x$ generated by $C_{1}$ can span from $0$ to $2\pi*r$, 12 | we integrate $P(I_{x}=1)$. 13 | 14 | $$\frac{1}{2\pi*r} \int_{0}^{2\pi*r} \! 2\frac{x}{2\pi*r} * \frac{2\pi*r - x} 15 | {2\pi*r} \, \mathrm{d}x = \frac{1}{3}.$$ -------------------------------------------------------------------------------- /src/chapters/1/sections/counting/problems/14.tex: -------------------------------------------------------------------------------- 1 | There are $4$ choices for sizes and $8$ choices for toppings, of which any 2 | combination (including no toppings) can be selected. 3 | 4 | The total number of possible choices of toppings is $\sum_{i=0}^{8}\binom{8} 5 | {i} = 2^8 = 256$. Thus, the total number of possible size-topping combinations 6 | is $4 * 256 = 1024$. 7 | 8 | We wish to sample two pizzas, with replacement, out of the $1024$ possibilities. 9 | By Einstein-Bose, there are a total of $\binom{1025}{2}$ choices. 10 | 11 | A common mistake is to use multiplication rule to get $(2^8)*(2^8)$ as 12 | total possible combinations for two pizzas, and try to adjust for overcounting 13 | by dividing the result with 2 (as order between pizzas doesn't matter). This 14 | fails because the possibilities with identical pizzas are counted only once. -------------------------------------------------------------------------------- /src/chapters/4/sections/expectations_and_variances/problems/15.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item Let $X$ be the earnings by player $B$. Suppose $B$ guesses a number $j$ 3 | with probability $b_{j}$. Then, 4 | 5 | $$\text{E}(X) = \sum_{j=1}^{100}jp_{j}b_{j}$$ 6 | 7 | To maximize $\text{E}(X)$ then, $B$ should set $b_{j} = 1$ for the $j$ for which 8 | $jp_{j}$ is maximal. Since $p_{j}$ are known, this quantity is known. 9 | 10 | \item Suppose player $P(A=k) = \frac{c_{A}}{k}$, and $P(B=k) = b_{k}$. Then, 11 | 12 | $$\text{E}(X) = \sum_{k=1}^{100}(k\frac{c_{A}}{k}b_{k}) = c_{A}$$. 13 | 14 | Thus, irrespective of what strategy $B$ adopts, their expected earnings are the 15 | same, so $B$ has no incentive to change strategies. Similar argument can be made 16 | for $A$. 17 | 18 | \item part $b$ answers this part as well. 19 | \end{enumerate} -------------------------------------------------------------------------------- /add-pdf-url.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from bs4 import BeautifulSoup as bs 3 | 4 | INDEX_FILE_PATH = sys.argv[1] 5 | 6 | with open(INDEX_FILE_PATH, "r+") as f: 7 | html = f.read() 8 | soup = bs(html, "html.parser") 9 | 10 | link_tag = soup.new_tag("link", attrs={ 11 | "rel" : "stylesheet", 12 | "href" : "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" 13 | }) 14 | soup.head.append(link_tag) 15 | 16 | p_tag = soup.new_tag("p") 17 | a_tag = soup.new_tag("a", attrs={ 18 | "href" : "index.pdf" 19 | }) 20 | i_tag = soup.new_tag("i", attrs={ 21 | "class" : "fa fa-file-pdf-o", 22 | "style" : "font-size:24px;color:red" 23 | }) 24 | a_tag.append(i_tag) 25 | p_tag.append(a_tag) 26 | h2_tag = soup.find("h2") 27 | h2_tag.insert_after(p_tag) 28 | 29 | f.truncate(0) 30 | f.write(str(soup)) -------------------------------------------------------------------------------- /src/chapters/2/sections/conditioning_on_evidence/problems/12.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | 3 | \item Let $A_{i}$ be the event that Alice sends bit $i$. Let $B_{j}$ be the 4 | event that Bob recieves bit $j$. 5 | 6 | \begin{flalign} 7 | P(A_{1}|B_{1}) & = \frac{P(A_{1})P(B_{1}|A_{1})}{P(A_{1})P(B_{1}|A_{1}) + 8 | P(A_{0})P(B_{1}|A_{0})} \nonumber \\ 9 | & = \frac{0.5 * 0.9}{0.5 * 0.9 + 0.5 * 0.05} \nonumber \\ 10 | & = 0.95 \nonumber 11 | \end{flalign} 12 | 13 | \item Let $B_{j,k,l}$ be the event that Bob recieves bit tuple $j, k, l$. 14 | 15 | \begin{flalign} 16 | P(A_{1}|B_{110}) & = \frac{P(A_{1})P(B_{110}|A_{1})}{P(A_{1})P(B_{110}|A_{1}) + 17 | P(A_{0})P(B_{110}|A_{0})} \nonumber \\ 18 | & = \frac{0.5 * 0.9^{2} * 0.1}{0.5 * 0.9^{2} * 0.1 + 0.5 * 0.05^{2} * 0.95} \nonumber \\ 19 | & = 0.97 \nonumber 20 | \end{flalign} 21 | 22 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/5/sections/exponential/problems/45.tex: -------------------------------------------------------------------------------- 1 | Let N be the number of emails received within the first 0.1 hours. Then 2 | 3 | \(P(T>0.1) = 1 - P(T<0.1) = 1 - P(N \geq 3) = \newline 1 - (1 - P(N=0) - P(N=1) - P(N=2)) = P(N=0)+P(N=1)+P(N=2)\)\\ 4 | 5 | That is, to find the probability that it takes longer than 0.1 hours for 3 emails to arrive, we find the probability it takes less than 0.1 hours for 3 emails to arrive. To do this, we realize that this is equivalent to at least 3 emails arriving in the first 0.1 hours. And to find that probability, we realize we can find the probabilities of exactly 0, 1, or 2 emails arriving in the first 0.1 hours.\\ 6 | 7 | Next, we note that \(N \sim Pois(0.1*\lambda) = Pois(2)\), per the definition of a Poisson process. Then we get 8 | \[P(T>0.1) = P(N=0)+P(N=1)+P(N=2) = e^{-2} + 2e^{-2} + 4e^{-2}/2 = 5e^{-2} \approx 0.68\] 9 | -------------------------------------------------------------------------------- /src/chapters/4/sections/indicator_r.v.s/problems/39.tex: -------------------------------------------------------------------------------- 1 | Let $I_{j,1}$ and $I_{j,2}$ be the indicator random variables for the $j$-th 2 | person being sampled by the first and second researchers respectively. 3 | 4 | $P(I_{j,1} = 1) = \frac{\binom{N-1}{m-1}}{\binom{N}{m}}$. $P(I_{j,2} = 1) = 5 | \frac{\binom{N-1}{n-1}}{\binom{N}{n}}$. Since sampling is done independently by 6 | the two researchers, $P(I_{j,1} = 1, I_{j,2} = 1) = \frac{\binom{N-1}{m-1}\binom{N-1}{n-1}}{ 7 | \binom{N}{m}\binom{N}{n}}$. 8 | 9 | Let $X = \sum_{j=1}^{n}(I_{j,1}I_{j,2})$ be the number of people sampled by 10 | both researchers. Then, $$\text{E}(X) = \text{E}(\sum_{j=1}^{n}(I_{j,1}I_{j,2})) = 11 | \sum_{j=1}^{n}\text{E}(I_{j,1}I_{j,2}) = \sum_{j=1}^{n}\frac{\binom{N-1}{m-1}\binom{N-1}{n-1}}{ 12 | \binom{N}{m}\binom{N}{n}} = n\frac{\binom{N-1}{m-1}\binom{N-1}{n-1}}{ 13 | \binom{N}{m}\binom{N}{n}}$$ -------------------------------------------------------------------------------- /src/chapters/4/sections/indicator_r.v.s/problems/60.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item By the story of the problem, $X \sim \text{NHGeom}(n, N-n, m)$. Then, $Y = 3 | X + m$. 4 | 5 | \item According to part $a$, $\text{E}(Y) = \text{E}(X) + m = \frac{m(N-n)} 6 | {n+1} + m$. The implied indicator variables are the same as in the proof of the 7 | expectation of Negative Hypergeometric random variables. 8 | 9 | \item The problem can be modeled with a Hypergeometric random variable $Z 10 | \sim \text{HGeom}(n, N-n, \text{E}(Y))$. Then, $\text{E}(Z) = \text{E} 11 | (Y)\frac{n}{N} = (\frac{m(N-n)}{n+1} + m)\frac{n}{N} = m \times \frac{N+1} 12 | {n+1}\times 13 | \frac{n}{N}$. Since $\frac{N+1}{n+1} \times \frac{n}{N} < 1 \implies (n+1)N(n-N) 14 | < 0 \implies \frac{N-n}{(n+1)N} > 0 \implies n < N$ for positive $n$ and $N$, $ 15 | \text{E}(Z) < m$. 16 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/1/sections/story_proofs/problems/18.tex: -------------------------------------------------------------------------------- 1 | Consider the right hand side of the equation. Since a committe chair can only 2 | be selected from the first group, there are $n$ ways to choose them. Then, for 3 | each choice of a committee chair, there are ${2n-1 \choose n-1}$ ways to choose 4 | the remaining members. Hence, the total number of committees is $n{2n-1 \choose n-1}$. 5 | 6 | Now consider the left side of the equation. Suppose we pick $k$ people from the 7 | first group and $n-k$ people from the second group, then there are $k$ ways to 8 | assign a chair from the members of the first group we have picked. $k$ can range 9 | from $1$ to $n$ giving us a total of 10 | $\sum_{k=1}^{n} k{n \choose k}{n \choose n-k} = \sum_{k=1}^{n} k{n \choose k}^{2}$ 11 | possible committees. 12 | 13 | Since, both sides of the equation count the same thing, they are equal. -------------------------------------------------------------------------------- /src/chapters/4/sections/indicator_r.v.s/problems/54.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item Since $P(W_{j} = y_{k})$ 3 | for $1 \leq k \leq N$ is $\frac{\binom{N-1}{n-1}}{\binom{N}{n}}\frac{1}{n} = 4 | \frac{n}{N}\frac{1}{n} = \frac{1}{N}$, 5 | $$\text{E}(W_{j}) = \frac{1}{N}\sum_{k=1}^{N}y_{k}.$$ 6 | Thus, 7 | 8 | \begin{align*} 9 | \text{E}(\overline{W}) &= \frac{1}{n}\sum_{j=1}^{n}(\frac{1}{N}\sum_{k=1}^{N}y_{k}) \\ 10 | &= \frac{1}{N}\sum_{k=1}^{N}y_{k} \\ 11 | &= \overline{y} 12 | \end{align*} 13 | 14 | \item Since $$\overline{W} = \frac{1}{n}\sum_{j=1}^{N}(I_{j}y_{j})$$ where $I_{j}$ 15 | is the 16 | indicator variable for the $j$-th person being in the sample. Then, 17 | 18 | \begin{align*} 19 | \text{E}(\overline{W}) &= \frac{1}{n}\sum_{j=1}^{N}\frac{n}{N}y_{j}\\ 20 | &= \frac{1}{N}\sum_{k=1}^{N}y_{k} \\ 21 | &= \overline{y} 22 | \end{align*} 23 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/4/sections/mixed_practice/problems/91.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item If $F=G$, Then, $X_{j}$ is equally likely to be in any of the $m + n$ 3 | positions in the ordered list. 4 | $$\text{E}(R) = \sum_{j=1}^{m}\text{E}(R_{j}) = \sum_{j=1}^{m}\frac{(m+n) 5 | (m+n+1)}{2}\frac{1}{m+n} = m\frac{m+n+1}{2}.$$ 6 | 7 | \item $R_{j} = (\sum_{k=1}^{n}I_{Y_{k}} + \sum_{k \neq j}I_{X_{k}} + 1)$ where $I_{Y_{k}}$ are the indicator random variables for $X_{j}$ being larger than $Y_{k}$ and $I_{X_{k}}$ are the indicator random variables for $X_{j}$ being larger than $X_{k}$. Note that $E(I_{Y_{k}}) = p$ for all k since the Ys are iid, and $E(I_{X_{k}}) = 1/2$ - $X_{j}$ and $X_{k}$ are iid and never equal, so they are equally likely to be bigger or smaller than the other. Then $\text{E}(R_{j}) = np + (m-1)/2 + 1$.Thus, $\text{E}(R) = m(np + (m-1)/2 + 1)$. 8 | \end{enumerate} 9 | -------------------------------------------------------------------------------- /src/chapters/2/sections/mixed_problems/problems/69.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item $$y = dp + (1-d)(1-p)$$ 3 | 4 | \item The worst choice for $p$ is $\frac{1}{2}$, because then the fraction of 5 | "yes" responses is $\frac{1}{2}$ irrespective of the fraction of drug users. In 6 | other words, the number of "yes" responses tells us nothing. 7 | 8 | \item We can extend the result from part $a$. 9 | 10 | A drug user says "yes" either if they get a "Have you used drugs" slip, or 11 | if they get a "I was born in winter" slip and they are, in fact, born in winter. 12 | 13 | A person who has not used drugs says "yes" only in the case that 14 | they get a "I was born in winter" slip and they were, in fact, 15 | born in winter. 16 | 17 | $$y = d(p + \frac{1}{4}(1-p)) + (1-d)(1-p)\frac{1}{4}$$ 18 | 19 | Thus, 20 | 21 | $$d = \frac{4y + p - 1}{2p}$$ 22 | 23 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/2/sections/monty_hall/problems/41.tex: -------------------------------------------------------------------------------- 1 | Let $G_{i}$ be the event that the $i$-th door contains a goat, and let 2 | $D_{i}$ be the event that Monty opens door $i$. 3 | 4 | $$P(G_{1}|D_{2}, G_{2}) = \frac{P(G_{1})P(D_{2}, G_{2} | G_{1})}{P(D_{2}, G_ 5 | {2})}.$$ 6 | 7 | \begin{align*} 8 | P(G_{1})P(D_{2}, G_{2} | G_{1}) &= \frac{2}{3}\left(P(G_{2} | G_{1})P(D_ 9 | {2} | G_{1}, G_{2})\right) \\ 10 | &= \frac{2}{3}\left(\frac{1}{2}(p + (1 - p)\frac{1}{2})\right) \\ 11 | &= \frac{2}{3}\left(\frac{1}{2}p + \frac{1}{4} - \frac{1}{4}p\right) \\ 12 | &= \frac{1}{6}(p + 1). 13 | \end{align*} 14 | 15 | Thus, 16 | 17 | \begin{align*} 18 | P(G_{1}|D_{2}, G_{2}) &= \frac{\frac{1}{6}(p+1)}{\frac{1}{6}(p+1) + \frac{1} 19 | {3} \times \frac{1}{2}} \\ 20 | &= \frac{p + 1}{p + 2}. 21 | \end{align*} 22 | 23 | Note that when $p=1$, the result matches that of the basic Monty Hall 24 | problem. -------------------------------------------------------------------------------- /src/chapters/3/sections/named_distributions/problems/22.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item Let $C_{i}$ be the event that $i$-th type of coin is chosen. Let $H_{k}$ 3 | be the event that $k$ out of the $n$ flips land heads. 4 | 5 | $$P(X = k) = P(C_{1})P(H_{k}|C_{1}) + P(C_{2})P(H_{k}|C_{2}) = \frac{1}{2} 6 | \binom{n}{k}p_{1}^{k}(1-p_{1})^{n-k}+ \frac{1}{2} 7 | \binom{n}{k}p_{2}^{k}(1-p_{2})^{n-k}$$ 8 | 9 | \item if $p_{1} = p_{2}$, then $X$ is Binomial $n$, $k$. 10 | 11 | \item If $p_{1} \neq p_{2}$, then the Bernoulli trials are not independent. If, 12 | for instance, $p_{1}$ is small and $p_{2}$ is large, and after the first 13 | million flips we see two heads, this increases the likelihood that we are using 14 | the coin with probability $p_{1}$ of landing heads, which in turn tells us that 15 | subsequent flips are unlikely to be land heads. 16 | 17 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/3/sections/pmfs_and_cdfs/problems/9.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item 3 | $F(x) = pF_{1}(x) + (1-p)F_{2}(x)$. 4 | 5 | Let $x_{1} < x_{2}$. Then $$F(x_{1}) = pF_{1}(x_{1}) + (1-p)F_{2}(x_{1}) < pF_ 6 | {1}(x_{2}) + (1-p)F_{2}(x_{2}) = F(x_{2}).$$ 7 | 8 | Since $F(x)$ is a weighted sum of right continuous functions, it is itself a 9 | right continuous function. 10 | 11 | $$\lim_{x \to \infty} F(x) = p\lim_{x \to \infty} F_{1}(x) + (1 - p)\lim_{x \to 12 | \infty} F_{2}(x) = p + 1 - p = 1.$$ 13 | 14 | Similarly, $$\lim_{x \to -\infty}F(x) = 0.$$ 15 | 16 | \item 17 | Let $X$ be an r.v. created as described. Let $H$ be the event that coin 18 | lands heads, and $T$ be the event that the coin lands tails. 19 | 20 | Then, $F(X=k) = P(H)F_{1}(k) + P(T)F_{2}(k) = pF_{1}(k) + (1-p)F_{2}(k).$ 21 | 22 | Note that this is the same CDF as in part $a$. 23 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/4/sections/named_distributions/problems/30.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item 3 | \begin{align*} 4 | \text{E}(Xg(X)) &= \sum_{x=0}^{\infty}xg(x)\frac{\text{e}^{-\lambda} 5 | (\lambda)^{x}}{x!} \\ 6 | &= \sum_{x=1}^{\infty}xg(x)\frac{\text{e}^{-\lambda} 7 | (\lambda)^{x}}{x!} \\ 8 | &= \lambda\sum_{x=1}^{\infty}g(x)\frac{\text{e}^{-\lambda} 9 | (\lambda)^{x-1}}{(x-1)!} \\ 10 | &= \lambda\sum_{x=0}^{\infty}g(x+1)\frac{\text{e}^{-\lambda} 11 | (\lambda)^{x}}{(x)!} = \lambda\text{E}(g(X+1)) 12 | \end{align*} 13 | 14 | \item 15 | \begin{align*} 16 | \text{E}(X^{3}) &= \text{E}(XX^{2}) \\ 17 | &= \lambda\text{E}((X+1)^{2}) \\ 18 | &= \lambda(\text{E}(X^{2}) + \text{E}(2X) + 1) \\ 19 | &= \lambda(\lambda\text{E}(X+1) + 20 | 2\lambda + 1) = \lambda(\lambda(\lambda + 1) + 2\lambda + 1) \\ 21 | &= \lambda(\lambda^{2} + 3\lambda + 1) 22 | \end{align*} 23 | \end{enumerate} 24 | -------------------------------------------------------------------------------- /src/chapters/2/sections/mixed_problems/index.tex: -------------------------------------------------------------------------------- 1 | \section{Mixed Problems} 2 | 3 | \subsection{problem 60} 4 | \input{problems/60} 5 | 6 | \subsection{problem 61} 7 | \input{problems/61} 8 | 9 | \subsection{problem 62} 10 | \input{problems/62} 11 | 12 | \subsection{problem 63} 13 | \input{problems/63} 14 | 15 | \subsection{problem 64} 16 | \input{problems/64} 17 | 18 | \subsection{problem 65} 19 | \input{problems/65} 20 | 21 | \subsection{problem 66} 22 | \input{problems/66} 23 | 24 | \subsection{problem 67} 25 | \input{problems/67} 26 | 27 | \subsection{problem 68} 28 | \input{problems/68} 29 | 30 | \subsection{problem 69} 31 | \input{problems/69} 32 | 33 | \subsection{problem 70} 34 | \input{problems/70} 35 | 36 | \subsection{problem 71} 37 | \input{problems/71} 38 | 39 | \subsection{problem 72} 40 | \input{problems/72} 41 | 42 | \subsection{problem 74} 43 | \input{problems/74} 44 | -------------------------------------------------------------------------------- /src/chapters/4/sections/expectations_and_variances/problems/17.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item The expected number of children in a randomly selected family during a 3 | particular era is $\text{E}(X) = \sum_{k=0}^{\infty}k\frac{n_{k}}{\sum_{k=0}^ 4 | {\infty}n_{k}} = \frac{m_{1}}{m_{0}}$. 5 | 6 | \item The expected number of children in the family of a randomly selected child 7 | is $\text{E}(X) = \sum_{k=0}^{\infty}k\frac{kn_{k}}{\sum_{k=0}^{\infty}kn_{k}} = 8 | \frac{m_{2}}{m_{1}}$. 9 | 10 | \item answer in part $b$ is larger than the answer in part $a$. Since the 11 | average in part $a$ is taken over randomly selected families, families with 12 | fewer children are weighted the same as families with more children. The average 13 | in part $b$, on the other hand, is taken over individual children, skewing the 14 | weights in favor of families with more children. 15 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/1/sections/counting/problems/12.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item $${52 \choose 13}$$ 3 | 4 | \item The number of ways to break $52$ cards into $4$ groups of size $13$ is 5 | $$\frac{{52 \choose 13}{39 \choose 13}{26 \choose 13}{13 \choose 13}}{4!}$$. 6 | 7 | The reason for dividision by $4!$ is that all permutations of specific $4$ 8 | groups describe the same way to group $52$ cards. 9 | 10 | Since we do care about the order of the $4$ groups, we should not divide by 11 | ${4!}$. The final answer then is 12 | $${52 \choose 13}{39 \choose 13}{26 \choose 13}{13 \choose 13}$$ 13 | 14 | \item The key is to notice that the sampling is done without replacement. 15 | ${52 \choose 13}^{4}$ assumes that all four players have ${52 \choose 13}$ 16 | choices of hands available to them. This would be true if sampling was done 17 | with replacement. 18 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/1/sections/counting/problems/6.tex: -------------------------------------------------------------------------------- 1 | Line up the 20 players in some order then say the first two are a pair, the 2 | next two are a pair, etc. This overcounts by a factor of 10! because we don't 3 | care about the order of the games. So in total we have 4 | $$ \frac{20!}{10!} $$ 5 | ways for them to play. This correctly counts for the whether player A plays 6 | white or black. If we didn't care we would need to divide by 2$^{10}$. 7 | 8 | Another way to look at it is to choose the 10 players who will play white then 9 | let each of them choose their opponent from the other 10 players. This gives a 10 | total of 11 | 12 | $$ {20 \choose 10} \times 10!$$ 13 | 14 | possibilities of how they are matched up. We don't care about the order of the 15 | players who play white but once we've chosen them the order of the players who 16 | play black matters since different orders mean different pairings. -------------------------------------------------------------------------------- /src/chapters/1/sections/mixed_practice/problems/56.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | 3 | \item $>$ 4 | 5 | \item $<$ 6 | 7 | \item $=$ 8 | 9 | We are interested in two outcomes of the samme sample space. 10 | This is, $S = \{(a_{1}, a_{2}, a_{3}) : a_{i} \in \{1, 2, 3, ..., 365\}\}$ 11 | The first outcome is $(1, 1, 1)$, and the second outcome is $(1, 2, 3)$. 12 | The answer follows, since every outcome of the sample space is equally likely. 13 | 14 | \item $<$ 15 | 16 | If the first toss is $T$, Martin can never win, since as soon as $H$ is seen 17 | on any subsequent toss, the game stops, and Gale is awarded the win. 18 | 19 | If the first toss is $H$, then if the second toss is also $H$, Martin wins. 20 | Otherwise, if the second toss is $T$, Gale wins, since as soon as a subsequent 21 | toss shows $H$, Gale is awarded a win. 22 | 23 | Thus, Martin loses $\frac{3}{4}$ of the time. 24 | \end{enumerate} -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | all: before_install src/* 2 | mkdir -p output/html 3 | mkdir -p output/pdf 4 | (cd src && exec pdflatex index.tex) 5 | (cd src && exec pdflatex index.tex) 6 | (cd src && exec pdflatex index.tex) 7 | (cd src && exec make4ht -uf html5+mathjaxnode -c ../my.cfg index.tex "html,4") 8 | (cd src && exec mv *.css *.html ../output/html) 9 | (cd src && exec cp index.pdf ../output/html) 10 | find ./src -type f -not \( -name '*.tex' \) -delete 11 | python3 add-pdf-url.py output/html/index.html 12 | 13 | before_install: 14 | sudo apt-get -qq update && sudo apt-get install -y --no-install-recommends texlive-full pandoc latexmk pdf2svg 15 | sudo apt-get install python3 python3-pip python3-setuptools 16 | pip3 install --upgrade pip 17 | pip3 install beautifulsoup4 18 | npm -g install mathjax-node-page 19 | 20 | .PHONY: clean 21 | clean :: 22 | find ./src -type f -not \( -name '*.tex' \) -delete 23 | -rm -rf output 24 | -------------------------------------------------------------------------------- /src/chapters/4/sections/indicator_r.v.s/problems/53.tex: -------------------------------------------------------------------------------- 1 | Let $I_{j}$ be the indicator variable for tosses $j$ and $j+1$ landing heads for 2 | $1 \leq j \leq 3$. Then, the expected number of such pairs is $\text{E}(X) = 3 | \sum_{j=1}^{3}P(I_{j}=1) = 3p^{2}$. $\text{Var}(X) = \text{E}(X^{2}) - 4 | 9p^{4}$. 5 | 6 | $\text{E}(X^{2}) = \text{E}((\sum_{j=1}^{3}I_{j})^{2}) = \text{E}((I_{1} + I_ 7 | {2})^{2} + 2(I_{1}+I_{2})I_{3} + I_{3}^{2}) = \text{E}(I_{1}^{2} + 2I_{1}I_{2} 8 | + I_{2}^{2} + 2I_{1}I{3} + 2I_{2}I{3} + I_{3}^{2})$. 9 | 10 | Note that $I_{j}^{2} = I_ 11 | {j}$. 12 | 13 | Note that $E(I_{1}I_{2})=E(I_{2}I_{3})=p^{3}$ as these require 3 consecutive heads to equal 1, but $E(I_{1}I_{3}) = p^{4}$ as this requires 4 consecutive heads to equal 1. Thus, $\text{E}(X^{2}) = (p^{2} + 2p^{3} + p^{2} + 2p^{4} + 2p^{3} + p^ 14 | {2}) = 4p^{3} + 3p^{2} + 2p^{4}$. 15 | 16 | Thus, $$\text{Var}(X)= 4p^{3} + 3p^{2} - 7p^{4}$$ 17 | -------------------------------------------------------------------------------- /src/chapters/2/sections/mixed_problems/problems/65.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item All $(n+1)!$ permutations of the balls are equally likely, so the 3 | probability that we draw the defective ball is $\frac{1}{n+1}$ irrespective of 4 | when we choose to draw. 5 | 6 | \item Consider the extreme case of the defective ball being super massive 7 | $(v >> nw)$. Then, it is more likely that a person draws the defective ball 8 | rather than a non defective ball, so we want to draw last. On the other hand, 9 | if $v$ is much smaller than $nw$, then, at any stage of the experiment, 10 | drawing the defective ball is less likely than not, but after each draw of a 11 | non defective ball, the probability of it being drawn increases since there are 12 | less balls left in the urn. Thus, we want to be one of the first ones to draw. 13 | 14 | So the answer depends on the relationship of $w$ and $v$. 15 | 16 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/1/sections/naive_definition_of_probability/problems/26.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item The problem is isomorphic (having same structure) to the birthday 3 | problem. When sampling with replacement, each person corresponds to 4 | a date in the birthday problem, and the size of sample corresponds to 5 | the number of people in birthday problem. Hence, taking a random 6 | sample of $1000$ from a population of a million corresponds to asking 7 | a thousand people their birth date where there are a total of a million 8 | dates. Number of ways to take such a sample is $K^{1000}$ where $K$ is 9 | size of population. 10 | Similarly, number of ways to take sample without replacement corresponds 11 | to number of ways of having no birthday match in that situation: 12 | $K(K-1) \dots (K-1000+1)$ 13 | 14 | \item $$P(A) = 1 - P(A^{c}) = 1 - \frac{K(K-1) \dots (K-1000+1)}{K^{1000}}$$ 15 | where $K = 1000000$. 16 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/5/sections/mixed_practice/problems/56.tex: -------------------------------------------------------------------------------- 1 | \begin{flalign} 2 | \mathbb{E}[Z^2 \Phi(z)] & = \ri x^2 \int_{-\infty}^{x} e^{-\frac{x^2}{2}} dx 3 | \end{flalign} 4 | Now 5 | \[\ri f(z) dz \ri f(z) dz\] 6 | if \(\ri f(z) dz\) is meant to be \(\lim_{a \rightarrow \infty} \int_{-a}^{a} f(z) dz\) 7 | So 8 | \begin{flalign} 9 | \mathbb{E} [z^2 \Phi(z)] & = \int x^2 \Phi(x) e^{-\frac{x^2}{2}} dx \\ 10 | & = \int x^2 \Phi(-x) e^{-\frac{x^2}{2}} dx \\ 11 | & = \int x^2 (1 - \Phi(x)) e^{-\frac{x^2}{2}} dx 12 | \end{flalign} 13 | 14 | So 15 | \begin{flalign} 16 | E[\Phi(z) z^2] & = \int x^2 \Phi(x) e^(-\frac{x^2}{2}) dx \\ 17 | & = \frac{1}{2} \int x^2 e^{- \frac{x^2}{2}} \\ 18 | & = \frac{1}{2} 19 | \end{flalign} 20 | 21 | 22 | (b) 23 | \[ 24 | P(\Phi(z) \leq \frac{2}{3}) = P (z \leq \Phi^{-1} (\frac{2}{3})) = \Phi(\Phi^{-1} (\frac{2}{3})) 25 | \] 26 | 27 | (c) 28 | \[ 29 | \frac{1}{3!} 30 | \] 31 | 32 | -------------------------------------------------------------------------------- /src/chapters/1/sections/naive_definition_of_probability/problems/35.tex: -------------------------------------------------------------------------------- 1 | We can generate a random hand of $13$ cards with the desired property by 2 | the following process: 3 | 4 | \begin{enumerate} 5 | \item Pick a suite to sample $4$ cards from 6 | 7 | \item Sample $3$ cards for each one of the other suites 8 | \end{enumerate} 9 | 10 | There are $4$ suites and $\binom{13}{4}$ ways to sample $4$ cards for any 11 | of one of them. 12 | 13 | By the multiplication rule, there are $\binom{13}{3}^{3}$ ways to sample $3$ 14 | cards of every one of the remaining $3$ suits. 15 | 16 | By the multiplication rule, the total number of possibilities is 17 | $4 \binom{13}{4} \binom{13}{3}^{3}.$ 18 | 19 | The unconstrained number of $13$-card hands is $\binom{52}{13}$. 20 | 21 | Since each hand is equally likely, by the naive definition of probability, 22 | the desired likelihood is 23 | 24 | $$ \frac{4 \binom{13}{4} \binom{13}{3}^{3}}{\binom{52}{13}} $$ -------------------------------------------------------------------------------- /src/chapters/4/sections/poisson_approximation/problems/69.tex: -------------------------------------------------------------------------------- 1 | There are \({1000\choose 2}\) pairs of sampled individuals - each pair has a \(\frac{1}{10^{6}}\) chance of being the same person. Therefore, we can estimate the "rate of occurrence" of a pair being the same person as \({1000\choose 2}*\frac{1}{10^{6}} = \frac{1000*999}{2*10^{6}} \approx \frac{10^{6}}{2*10^{6}} = 1/2\). Therefore, the number of pairs in the sample that are the same person can be approximated by Pois(1/2).\\ 2 | 3 | Then the probability that there is at least one pair in the sample that are the same person is \(1-e^{-0.5} = 0.393\). This can be verified as a close approximation in R - the probability that every individual in the sample is unique is the last value resulting from the command cumprod(1-(0:999)/1000000), which is .6067. 1 minus this value gives .3933, the actual probability some two sampled individuals are the same person, which is very close to our Poisson approximation. 4 | -------------------------------------------------------------------------------- /src/chapters/3/sections/named_distributions/problems/33.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item The probability of a typo being caught is $p_{1} + p_{2} - p_{1}p_{2}$. 3 | Then, $$P(X = k) = \binom{n}{k}(p_{1} + p_{2} - p_{1}p_{2})^{k}(1 - (p_{1} + p_ 4 | {2} - p_{1}p_{2}))^{n-k}$$ 5 | 6 | \item When we know the total number of caught typos in advance, the typos caught 7 | by the first proofreader are no longer independent. For example, if we know that 8 | first proofreader has caught the first $t$ typos, and the total number of caught 9 | typos is $t$, then the probability of the first proofreader catching subsequent 10 | typos is $0$, since the total number of caught typos was $t$. 11 | 12 | Thus, we employ a Hypergeometric distribution. Since $p_{1} = p_{2}$, all $\binom{2n}{t}$ $t$-tuples of caught typos are equally likely. Hence, 13 | 14 | $$P(X_{1} = k | X_{1} + X_{2} = t) = \frac{\binom{n}{k}\binom{n}{t-k}}{ 15 | \binom{2n}{t}}$$ 16 | \end{enumerate} -------------------------------------------------------------------------------- /my.cfg: -------------------------------------------------------------------------------- 1 | \Preamble{xhtml,mathml,fn-in,html5} 2 | \Css{body{ 3 | margin-top: 2em; 4 | margin-left: 2em; 5 | max-width:36em; 6 | line-height:1.6; 7 | font-size:1em; 0.88em; 8 | color:\#444; 9 | padding:0 10px;}} 10 | \Css{h1,h2,h3{line-height:1.2}} 11 | \Css{div.maketitle, h2.titleHead, div.author, div.date{text-align:left;}} 12 | \Css{div.author, div.date{font-size:0.7em;}} 13 | \Css{p.indent{text-indent:0;}} 14 | \Css{@media (min-width: 29.63em){ 15 | :root { 16 | font-size: 3vw; 17 | } 18 | }} 19 | 20 | \Css{@media (min-width: 40.74em){ 21 | :root { 22 | font-size: 1.375em; 23 | } 24 | }} 25 | \Css{body { 26 | font-family: STIXGeneral, "Linux Libertine O", Gentium, Georgia, 27 | "Times New Roman", "Iowan Old Style", 28 | Palatino Linotype, Palatino, serif; 29 | }} 30 | 31 | \Css{dt.enumerate-enumitem { 32 | margin-left: 0; 33 | }} 34 | 35 | \begin{document} 36 | \EndPreamble -------------------------------------------------------------------------------- /src/chapters/1/sections/story_proofs/problems/17.tex: -------------------------------------------------------------------------------- 1 | ${2n \choose n}$ counts the number of ways to sample $n$ objects from a 2 | set of $2n$. Instead of sampling from the whole set, we can break the set into 3 | two sets of size $n$ each. Then, we have to sample $n$ objects in total 4 | from both sets. 5 | 6 | We can sample all $n$ objects from the first set, or $1$ object from the 7 | first set and $n-1$ objects from the second set, or $2$ objects from the first 8 | set and $n-2$ objects from the second set and so on. 9 | 10 | There are ${n \choose n}$ ways to sample all $n$ objects from the first set, 11 | ${n \choose 1} {n \choose n-1}$ ways to sample $1$ object from the first set 12 | and $n-1$ objects from the second set, ${n \choose 2} {n \choose n-2}$ ways to 13 | sample $2$ objects from the first set and $n-2$ objects from the second set. 14 | The pattern is clear 15 | $$ \sum_{k=0}^{n} {n \choose k} {n \choose n-k} = \sum_{k=0}^{n} {n \choose k}^{2}$$ -------------------------------------------------------------------------------- /src/chapters/2/sections/conditioning_on_evidence/problems/9.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | 3 | \item $P(A_{1}|B) = \frac{P(A_{1})P(B|A_{1})}{P(B)} = \frac{P(A_{1})}{P(B)} = 4 | \frac{P(A_{2})}{P(B)} \frac{P(A_{2})P(B|A_{2})}{P(B)} = P(A_{2}|B)$. 5 | 6 | \item If $B$ is implied by both $A_{1}$ and $A_{2}$, knowing that $B$ occured 7 | does not tip the probability of occurence in favor of either $A_{1}$ or $A_{2}$. 8 | 9 | For example, let $A_{1}$ be the event that the card in my hand is the Ace of Spades. 10 | Let $A_{2}$ be the event that the card in my hand is the Ace of Hearts. 11 | Let $B$ be the event that there are $3$ aces left in the deck. 12 | 13 | $B$ is implied by both $A_{1}$ and $A_{2}$, and $P(A_{1}) = P(A_{2})$. 14 | Knowing that $B$ occured does not give one any information on whether they are 15 | holding the Ace of Spades or the Ace of Hearts, since $B$ would have occured in 16 | both cases. Thus, $P(A_{1}|B) = P(A_{2}|B)$. 17 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/2/sections/conditioning_on_evidence/problems/14.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | 3 | \item Intuitively, $P(A|B) > P(A|B^{c})$, since Peter will be in a rush to 4 | install his alarm if he knows that his house will be burglarized before the 5 | end of next year. 6 | 7 | \item Intuitively $P(B|A^{c}) > P(B|A)$, since Peter is more likely to be 8 | robbed if he doesn't have an alarm by the end of the year. 9 | 10 | \item See \url{https://math.stackexchange.com/a/3761508/649082}. 11 | 12 | \item An explanation might be that in part $a$, we assume Peter to be driven 13 | to not let burglars rob him, but in part $b$ we assume the burglars to not 14 | necessarily be as driven, since we assume that if the burglers know that 15 | Peter will install an alaram before the end of the next year 16 | they might not rob him. If the burglers are driven, they might actually be 17 | more inclined to rob Peter sooner, before he actually installs the alarm. 18 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/5/sections/pdfs_and_cdfs/problems/1.tex: -------------------------------------------------------------------------------- 1 | The PDF is \[f(x) = x e^{-x^2 / 2}\] 2 | \begin{flalign} 3 | P(X \leq a) & = \int_{0}^a f(x) dx \nonumber\\ 4 | & = \int_{0}^a x e^{-x^2 / 2} dx \nonumber\\ 5 | & = 1 - e^{-a^2 / 2} \nonumber 6 | \end{flalign} 7 | 8 | The quantile function $Q$, equal to the inverse of the CDF, is given by 9 | 10 | \[Q(a) = \sqrt{-2 \log(1-a)}\] 11 | 12 | (a) 13 | \begin{flalign} 14 | P(1 < X < 3) & = P(X \le 3) - P(X \le 1) \nonumber\\ 15 | & = e^{-1/2} - e^{-9/2} \nonumber 16 | \end{flalign} 17 | 18 | (b) 19 | The general formula for calculating the quartiles is as follows 20 | 21 | \[P(X \le q_j) = \frac{j}{4}\] 22 | \[q_j = Q\left( \frac{j}{4} \right) = \sqrt{ -2 \log \left( \frac{3 j}{4} \right) } \text{ , for } j=1,2,3\] 23 | 24 | First quartile $q_1$ 25 | 26 | \[q_1 = 0.759\] 27 | 28 | Second quartile $q_2$, also known as median 29 | 30 | \[q_2 = 1.18\] 31 | 32 | Third quartile $q_3$ 33 | 34 | \[q_3 = 1.67\] 35 | 36 | -------------------------------------------------------------------------------- /src/chapters/4/sections/expectations_and_variances/problems/10.tex: -------------------------------------------------------------------------------- 1 | The probability that the game lasts \(n\) rounds is \(1/2^{n}\).\\\\ 2 | 3 | Thus, if the winnings for \(n\) rounds is \(n\), we must compute \(\sum_{i=1}^{\infty}(i/2^{i})\).\\\\ 4 | 5 | We know that \(\sum_{i=1}^{\infty}(x^{i})=\frac{x}{1-x}\). Deriving both sides with respect to x gives \(\sum_{i=1}^{\infty}(ix^{i-1})=\frac{1}{(1-x)^{2}}\). Multiplying by both sides gives \(\sum_{i=1}^{\infty}(ix^{i})=\frac{x}{(1-x)^{2}}\). Plugging in \(x=1/2\) gives the answer \(2\). \\\\ 6 | 7 | For the second part of the problem we need to find \(\sum_{i=1}^{\infty}(i^{2}/2^{i})\).\\\\ 8 | 9 | We know \(\sum_{i=1}^{\infty}(ix^{i})=\frac{x}{(1-x)^{2}}\). Deriving both sides with respect to x again, using the quotient rule, gives \(\sum_{i=1}^{\infty}(i^{2}x^{i-1})=\frac{1+x}{(1-x)^{3}}\). Multiplying both sides by \(x\) gives \(\sum_{i=1}^{\infty}(i^{2}x^{i})=\frac{x+x^{2}}{(1-x)^{3}}\). Plugging in \(x=1/2\) gives the answer of \(6\). 10 | -------------------------------------------------------------------------------- /src/chapters/3/sections/named_distributions/problems/31.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item Note that the distribution is not Binomial, since the guesses are not 3 | independent of each other. If, for instance, the woman guesses the first three 4 | cups to be milk-first, and she is correct, then the probability of her guessing 5 | milk-first on subsequent guesses is $0$, since it is known in advance that there 6 | are only $3$ milk-first cups. 7 | 8 | Hypergeometric story fits. Let $X_{i}$ be the probability that the lady guesses 9 | exactly $i$ milk-first cups correctly. 10 | 11 | $$P(X_{i}) = \frac{\binom{3}{i}\binom{3}{3-i}}{\binom{6}{3}}$$ 12 | 13 | Thus, $P(X_{2}) + P(X_{3}) = \frac{10}{\binom{6}{3}} = \frac{1}{2}$ 14 | 15 | \item Let $M$ be the event that the cup is milk first, and let $T$ be the event 16 | that the lady claims the cup is milk first. Then, 17 | 18 | $$\frac{P(M|T)}{P(M^{c}|T)} = \frac{P(M)}{P(M^{c})}\frac{p_{1}}{1-p_{2}} = \frac{p_{1}}{1-p_{2}}$$ 19 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/3/sections/named_distributions/index.tex: -------------------------------------------------------------------------------- 1 | \section{Named Distributions} 2 | 3 | \subsection{problem 15} 4 | \input{problems/15} 5 | 6 | \subsection{problem 16} 7 | \input{problems/16} 8 | 9 | \subsection{problem 17} 10 | \input{problems/17} 11 | 12 | \subsection{problem 19} 13 | \input{problems/19} 14 | 15 | \subsection{problem 20} 16 | \input{problems/20} 17 | 18 | \subsection{problem 22} 19 | \input{problems/22} 20 | 21 | \subsection{problem 23} 22 | \input{problems/23} 23 | 24 | \subsection{problem 24} 25 | \input{problems/24} 26 | 27 | \subsection{problem 26} 28 | \input{problems/26} 29 | 30 | \subsection{problem 27} 31 | \input{problems/27} 32 | 33 | \subsection{problem 30} 34 | \input{problems/30} 35 | 36 | \subsection{problem 31} 37 | \input{problems/31} 38 | 39 | \subsection{problem 32} 40 | \input{problems/32} 41 | 42 | \subsection{problem 33} 43 | \input{problems/33} 44 | 45 | \subsection{problem 34} 46 | \input{problems/34} 47 | 48 | \subsection{problem 36} 49 | \input{problems/36} -------------------------------------------------------------------------------- /src/chapters/4/sections/expectations_and_variances/index.tex: -------------------------------------------------------------------------------- 1 | \section{Expectations And Variances} 2 | 3 | \subsection{problem 1} 4 | \input{problems/1} 5 | 6 | \subsection{problem 2} 7 | \input{problems/2} 8 | 9 | \subsection{problem 3} 10 | \input{problems/3} 11 | 12 | \subsection{problem 4} 13 | \input{problems/4} 14 | 15 | \subsection{problem 5} 16 | \input{problems/5} 17 | 18 | \subsection{problem 6} 19 | \input{problems/6} 20 | 21 | \subsection{problem 7} 22 | \input{problems/7} 23 | 24 | \subsection{problem 8} 25 | \input{problems/8} 26 | 27 | \subsection{problem 9} 28 | \input{problems/9} 29 | 30 | \subsection{problem 10} 31 | \input{problems/10} 32 | 33 | \subsection{problem 11} 34 | \input{problems/11} 35 | 36 | \subsection{problem 12} 37 | \input{problems/12} 38 | 39 | \subsection{problem 14} 40 | \input{problems/14} 41 | 42 | \subsection{problem 15} 43 | \input{problems/15} 44 | 45 | \subsection{problem 16} 46 | \input{problems/16} 47 | 48 | \subsection{problem 17} 49 | \input{problems/17} 50 | -------------------------------------------------------------------------------- /src/chapters/2/sections/conditioning_on_evidence/problems/17.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | 3 | \item 4 | $P(B|A) = \frac{P(B)P(A|B)}{P(B)P(A|B) + P(B^{c})P(A|B^{c})} = 1 5 | \implies P(B^{c})P(A|B^{c}) = 0$. 6 | 7 | Since $P(B^{c}) \neq 0$ by assumption, $P(A|B^{c}) = 0 8 | \implies P(A^{c}|B^{c}) = 1$. 9 | 10 | \item Let $A$ and $B$ be independent events. 11 | Then, $P(B|A) \approx 1 \implies P(B) \approx 1$. 12 | Thus, $P(B^{c}) \approx 0$, and so the term $P(A|B^{c})$ in the denominator in 13 | part $a$ may be large, 14 | implying $P(A^{c}|B^{c}) \approx 0$. 15 | 16 | For example, consider a deck of $52$ cards, where all but one of the cards are 17 | the Queen of Spades. 18 | Let $A$ be the event that the first turned card is a Queen of Spades, 19 | and let $B$ be the event that the second turned card is a Queen of Spades, where 20 | sampling is done with replacement. Then, $P(A) = P(B) \approx 1$. 21 | Then, by independence, $P(A|B^{c}) \approx 1 \implies P(A^{c}|B^{c}) \approx 0$. 22 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/5/sections/mixed_practice/problems/51.tex: -------------------------------------------------------------------------------- 1 | (a) We know that, \(X^2 \le X\) with probability 1. 2 | So \(\mathbb{E}[X^2] \le \mathbb{E}{X}\) 3 | \begin{flalign*} 4 | V(X) & = \mathbb{E}[X^2] - \mathbb{E}[X]^2 \\ 5 | & \le \mu - \mu^2 \\ 6 | & \le \frac{1}{4} \text{ (taking the maximum of the above quadratic)} 7 | \end{flalign*} 8 | (b) I have to show that \(V(X) = 1/4\) leads to a unique distribution. 9 | From (a), \(V(X) \le \mu - \mu^2 \le 1/4\) implies that, \(\mu = 1/2\) 10 | Now \[\mathbb{E}[(X - 1/2)^2] = 1/4\] 11 | But \[0 \le (X - 1/2)^2 \le 1/4\] with probability 1. 12 | To get \(\mathbb{E}[(X - 1/2)^2] = 1/4\), we need \((X - 1/2)^2 = 1/4\) with probability 1. 13 | So, 14 | \begin{equation*} 15 | X = 16 | \begin{cases} 17 | 0 & \text{with prob p} \\ 18 | 1 & \text{with prob 1 - p} 19 | \end{cases} 20 | \end{equation*} 21 | Using \(\mu = 1/2\) gives us, \(p = 1/2\). 22 | 23 | The distribution of $X$ is Bernoulli. More specifically, $X \sim \mathrm{Bern}(1/2)$. 24 | -------------------------------------------------------------------------------- /src/chapters/5/sections/normal/problems/35.tex: -------------------------------------------------------------------------------- 1 | Let \(g(Z) = max(Z-c, 0)\). We have \(g(Z) = 0\) for \(Z < c\) and \(g(Z) = Z-c\) for \(Z>c\).\\ 2 | 3 | Then 4 | 5 | \[E(g(Z)) = \int_{-\infty}^{\infty}g(k)\varphi(k)dk = \int_{c}^{\infty}(k-c)\varphi(k)dk\] 6 | 7 | since the expression inside the integral is 0 for \(k 0 9 | \end{array} 10 | \right. 11 | \end{equation*} 12 | 13 | \item First, notice that $(1-I)Y \in \{0,1,2,\dots\}$. $(1-I)Y = 0$ if $I=1$, or 14 | $Y=0$. Thus $P((1-I)Y = 0) = p + (1-p)P(Y=0)$. For any other value $k$ of $ 15 | (1-I)Y$, it is achieved if $I = 0$ and $Y = k$. Thus, $P((1-I)Y = k) = (1-p)P(Y 16 | = k)$. 17 | \item $\text{E}(X) = (1-p)\sum_{k=1}^{\infty}k\frac{e^{-\lambda}\lambda^{k}}{k!} 18 | = (1-p)\text{E}(\text{Poss}(\lambda)) = (1-p)\lambda$. 19 | 20 | $\text{E}(X) = \text{E}((1-I)Y) = \text{E}(1-I)\text{E}(Y) = (1-p)\lambda$. 21 | 22 | \item $\text{Var}(X) = \text{E}(X^{2}) - (\text{E}(X))^{2}$. $\text{E}(X^{2}) = 23 | (1-p)e^{-\lambda}\sum_{k=1}^{\infty}k^{2}\frac{\lambda^{k}}{k!} = (1-p)\lambda 24 | (1+\lambda)$. Thus, $\text{Var}(X) = (1-p)\lambda(1+\lambda) - ((1-p)\lambda)^ 25 | {2} = (1-p)\lambda(1 + p\lambda)$. 26 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/1/sections/naive_definition_of_probability/problems/36.tex: -------------------------------------------------------------------------------- 1 | We can think of the problem as sampling with replacement where order matters. 2 | 3 | There are $6^{30}$ possible sequences of outcomes. We are interested in the cases 4 | where each face of the die is rolled exactly $5$ times. Since each sequence is 5 | equally likely, we can use the naive definition of probability. 6 | 7 | There are $\binom{30}{5}$ ways to select the dice that fall on a $1$. Then, 8 | $\binom{25}{5}$ ways to select the dice falling on a $2$, $\binom{20}{5}$ 9 | falling on a $3$, $\binom{15}{5}$ falling on a $4$, $\binom{10}{5}$ falling 10 | on a $5$ and finally, $\binom{5}{5}$ falling on a $6$. 11 | 12 | Thus, the desired probability is $$\frac{\binom{30}{5} \binom{25}{5} 13 | \binom{20}{5} \binom{15}{5} \binom{10}{5} \binom{5}{5}}{6^{30}}$$ 14 | 15 | Alternatively, imagining the sample space to be a $30$ digit long sequence 16 | of $1, 2 \dots 6$, we want the cases in which each of $1, 2 \dots 6$ numbers 17 | appear exactly five times. There are $\frac{30!}{(5!)^{6}}$ ways to arrange 18 | such a sequence. Hence, the probability is $$\frac{30!}{(5!)^{6} 6^{30}}$$ 19 | -------------------------------------------------------------------------------- /src/chapters/1/sections/inclusion_exclusion/problems/49.tex: -------------------------------------------------------------------------------- 1 | Let $A_{i}$ be the event that $i$ is never rolled for $1 \leq i \leq 6$. 2 | The event of interested then is $\bigcup\limits_{i=1}^{6}A_{i}.$ 3 | 4 | By inclusion-exclusion, 5 | $P(\bigcup\limits_{i=1}^{6}A_{i}) = \sum_{i=1}^{6}P(A_{i}) - 6 | \sum_{1 \leq i < j \leq 6}P(A_{i} \cap A_{j}) + 7 | \sum_{1 \leq i < j < k \leq 6}P(A_{i} \cap A_{j} \cap A_{k}) - 8 | \cdots - P(\bigcap\limits_{i=1}^{6}A_{i}).$ 9 | 10 | Now, 11 | 12 | 13 | $P(A_{i}) = \frac{5^{n}}{6^{n}} = (\frac{5}{6})^{n}$ 14 | 15 | $P(A_{i} \cap A_{j}) = \frac{4^{n}}{6^{n}} = (\frac{4}{6})^{n}$ 16 | 17 | $P(A_{i} \cap A_{j} \cap A_{k}) = \frac{3^{n}}{6^{n}} = (\frac{3}{6})^{n}$ 18 | 19 | $P(A_{i} \cap A_{j} \cap A_{k} \cap A_{w}) = \frac{2^{n}}{6^{n}} = 20 | (\frac{2}{6})^{n}$ 21 | 22 | $P(A_{i} \cap A_{j} \cap A_{k} \cap A_{w} \cap A_{z}) = \frac{1^{n}}{6^{n}} = 23 | (\frac{1}{6})^{n}$ 24 | 25 | $P(\bigcap\limits_{i=1}^{6}A_{i}) = 0$ 26 | 27 | Thus, 28 | $P(\bigcup\limits_{i=1}^{6}A_{i}) = 6(\frac{5}{6})^{n} - 29 | \binom{6}{2}(\frac{4}{6})^{n} + \binom{6}{3}(\frac{3}{6})^{n} - 30 | \binom{6}{4}(\frac{2}{6})^{n} + \binom{6}{5}(\frac{1}{6})^{n}$ -------------------------------------------------------------------------------- /src/chapters/3/sections/independence_of_rvs/problems/40.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item Suppose, toward a contradiction, that X and Y do not have the same PMF. Then there is at least one k in the support of X such that $P(X=k)$ and $P(Y=k)$ are not equal. 3 | \\ 4 | Note that if $P(X=Y)=1$, then $P(X=Y|X=k) = P(X=Y|Y=k) = P(X=k|Y=k) = P(Y=k | X=k) = 1$, as an event with probability 1 will still have probability 1 conditioned on any non-zero event. 5 | \\ 6 | Using the above and examining Bayes' theorem, we have $P(X=k|Y=k) = P(Y=k|X=k)*P(X=k)/P(Y=k)$, which simplifies to $1 = P(X=k)/P(Y=k)$ as the conditional probabilities equal 1 as previously shown. However, this equality is impossible if $P(X=k) =/= P(Y=k)$. This contradicts the assumption that $P(X=Y)=1$ - therefore, X and Y must have the same PMF if they are always equal. 7 | \\ 8 | \item Let X, Y be r.v.s with probability 1 of equalling 1, and probability 0 of equalling any other value. 9 | \\ 10 | Then for $x=y=1$ $P(X = x \wedge Y = y) = 1 = P(X=x)P(Y=y)$, and for all other possible pairs of values $x,y$, $P(X=x \wedge Y = y) = 0 = P(X=x)P(Y=y)$. Therefore, X, Y can be independent in this extreme case. 11 | \end{enumerate} 12 | -------------------------------------------------------------------------------- /src/chapters/2/sections/first-step_analysis_and_gamblers_ruin/problems/54.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item $p_{k} = pp_{k-1} + qp_{k+1}$ with boundary condition $p_{0}=1.$ 3 | 4 | \item Let $A_{j}$ be the event that the drunk reaches $k$ before reaching $-j$. 5 | Then, $A_{j} \subseteq A_{j+1}$ since to reach $-(j+1)$ the drunk needs to pass 6 | $-j$. Note that $\bigcup\limits_{j=1}^{\infty} A_{j}$ is equivalent to 7 | the event that the drunk ever reaches $k$, since the complement of this 8 | event, namely the event that the drunk reaches $-j$ before reaching $k$ 9 | for all $j$ implies that the drunk never has the time to reach $k$. 10 | 11 | By assumption, $P(\bigcup\limits_{j=1}^{\infty} A_{j}) = \lim_{n \to +\infty} 12 | P(A_{n}).$ $P(A_{n})$ can be found as a result of a gambler's ruin problem. 13 | 14 | If $p=\frac{1}{2}$, $$P(A_{n}) = \frac{n}{n + k} \rightarrow 1.$$ 15 | 16 | If $p > \frac{1}{2}$, $$P(A_{n}) = \frac{1 - \left(\frac{q}{p}\right)^{n}}{1 - 17 | \left(\frac{q}{p}\right)^{n + k}} \rightarrow 1.$$ 18 | 19 | If $p < \frac{1}{2}$, $$P(A_{n}) = \frac{1 - \left(\frac{q}{p}\right)^{n}}{1 - 20 | \left(\frac{q}{p}\right)^{n + k}} \rightarrow \left(\frac{p}{q}\right)^{k}.$$ 21 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/2/sections/monty_hall/problems/46.tex: -------------------------------------------------------------------------------- 1 | Let $S$ be the event of successfully getting the Car under the specified 2 | strategy. Let $C_{i}$ be the event that Door $i$ contains the Car. Let $A$ be 3 | the event that Monty reveals the Apple, and let $A_{i}$ be the event that Door 4 | $i$ contains the Apple. 5 | 6 | \begin{enumerate}[label=(\alph*)] 7 | \item 8 | \begin{align*} 9 | P(S) &= P(S \cap C_{1}) + P(S \cap C_{2}) + P(S \cap C_{3}) + P(S \cap C_{4}) \\ 10 | &= P(C_{1})P(S|C_{1}) + P(C_{2})P(S|C_{2}) + P(C_{3})P(S|C_{3}) + P(C_{4})P(S|C_ 11 | {4}) \\ 12 | &= \frac{1}{4}*0 + 3*\frac{1}{4}*(p+q)\frac{1}{2} \\ 13 | &= 3 * \frac{1}{4} * \frac{1}{2} \\ 14 | &= \frac{3}{8} 15 | \end{align*} 16 | 17 | \item 18 | \begin{align*} 19 | P(A) &= P(A \cap G_{1}) + P(A \cap A_{1}) + P(A \cap B_{1}) + P(A \cap C_{1}) \\ 20 | &= P(G_{1})P(A|G_{1}) + P(A_{1})P(A|A_{1}) + P(B_{1})P(A|B_{1}) + P(C_{1})P 21 | (A|C_{1}) \\ 22 | &= \frac{1}{4}p + 0 + \frac{1}{4}q + \frac{1}{4}q \\ 23 | &= \frac{1}{4}(1 + q) 24 | \end{align*} 25 | 26 | \item 27 | $$P(S|A) = \frac{P(S \cap A)}{P(A)} = 28 | \frac{\frac{1}{4}*p*\frac{1}{2} + \frac{1}{4}*q*\frac{1}{2}}{\frac{1}{4}(1 + 29 | q)} = \frac{\frac{1}{8}}{\frac{1}{4}(1 + q)}$$ 30 | 31 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/4/sections/expectations_and_variances/problems/16.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item From the student's perspective, the average class size is $\text{E}(X) 3 | = 4 | \frac{200}{360}100 + \frac{160}{360}10 = 60$. From the dean's perspective, the 5 | average class size is $\text{E}(X) = \frac{16}{18}10 + \frac{2}{18}100 = 6 | 20$. The discrepancy comes from the fact that when surveying the dean, there are 7 | only two data points with a large number of students. However, when surveying 8 | students, there are two hundred data points with a large number of students. 9 | In a sense, the student's perspective overcounts the classes. 10 | 11 | \item Let $C$ be a set of $n$ classes with $c_{i}$ students for $1 \leq i \leq 12 | n$. The dean's view of average class size then is $\text{E}(X) = \sum_{i=1}^ 13 | {n}\frac{c_{i}}{n}$. The students' view of average class size is $\text{E} 14 | (X) = \sum_{i=1}^{n}(c_{i}\frac{c_{i}}{\sum_{i=1}^{n}c_{i}})$. In the dean's 15 | perspective, all $c_{i}$ are equally weighted - $\frac{1}{n}$. However, in the 16 | students' perspective, weights scale with the size of the class. Thus, the 17 | students' perspective will always be larger than the dean's, unless all classes 18 | have the same number of students. 19 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/4/sections/indicator_r.v.s/problems/56.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item Let $I_{j}$ be the indicator variable for shots $j$ to $j+6$ being 3 | successful. The total number of succesful, consecutive, $7$ shots is $X = \sum_ 4 | {i=1}^{n-6}I_{j}$. Then, $$\text{E}(X) = \sum_{i=1}^{n-6}\text{E}(I_{j}) = \sum_ 5 | {i=1}^{n-6}P(I_{j}=1) = \sum_{i=1}^{n-6}p^{7} = (n-6)p^{7}$$ 6 | 7 | \item Thinking of each block of $7$ shots as a single trial with probability $p^ 8 | {7}$ of success, let $Y \sim \text{Geom}(p^{7})$ be the number of 9 | failed $7$-block shots taken until the first succesful $7$-shot block. Then, $$ 10 | \text{E}(X) = 7(1 + \text{E}(Y)) = 7 + \frac{7-7p^{7}}{p^{7}} = \frac{7p^{7} + 7 11 | - 7p^{7}}{p^{7}} = \frac{7}{p^{7}}$$ 12 | 13 | Note that it is possible that a consecutive sequence of 7 shots could happen "between" blocks - for example, this way of solving the problem does not consider the scenario where shots 2 to 8 are made. Therefore, the above calculation is a "worst case scenario" that assumes the consecutive 7 made shots must always happen in the last possible block - the actual number of blocks (and therefore shots) taken to make 7 consecutive shots is strictly less than or equal to the above calculated expectation. 14 | \end{enumerate} 15 | -------------------------------------------------------------------------------- /src/chapters/4/sections/mixed_practice/problems/92.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item Let $S$ be the sum of the ranks of the dishes we eat during both phases. 3 | $S = (m-k+1)X + \sum_{j=1}^{k-1}R_{j}$, where $R_{j}$ is the rank of dish $j$, 4 | excluding the highest ranked dish, from the exploration phase. Since $\text{E} 5 | (R_{j}) = \frac{(X-1)X}{2} \times \frac{\binom{X-2}{k-2}}{(k-1)\binom{X-1}{k-1}} 6 | = 7 | \frac{(X-1)X}{2} \times \frac{1}{X-1} = \frac{X}{2}$, $ 8 | \text{E}(S) = (m-k+1)\text{E}(X) + (k-1)\frac{\text{E}(X)}{2} = (m-k)\text{E} 9 | (X) + (k+1)\frac{\text{E}(X)}{2}.$ 10 | 11 | \item $P(X = x) = \frac{\binom{x-1}{k-1}}{\binom{n}{k}}.$ 12 | 13 | \item 14 | \begin{flalign} 15 | \text{E}(X) & = \frac{1}{\binom{n}{k}}\sum_{i=k}^{n}i\binom{i-1}{k-1} \nonumber \\ 16 | & = \frac{1}{\binom{n}{k}}\sum_{i=k}^{n}k\binom{i}{k} \nonumber \\ 17 | & = \frac{k}{\binom{n}{k}}\sum_ 18 | {i=k}^{n}\binom{i}{k} \nonumber \\ 19 | & = \frac{k}{\binom{n}{k}}\binom{n+1}{k+1} \nonumber \\ 20 | & = \frac{k(n+1)}{k+1} \nonumber 21 | \end{flalign} 22 | 23 | \item Plugging $\frac{k(n+1)}{k+1}$ into the result of part $b$ and derivating $ 24 | (m-k)\frac{k(n+1)}{k+1} + k\frac{n+1}{2}$ with respect to $k$ 25 | provides an extremum of $k = \sqrt{2(m+1)} - 1$. 26 | 27 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/4/sections/expectations_and_variances/problems/8.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item Let $C_{i}$ be the population of the $i$-th city, such that the first four 3 | cities are in the Northern region, the next three cities are in the Eastern 4 | region, the next two cities are in the Southern region, and the last city is in 5 | the Western region. 6 | 7 | Let $C$ be the population of a randomly chosen city. 8 | 9 | Then $\text{E}(C) = \frac{1}{10}\sum_{i=1}^{10}C_{i} = 2 \text{million}.$ 10 | 11 | \item $\text{Var}(C) = \text{E}(C^{2}) - (\text{E}(C))^{2}$. $\text{E}(C^{2})$ 12 | can not be computed without the knowledge of population sizes of individual 13 | cities. 14 | 15 | \item $\text{Var}(C) = \frac{1}{4}(\frac{1}{4}3 \text{million} + \frac{1}{3}4 16 | \text{million} + \frac{1}{2}5 \text{million} + 8 \text{million}) \approx 3 17 | \text{million}$ 18 | 19 | \item Since regions with smaller population have more cities, if a city is 20 | randomly selected, it is more likely that the city belongs to a low population 21 | region. On the other hand, if a region is selected uniformly at random first, 22 | then a randomly selected city is as likely to belong to a region with a large 23 | population as it is to belong to a region with a smaller population. 24 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/2/sections/mixed_problems/problems/61.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item 3 | \begin{align*} 4 | P(D|\bigcap\limits^n_{i=1}T_{i}) &= \frac{P(D)P(\bigcap\limits^n_{i=1}T_{i}|D)} 5 | {P(\bigcap\limits^n_{i=1}T_{i})} \\ 6 | &= \frac{p\prod_{i=1}^{n} a}{p\prod_{i=1}^{n} a + q\prod_{i=1}^{n} b} \\ 7 | &= \frac{pa^{n}}{pa^{n} + qb^{n}} 8 | \end{align*} 9 | 10 | \item 11 | \begin{align*} 12 | P(D|\bigcap\limits^n_{i=1}T_{i}) &= \frac{P(D)P(\bigcap\limits^n_{i=1}T_{i}|D)} 13 | {P(\bigcap\limits^n_{i=1}T_{i})} \\ 14 | &= \frac{p(P(G)P(\bigcap\limits^n_{i=1}T_{i}|D, G) + P(G^{c})P(\bigcap\limits^n_ 15 | {i=1}T_{i}|D, G^{c}))}{P(\bigcap\limits^n_{i=1}T_{i})} \\ 16 | &= \frac{p(\frac{1}{2} + \frac{1}{2}a_{0}^{n})}{P(G)P(\bigcap\limits^n_ 17 | {i=1}T_{i}|G) + P(G^{c})P(\bigcap\limits^n_{i=1}T_{i}|G^{c})} \\ 18 | &= \frac{p(\frac{1}{2} + \frac{1}{2}a_{0}^{n})}{P(G)(P(D|G)P(\bigcap\limits^n_ 19 | {i=1}T_{i}|D, G) + P(D^{c}|G)P(\bigcap\limits^n_{i=1}T_{i}|D^{c}, G)) + P(G^{c}) 20 | (P(D|G^{c})P(\bigcap\limits^n_{i=1}T_{i}|D, G^{c}) + P(D^{c}|G^{c})P 21 | (\bigcap\limits^n_{i=1}T_{i}|D^{c}, G^{c}))} \\ 22 | &= \frac{p(\frac{1}{2} + \frac{1}{2}a_{0}^{n})}{\frac{1}{2} + \frac{1}{2}(pa_ 23 | {0}^{n} + (1-p)b_{0}^{n})} \\ 24 | &= \frac{p(1 + a_{0}^{n})}{1 + pa_{0}^{n} + (1-p)b_{0}^{n}} 25 | \end{align*} 26 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/1/sections/naive_definition_of_probability/problems/32.tex: -------------------------------------------------------------------------------- 1 | Call the two black cards $B_{1}, B_{2}$ and the two red cards $R_{1}, R_{2}$. 2 | Since every configuration of the $4$ cards is equally likely, each outcome has 3 | a probability of $\frac{1}{24}$ of occurance. 4 | 5 | Case 1: $j = 0$. 6 | 7 | If both guesses are incorrect, then both of them are black cards. There are 8 | two choices for the configuration of the black cards and for each, there are 9 | two choices for the configuration of the red cards for a total of $4$ possibilities. 10 | 11 | $$P(j=0) = \frac{4}{24} = \frac{1}{6}$$ 12 | 13 | Case 2: $j = 4$ 14 | 15 | Notice that to guess all the cards correctly, we only need to guess correctly 16 | the two red cards, which, by symmetry, is as likely as guessing both of them wrong. 17 | 18 | Hence, $$P(j=4) = P(j=0) = \frac{1}{6}$$ 19 | 20 | Case 3: $j=2$ 21 | 22 | One of the guesses is red the other is black. Like before, there are two 23 | choices for the red and two choices for the black cards. This undercounts the 24 | possibilities by a factor of 2, since we can switch the places of the red and 25 | the black cards. Hence, $$P(j=2) = \frac{2}{6} + \frac{2}{6} = \frac{2}{3}$$ 26 | 27 | Notice that getting both right, none right and one right are all the possible 28 | outcomes. Hence, $$P(j=1) = P(j=3) = 0$$ 29 | -------------------------------------------------------------------------------- /src/chapters/2/sections/conditioning_on_evidence/index.tex: -------------------------------------------------------------------------------- 1 | \section{Conditioning On Evidence} 2 | 3 | \subsection{problem 3} 4 | \input{problems/3} 5 | 6 | \subsection{problem 4} 7 | \input{problems/4} 8 | 9 | \subsection{problem 5} 10 | \input{problems/5} 11 | 12 | \subsection{problem 6} 13 | \input{problems/6} 14 | 15 | \subsection{problem 7} 16 | \input{problems/7} 17 | 18 | \subsection{problem 8} 19 | \input{problems/8} 20 | 21 | \subsection{problem 9} 22 | \input{problems/9} 23 | 24 | \subsection{problem 10} 25 | \input{problems/10} 26 | 27 | \subsection{problem 11} 28 | \input{problems/11} 29 | 30 | \subsection{problem 12} 31 | \input{problems/12} 32 | 33 | \subsection{problem 13} 34 | \input{problems/13} 35 | 36 | \subsection{problem 14} 37 | \input{problems/14} 38 | 39 | \subsection{problem 15} 40 | \input{problems/15} 41 | 42 | \subsection{problem 16} 43 | \input{problems/16} 44 | 45 | \subsection{problem 17} 46 | \input{problems/17} 47 | 48 | \subsection{problem 18} 49 | \input{problems/18} 50 | 51 | \subsection{problem 19} 52 | \input{problems/19} 53 | 54 | \subsection{problem 20} 55 | \input{problems/20} 56 | 57 | \subsection{problem 21} 58 | \input{problems/21} 59 | 60 | \subsection{problem 27} 61 | \input{problems/27} 62 | 63 | \subsection{problem 28} 64 | \input{problems/28} 65 | 66 | \subsection{problem 29} 67 | \input{problems/29} -------------------------------------------------------------------------------- /src/chapters/4/sections/mixed_practice/problems/79.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item Let $X \sim FS(\frac{1}{m})$ be the number of guesses made by the hacker. 3 | Then, $\text{E}(X) = m$. 4 | 5 | \item Suppose $w_{1}, w_{2}, w_{3}, \dots, w_{m}$ is the sequence of passwords 6 | sampled by the hacker. Since, every permutation of the $m$ words is equally 7 | likely, the probability that the correct password is $w_{i}$ is $\frac{(m-1)!} 8 | {m!} = \frac{1}{m}$. Then $\text{E}(X) = \frac{1}{m}\sum_{i=1}^{m}i = \frac{1} 9 | {m}\frac{m(m+1)}{2} = \frac{m+1}{2}$. 10 | 11 | \item Both $m$ and $\frac{m+1}{2}$ are positively sloped lines, intersecting at 12 | $m=1$. For $m=2$, $m > \frac{m+1}{2}$. Thus, $m > \frac{m+1}{2}$ for all $m > 13 | 1$. This makes intuitive sense since when the hacker samples passwords without 14 | replacement, the number of possible passwords reduces. 15 | 16 | \item With replacement, $P(X = k) = (\frac{m-1}{m})^{k-1}\frac{1}{m}$ for $1 17 | \leq k < n$ and $P(X=n) = (\frac{m-1}{m})^{n-1}\frac{1}{m} + (\frac{m-1}{m})^ 18 | {n}$. 19 | 20 | In the case of sampling without replacement, since all orderings of the passwords 21 | sampled by the hacker are equally likely, $P(\text{hacker samples k passwords}) 22 | = \frac{1}{m}$ for $1 \leq k < n$, and $P(\text{hacker samples n passwords}) = 23 | \frac{1}{m} + \frac{m-n}{m}$. 24 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/2/sections/mixed_problems/problems/64.tex: -------------------------------------------------------------------------------- 1 | Let $R_{i}$, $G_{i}$, and $B_{i}$ be the events that the $i$-th drawn ball is 2 | red, green or blue respectively. Let $A$ be the event that a green ball is drawn 3 | before a blue ball. 4 | 5 | \begin{enumerate}[label=(\alph*)] 6 | \item 7 | 8 | Note that if a red ball is drawn, it is placed back, as if the experiment never 9 | happened. Draws continue until a green or a blue ball is drawn. The red 10 | balls are irrelevant in the experiment. Thus, the problem reduces to removing 11 | all the red balls, and finding the probability of the first, randomly drawn ball 12 | being green. 13 | \begin{align*} 14 | P(A) &= P(R_{1})P(A|R_{1}) + P(R_{1}^{c})P(A|R_{1}^{c}) \\ 15 | &= rP(A) + (g + b)\frac{g}{g + b} \\ 16 | &= rP(A) + g 17 | \end{align*} 18 | 19 | Thus, $$P(A) = \frac{g}{1-r} = \frac{g}{g + b}.$$ 20 | 21 | \item We are interested in draws in which the first ball is green. Each 22 | completed sequence of $g+b+r$ draws is equally likely. Since the red balls are 23 | once again irrelevant, we focus on the $g+b$ draws of green or blue balls. 24 | 25 | Thus, 26 | 27 | $$P(A) = \frac{\binom{g+b-1}{g-1}}{\binom{g+b}{g}} = \frac{g}{g+b}.$$ 28 | 29 | \item Let $A_{i,j}$ be the event that type $i$ occurs before type 30 | $j$. Generalizing part $a$, we get 31 | $$P(A_{i,j}) = \frac{p_{i}}{p_{i}+p_{j}}.$$ 32 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/2/sections/mixed_problems/problems/70.tex: -------------------------------------------------------------------------------- 1 | Let $F$ be the event that the coin is fair, and let $H_{i}$ be the even that the 2 | $i$-th toss lands Heads. 3 | 4 | \begin{enumerate}[label=(\alph*)] 5 | \item Both Fred and his friend are correct. Fred is correct in that the 6 | probability of there being no Heads in the entire sequence is very small. For 7 | example, there are $\binom{92}{45}$ sequences with $45$ Heads and $47$ Tails, 8 | but only $1$ sequence of all Heads. 9 | 10 | On the other hand, Fred's friend is correct in his assessment that any 11 | particular sequence has the same likelihood of occurance as any other sequence. 12 | 13 | \item 14 | $$P(F|H_{1 \leq i \leq 92}) = \frac{P(F)P(H_{1 \leq i \leq 92}|F)}{P(F)P(H_{1 15 | \leq i \leq 92}|F) + P(F^{c})P(H_{1\leq i \leq 92}|F^{c})} = \frac{p\left 16 | (\frac{1}{2}\right)^{92}}{p\left(\frac{1}{2}\right)^{92} + (1-p)}$$ 17 | 18 | \item For $P(F|H_{1 \leq i \leq 92})$ to be larger than $\frac{1}{2}$, $p$ must be 19 | greater than $\frac{2^{92}}{2^{92} + 1}$, which is approximately equal to $1$, 20 | where as for $P(F|H_{1 \leq i \leq 92})$ to be less than $\frac{1}{20}$, $p$ 21 | must be less than $\frac{2^{92}}{2^{92} + 19}$, which is also approximately 22 | equal to $1$. In other words, unless we know for a fact that the coin is fair, 23 | $92$ Heads in a row will convince us otherwise. 24 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/3/sections/mixed_practice/problems/47.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | 3 | \item 4 | Consider the simple case of $m < \frac{n}{2}$. Then, the trays don't have enough 5 | pages to print $n$ copies. Desired probability is $0$. 6 | 7 | On the other hand, if $m \geq n$, then desired probability is $1$, since each 8 | tray individually has enough pages. 9 | 10 | Now, consider the more interesting case that $\frac{n}{2} \leq m < n$. 11 | Associate $n$ pages being taken from the trays with $n$ independent Bernoulli 12 | trials. Sample from the first tray on success, and sample from the second tray 13 | on failure. Thus, the assignment of trays can be modeled as a Binomial random 14 | variable, $X \sim $ Bin$(n, p)$. As long as not too few pages are sampled from 15 | the first tray, the remaining pages can be sampled from the second tray. What is 16 | too few? $n-m-1$ is too few, because $n-m-1 + m < n$. 17 | 18 | Hence, 19 | 20 | \[ P = \begin{cases} 21 | 0 & m < \frac{n}{2} \\ 22 | pbinom(m,n,p) - pbinom(n-m-1,n,p) & \frac{n}{2} \leq m < n \\ 23 | 1 & m \geq n 24 | \end{cases} 25 | \] 26 | 27 | \item Typing out the hinted program in the R language, we get that the smallest 28 | number of papers in each tray needed to have $95$ percent confidence that there 29 | will be enough papers to make $100$ copies is $60$. 30 | 31 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/5/sections/mixed_practice/problems/62.tex: -------------------------------------------------------------------------------- 1 | (a) 2 | \begin{equation} 3 | I_k = 4 | \begin{cases} 5 | 1 & \text{if k sets a low or high record}\\ 6 | 0 & \text{if k doesn't set a low or high record} 7 | \end{cases} 8 | \end{equation} 9 | 10 | \[P(I_1) = 1\] 11 | \[P(I_2) = 1\] 12 | \[P(I_3) = \frac{2}{3}\] 13 | \[P(I_4) = \frac{2}{4}\] 14 | and so on. 15 | 16 | Now \(I = I_1 + \dots + I_n \)\\ 17 | \(\mathbb{E}[I] = 1 + 1 + \frac{2}{3} \cdots \frac{2}{100}\) \\ 18 | 19 | (b) 20 | \begin{equation} 21 | I_k = 22 | \begin{cases} 23 | 1 & \text{if k sets a low followed by a high }\\ 24 | 0 & \text{otherwise} 25 | \end{cases} 26 | \end{equation} 27 | 28 | \[P(I_k) = \frac{1}{k} \frac{1}{k+1}\] 29 | 30 | Now \(I = I_1 + \dots + I_n \)\\ 31 | \(\mathbb{E}[I] = \frac{1}{1 \cdot 2} + \cdots + \frac{1}{100 \cdot 101}\) \\ 32 | \(\mathbb{E}[I] = 1 - \frac{1}{101}\)\\ 33 | 34 | (c) 35 | \begin{flalign} 36 | P(N > n) & = P(\text{all of 2 to n + 1 fall short of 1}) \\ 37 | & = \frac{1}{n + 1} 38 | \end{flalign} 39 | 40 | \begin{flalign} 41 | P(N = n) & = P(N > n - 1) - P(N > n) \\ 42 | & = \frac{1}{n(n+1)} 43 | \end{flalign} 44 | 45 | (d) 46 | \begin{flalign} 47 | \mathbb{E}[N] & = \sum_{i = 1}^{\infty} i P(N = i) \\ 48 | & = \sum_{1}^{\infty} \frac{1}{i + 1} 49 | \end{flalign} 50 | 51 | 52 | is unbounded. 53 | -------------------------------------------------------------------------------- /src/chapters/1/sections/axioms_of_probability/problems/47.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item Consider the experiment of flipping a fair coin twice. 3 | The sample space $S$ is $\{HH, HT, TH, TT\}.$ 4 | Let $A$ be the event that the first flip lands heads and $B$ be the event 5 | that the second flip lands heads. 6 | $P(A \cap B) = \frac{1}{4}$ since $A \cap B$ corresponds to the outcome $HH$. 7 | 8 | On the other hand, $A$ corresponds to the outcomes $\{HH, HT\}$ 9 | and $B$ corresponds to the outcomes $\{HH, TH\}$. Thus, 10 | $P(A) = P(B) = \frac{1}{2}.$ 11 | 12 | Since $P(A \cap B) = P(A)P(B),$ $A$ and $B$ are independent events. 13 | 14 | \item $A_{1}$ and $B_{1}$ should intersect such that the ratio of 15 | the area of $A_{1} \cap B_{1}$ to the area of $A_{1}$ equals the ratio of 16 | the area of $B_{1}$ to the area of $R$. 17 | 18 | As a simple, extreme case, if $A_{1} = B_{1},$ then $A$ and $B$ are dependent, 19 | since the condition above is violated. 20 | 21 | \item 22 | \begin{flalign} 23 | P(A \cup B) & = P(A) + P(B) - P(A \cap B) \nonumber && \\ 24 | & = P(A) + P(B) - P(A)P(B) \nonumber && \\ 25 | & = P(A)(1 - P(B)) + P(B) \nonumber && \\ 26 | & = P(A)P(B^{c}) + P(B) \nonumber && \\ 27 | & = P(A)P(B^{c}) + 1 - P(B^{c}) \nonumber && \\ 28 | & = 1 + P(B^{c})(P(A) - 1) \nonumber && \\ 29 | & = 1 - P(B^{c})P(A^{c}) \nonumber 30 | \end{flalign} 31 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/3/sections/named_distributions/problems/30.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item The distribution is hypergeometric. We select a sample of $t$ employees 3 | and count the number of women in the sample. 4 | 5 | $$P(X = k) = \frac{\binom{n}{k}\binom{m}{t-k}}{\binom{n+m}{t}}$$ 6 | 7 | \item Decisions to be promoted or not are independent from employee to employee. 8 | Thus, we are dealing with Binomial distributions. 9 | 10 | Let $X$ be the number of women who are promoted. Then, $P(X=k) = \binom{n}{k}p^ 11 | {k}(1-p)^{n-k}$. The number of women who are not promoted is $Y=n-X$ and so is 12 | also Binomial. 13 | 14 | Distribution of the number of employees who are promoted is also Binomial, since 15 | each employee is equally likely to be promoted and promotions are independent of 16 | each other. 17 | 18 | \item Once the total number of promotions is fixed, they are no longer 19 | independent. For instance, if the first $t$ people are promoted, the 20 | probability of the $t+1$-st person being promoted is $0$. 21 | 22 | The story fits that of the hypergeometric distribution. $t$ promoted 23 | employees 24 | are picked and we count the number of women among them. 25 | 26 | $$P(X = k | T = t) = \frac{\binom{n}{k}p^ 27 | {k}(1-p)^{n-k}\binom{m}{t-k}p^ 28 | {t-k}(1-p)^{m-t+k}}{\binom{n+m}{t}p^{t}(1-p)^{n+m-t}} = \frac{\binom{n}{k} 29 | \binom{m}{t-k}}{\binom{n+m}{t}}$$ 30 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/2/sections/monty_hall/problems/42.tex: -------------------------------------------------------------------------------- 1 | Let $G_{i}$ be the event that the $i$-th door contains a goat, and let 2 | $D_{i}$ be the event that Monty opens door $i$. 3 | 4 | Let $S$ be the event of success under the specified strategy. 5 | 6 | \begin{enumerate}[label=(\alph*)] 7 | \item 8 | \begin{align*} 9 | P(S) &= P(G_{1})P(S|G_{1}) + P(G_{1}^{c})P(S|G_{1}^{c}) \\ 10 | &= \frac{2}{3}p + 0 \\ 11 | &= \frac{2}{3}p. 12 | \end{align*} 13 | 14 | Note that when $p=1$, the problem reduces to the basic Monty Hall problem, 15 | and we get the correct solution $\frac{2}{3}$. In the case when $p=0$, Monty 16 | never gives the contestant a chance to switch their initial, incorrect choice to 17 | the correct one, resulting in a definite failure under the specified strategy. 18 | 19 | \item 20 | \begin{align*} 21 | P(G_{1}|D_{2}) &= \frac{P(G_{1})P(D_{2}|G_{1})}{P(D_{2})} \\ 22 | &= \frac{P(G_{1})P(D_{2}|G_{1})}{P(G_{1})P(D_{2}|G_{1}) + P(G_{1}^{c})P(D_{2}|G_ 23 | {1}^{c})} \\ 24 | &= \frac{\frac{2}{6}p}{\frac{2}{6}p + \frac{1}{6}} \\ 25 | &= \frac{2p}{2p+1}. 26 | \end{align*} 27 | 28 | Note that if $p=1$, the problem reduces to the basic Monty Hall problem, 29 | and the solution matches that of the basic, conditional Monty Hall problem. 30 | If $p=0$ on the other hand, then the reason Monty has opened a door is 31 | because the contestant's initial guess (Door $1$) is correct. By choosing the 32 | strategy to switch, the contestant always loses. 33 | \end{enumerate} 34 | 35 | -------------------------------------------------------------------------------- /src/chapters/5/sections/uniform_and_universality/problems/13.tex: -------------------------------------------------------------------------------- 1 | Recall from problem 12 that the CDF of Y, the length of the longer piece, is \(F(k) = 2k-1\). 2 | 3 | a. Let us find the CDF of \(X/Y\). 4 | 5 | \[P(X/Y < k) = P(\frac{1-Y}{Y} < k )= P(Y>\frac{1}{k+1}) = 1 - (\frac{2}{k+1} - 1) = \frac{2k}{k+1}\] 6 | 7 | To find the PDF, we derive the CDF using the quotient rule: 8 | 9 | \[\frac{d}{dk}(\frac{2k}{k+1}) = 2(k+1)^{-2}\] 10 | 11 | b. Note that \(X/Y\) is minimized at when X is 0 and Y is 1 and maximized at 1 when X and Y are both 1/2. So, to find \(E(X/Y)\), we must find \(\int_{0}^{1}2k(k+1)^{-2}dk\). This can be done with integration by parts, factoring out the constant 2, with \(u = k\), \(dv = (k+1)^{-2}dk\), \(du = 1\), and \(v = -(k+1)^{-1}\): 12 | 13 | \[\int_{0}^{1}2k(k+1)^{-2}dk = 2((\frac{-k}{k+1})|^{1}_{0} - \int_{0}^{1}-(k+1)^{-1}dk) =2(-\frac{1}{2} + ln(2)) = 2ln(2)-1 \] 14 | 15 | c. Following similar steps as in part A, the CDF of \(Y/X\) is \(P(\frac{Y}{1-Y} P(A|B^{c}).$ 26 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/2/sections/conditioning_on_evidence/problems/13.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | 3 | \item Let $B$ be the event that the test done by company $B$ is successfull. 4 | Let $A$ be the event that the test done by company $A$ is successfull. 5 | Let $D$ be the event that a random person has the disease. 6 | 7 | \begin{flalign} 8 | P(B) & = P(D)P(B|D) + P(D^{c})P(B|D^{c}) \nonumber \\ 9 | & = 0.01 * 0 + 0.99 * 1 \nonumber \\ 10 | & = 0.99 \nonumber 11 | \end{flalign} 12 | 13 | \begin{flalign} 14 | P(A) & = P(D)P(A|D) + P(D^{c})P(A|D^{c}) \nonumber \\ 15 | & = 0.01 * 0.95 + 0.99 * 0.95 \nonumber \\ 16 | & = 0.95 \nonumber 17 | \end{flalign} 18 | 19 | Thus, $P(B) > P(A)$. 20 | 21 | \item Since the disease is so rare, most people don't have it. 22 | Company $B$ diagnoses them correctly every time. However, in the rare cases 23 | when a person has the disease, company $B$ fails to diagnose them correctly. 24 | Company $A$ however shows a very good probability of an accurate diagnoses 25 | for afflicted patients. 26 | 27 | \item If the test conducted by company $A$ has equal specifity and sensitivity, 28 | then it's accuracy surpasses that of company $B$'s test if the specifity and the 29 | sensitivity are larger than $0.99$. If company $A$ manages to achieve a specifity 30 | of $1$, then any positive sensitivity will result in a more accurate test. 31 | If company $A$ achieves a sensitivity of $1$, it still requires a specificity 32 | larger than $0.98$, since positive cases are so rare. 33 | \end{enumerate} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ![workflow status](https://github.com/fifthist/Introduction-To-Probability-Blitzstein-Solutions/actions/workflows/makefile.yml/badge.svg) 3 | Contributed solutions to end of chapter exercises in Introduction to Probability, 2nd edition by Joe Blitzstein and Jessica Hwang. 4 | 5 | The book contains many fantastic exercises that help develop intuition for thinking probabilistically. The authors provide solutions to some of these exercises on the book [website](https://projects.iq.harvard.edu/stat110/home), but most don't have published solutions. This repository aims to provide solutions for self-learners. 6 | 7 |

8 | Solutions » 9 |

10 | 11 | 12 | ## How to Contribute 13 | 14 | 1. If adding a new chapter, add a reference entry to `chapters/index.tex` 15 | ``` 16 | \subimport*{chapters/[chapter number]/}{index} 17 | ``` 18 | 2. If adding a new section, add a reference entry to `chapters/[chapter number]/sections/index.tex` 19 | ``` 20 | \subimport*{sections/[section name]/}{index} 21 | ``` 22 | 3. Solution files are named `[problem number].tex` and placed in the `chapters/[chapter number]/sections/[section name]/problems` directory. 23 | 4. An entry for the new solution file is added to `chapters/[chapter number]/sections/[section name]/index.tex` 24 | ``` 25 | \subsection{problem [problem number]} 26 | \input{problems/[problem number]} 27 | ``` 28 | 29 | -------------------------------------------------------------------------------- /src/chapters/3/sections/named_distributions/problems/24.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item Since tosses are independent, we expect information about two of the 3 | tosses to not provide any information about the remaining tosses. In other 4 | words, we expect the required probability to be 5 | 6 | $$\binom{8}{k}(0.5)^{k}(0.5)^{8-k} = \binom{8}{k}(0.5)^{8}$$ 7 | for $0 \leq k \leq 8$. 8 | 9 | To prove this, let $X$ be the number of Heads out of the $10$ tosses, and let 10 | $X_{1, 2}$ be the number of Heads out of the first two tosses. 11 | 12 | \begin{flalign} 13 | P(X = k | X_{1, 2} = 2) & = \frac{P(X = k \cap X_{1, 2} = 2)}{P(X_{1, 2} = 2)} 14 | \nonumber && \\ 15 | & = \frac{(0.5)^{2}\binom{8}{k-2}(0.5)^{k-2}(0.5)^{8-k+2}}{(0.5)^{2}} 16 | \nonumber && \\ 17 | & = \binom{8}{k-2}(0.5)^{k-2}(0.5)^{8-k+2} \nonumber && \\ 18 | & = \binom{8}{k-2}(0.5)^{8} \nonumber 19 | \end{flalign} 20 | 21 | 22 | for $2 \leq k \leq 10$, which is equivalent to $\binom{8}{k}(0.5)^{8}$ for 23 | $0 \leq k \leq 8$. 24 | 25 | \item Let $X_{\geq 2}$ be the event that at least two tosses land Heads. 26 | 27 | \begin{flalign} 28 | P(X = k | X_{\geq 2}) & = \frac{P(X = k \cap X_{\geq 2})}{X_{\geq 2}} 29 | \nonumber && \\ 30 | & = \frac{\binom{10}{k}(0.5)^{k}(0.5)^{10-k}}{1 - (0.5^{10} + 31 | 10*0.5^{10})} \nonumber 32 | \end{flalign} 33 | 34 | for $2 \leq k \leq 10$. 35 | 36 | To see that this answer makes sense, notice that if we over all values of $k$ 37 | from $2$ to $10$, we get exactly the denominator, which means the said sum 38 | equals to $1$. 39 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/5/sections/mixed_practice/problems/52.tex: -------------------------------------------------------------------------------- 1 | a. From the definition of expectation 2 | 3 | $$ 4 | \mathbb{E}[X] = \int_{-\infty}^\infty x f(x) dx = \int_0^\infty x^2 e^{-x^2/2} dx 5 | $$ 6 | 7 | The integral in the above equation is similar to the integral that arises when calculating the second moment of a standard Normal distribution. 8 | Let $Z \sim \mathcal{N}(0,1)$, with PDF $\varphi$. 9 | We know that $\mathbb{E}[Z]=0$ and $\mathrm{Var}(Z)=1$. 10 | From the definition of variance, 11 | 12 | $$ 13 | \mathrm{Var}(Z) = \mathbb{E}[Z^2] - (\mathbb{E}[Z])^2 = \mathbb{E}[Z^2] - 0 = 1 14 | $$ 15 | 16 | $$ 17 | \mathbb{E}[Z^2] 18 | = \int_{-\infty}^\infty z^2 \varphi(z) dz 19 | = \int_{-\infty}^\infty z^2 \frac{1}{\sqrt{2\pi}} e^{-z^2/2} dz 20 | = 1 21 | $$ 22 | 23 | $$ 24 | \int_{-\infty}^\infty z^2 e^{-z^2/2} dz = \sqrt{2\pi} 25 | $$ 26 | 27 | Since the integrand is an even function, the integral in $(0,\infty)$ is half this value. Therefore, 28 | 29 | $$ 30 | \mathbb{E}[X] = \frac{\sqrt{2\pi}}{2} = \sqrt{\frac{\pi}{2}} 31 | $$ \\ 32 | 33 | 34 | b. 35 | 36 | \begin{flalign*} 37 | \mathbb{E}[X^2] & = \int_{0}^{\infty} x^2 f(x) dx \\ 38 | & = \int_{0}^{\infty} x^3 e^{-\frac{x^2}{2}} dx \\ 39 | & = \int_{0}^{\infty} 2 u e^{-u} du \\ 40 | \end{flalign*} 41 | 42 | The last integral is similar to the integral that arises when calculating the expected value of $Y \sim \mathrm{Expo}(1)$. 43 | We know that $\mathbb{E}[Y] = 1$, 44 | 45 | $$ 46 | \mathbb{E}[Y] = \int_0^\infty y e^{-y} dy = 1 47 | $$ 48 | 49 | It then follows that $\mathbb{E}[X^2] = 2$ 50 | -------------------------------------------------------------------------------- /src/chapters/2/sections/monty_hall/problems/43.tex: -------------------------------------------------------------------------------- 1 | Let $C_{i}$ be the event that Door $i$ contains the car. Let $D_{i}$ be the 2 | event that Monty opens Door $i$. Let $O_{i}$ be the event that Door $i$ 3 | contains the computer, and let $G_{i}$ be the event that Door $i$ contains the 4 | goat. 5 | 6 | \begin{enumerate}[label=(\alph*)] 7 | \item 8 | \begin{align*} 9 | P(C_{3}|D_{2}, G_{2}) &= \frac{P(C_{3})P(D_{2}, G_{2}|C_{3})}{P(D_{2}, G_{2})} 10 | \\ 11 | &= \frac{P(C_{3})P(D_{2}, G_{2}|C_{3})}{P(C_{3})P(D_{2}, G_{2}|C_{3}) + P(C_{3}^ 12 | {c})P(D_{2}, G_{2}|C_{3}^{c})} \\ 13 | &= \frac{\frac{1}{3}*\frac{1}{2}}{\frac{1}{3}*\frac{1}{2} + \frac{2}{3}P(G_ 14 | {2}|C_{3}^{c})P(D_{2}|G_{2}, C_{3}^{c})} \\ 15 | &= \frac{\frac{1}{3}*\frac{1}{2}}{\frac{1}{3}*\frac{1}{2} + \frac{2}{3}*\frac{1} 16 | {4}} \\ 17 | &= \frac{\frac{1}{6}}{\frac{1}{6} + \frac{1}{6}} \\ 18 | &= \frac{1}{2}. 19 | \end{align*} 20 | 21 | \item 22 | \begin{align*} 23 | P(C_{3}|D_{2}, O_{2}) &= \frac{P(C_{3})P(D_{2}, O_{2} | C_{3})}{P(C_{3})P(D_{2}, 24 | O_{2} | C_{3}) + P(C_{3}^{c})P(D_{2}, O_{2} | C_{3}^{c})} \\ 25 | &= \frac{P(C_{3})P(D_{2}, O_{2} | C_{3})}{P(C_{3})P(D_{2}, O_{2} | C_{3}) + P(C_ 26 | {3}^{c})P(D_{2}, O_{2} | C_{3}^{c})} \\ 27 | &= \frac{\frac{1}{3}P(O_{2}|C_{3})P(D_{2}|O_{2}, C_{3})}{\frac{1}{3}P(O_{2}|C_ 28 | {3})P(D_{2}|O_{2}, C_{3}) + P(C_{3}^{c})P(D_{2}, O_{2} | C_{3}^{c})} \\ 29 | &= \frac{\frac{1}{3}*\frac{1}{2}*p}{\frac{1}{3}*\frac{1}{2}*p + \frac{2} 30 | {3}*\frac{1}{4}*q} \\ 31 | &= \frac{\frac{1}{6}p}{\frac{1}{6}p + \frac{1}{6}q} \\ 32 | &= \frac{p}{p+(1-p)} \\ 33 | &= p. 34 | \end{align*} 35 | \end{enumerate} 36 | -------------------------------------------------------------------------------- /src/chapters/5/sections/normal/problems/20.tex: -------------------------------------------------------------------------------- 1 | (a) 2 | \begin{equation*} 3 | \begin{split} 4 | \Phi(z) 5 | &= \frac{1}{\sqrt{2\pi}} \int_{-\infty}^z e^{-x^2/2} dx \\ 6 | &= \frac{1}{\sqrt{2\pi}} \left( \int_{-\infty}^0 e^{-x^2/2} dx + \int_0^z e^{-x^2/2} dx \right) 7 | \end{split} 8 | \end{equation*} 9 | 10 | We know from the Normal PDF that $\int_{-\infty}^{\infty} e^{-x^2/2} dx = \sqrt{2\pi}$. Since the integrand is an even function, the integral from $-\infty$ to $0$ is half this value 11 | 12 | $$ 13 | \Phi(z) = \frac{1}{2} + \frac{1}{\sqrt{2\pi}} \int_0^z e^{-x^2/2} dx 14 | $$ 15 | 16 | By applying the variable substitution $u = x/\sqrt{2}$ in the integral, we obtain $du = dx/\sqrt{2}$. The lower and upper limits of integration become $0$ and $z/\sqrt{2}$, respectively. 17 | 18 | \begin{equation*} 19 | \begin{split} 20 | \Phi(z) 21 | &= \frac{1}{2} + \frac{1}{\sqrt{2\pi}} \int_0^{z/\sqrt{2}} e^{-u^2} \sqrt{2} \, du \\ 22 | &= \frac{1}{2} + \frac{1}{2} \frac{2}{\sqrt{\pi}} \int_0^{z/\sqrt{2}} e^{-u^2} du 23 | \end{split} 24 | \end{equation*} 25 | 26 | $$ 27 | \Phi(z) = \frac{1}{2} + \frac{1}{2} \, \mathrm{erf} \left( \frac{z}{\sqrt{2}} \right) 28 | $$ 29 | 30 | 31 | (b) 32 | $$ 33 | \mathrm{erf}(z) = \frac{2}{\sqrt{\pi}} \int_0^z e^{-x^2} dx 34 | $$ 35 | 36 | The integrand is an even function, so the integrals from 0 to $z$ and from $-z$ to 0 are the same 37 | 38 | \begin{equation*} 39 | \begin{split} 40 | \mathrm{erf}(z) 41 | &= \frac{2}{\sqrt{\pi}} \int_{-z}^0 e^{-x^2} dx \\ 42 | &= - \frac{2}{\sqrt{\pi}} \int_0^{-z} e^{-x^2} dx 43 | \end{split} 44 | \end{equation*} 45 | 46 | $$ 47 | \mathrm{erf}(-z) = -\mathrm{erf}(z) 48 | $$ 49 | -------------------------------------------------------------------------------- /src/chapters/5/sections/pdfs_and_cdfs/problems/6.tex: -------------------------------------------------------------------------------- 1 | a. For \(X \sim Unif(0,1)\), \(F(k) = k\) for \(0 1/2\). Since \(\Phi\) is an increasing function and equals 1/2 when its input is 0, this implies we need \(\frac{w-c}{\sigma \sqrt{5}} > 0\), which in turn implies \(c < w\). So, as long as Carl's car lets him be faster on average than Walter's walking, Carl has a better than 1/2 chance of arriving first. \\ 8 | 9 | c. To make it to the meeting at time, either individual needs to make sure the amount of time they take to arrive is less than \(w+10\).\\ 10 | 11 | \[P(T_{c} < w+10) = P(2\sigma Z +c < w+10) = \Phi(\frac{w+10-c}{2\sigma})\] 12 | 13 | \[P(T_{w} < w+10) = P(\sigma Z + w < w+10) = \Phi(\frac{10}{\sigma})\] 14 | 15 | Since \(\Phi\) is an increasing function, if we want Carl to have a greater chance than Walter to make it on time, then we require \(\frac{w+10-c}{2 \sigma} > \frac{10}{\sigma}\). This then implies that we need \(w > c+10\). 16 | -------------------------------------------------------------------------------- /src/chapters/2/sections/independence_and_conditional_independence/problems/33.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | 3 | \item $\frac{1}{2^{|C|}}$ 4 | 5 | \item For each element of $C$ we have four options for whether this element is in $A$ and/or $B$ and each option has equal probability of occurring. 6 | An element $x \in C$ is in $A \subseteq B$ if and only if ($x \in B \text{ and } x \in A$) or ($x \in B \text{ and } x \notin A$) or ($x \notin B \text{ and } \notin A$), i.e., 3 times out of 4. 7 | Thus, the probability that $x \in A \subseteq B$ is $3/4$ and $P(A \subseteq B) = (3/4)^{100}$. 8 | 9 | Another way to see this is by using the naive definition of probability. 10 | The sample space consists of 100 binary pairs where 1 in the 1st slot of the $i$-th pair indicates that the $i$-th element of $C$ is in $A$ and 1 in the 2nd slot indicates that the element is in $B$. 11 | Hence, $|S| = 4^{100}$. 12 | The number of elements in the set $X$ of outcomes corresponding to $A \subseteq B$ can be counted as 13 | $$|X| = \sum_{i=0}^{100} \binom{100}{i}2^i = 3^{100}.$$ 14 | The binomial coefficient accounts for the number of $i$-element subsets $B$ of $C$ and $2^i$ is the number of all subsets $A$ of $B$. 15 | This gives $P(A \subseteq B) = |X| / |S| = (3/4)^{100}.$ 16 | 17 | \item Let $p$ be a randomly selected person from $C$ sampled without 18 | replacement. 19 | 20 | $P(p \in A \cup p \in B) = \frac{1}{2} + \frac{1}{2} - \frac{1}{4} = \frac{3} 21 | {4}$. 22 | 23 | $P(A \cup B = C) = (P(p \in A \cup p \in B))^{|C|} = \left(\frac{3}{4}\right)^ 24 | {|C|}.$ 25 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/5/sections/exponential/problems/47.tex: -------------------------------------------------------------------------------- 1 | a. Let's develop the integral $\int_0^t h(s) ds$ 2 | 3 | $$ 4 | \int_0^t h(s) ds = \int_0^t \frac{f(s)}{1 - F(s)} ds = \int_0^t \frac{f(s)}{G(s)} ds 5 | $$ 6 | 7 | \noindent where $G(t) = 1 - F(t)$ is the survival function. 8 | 9 | 10 | Doing the substitution $v = \log G(s)$, we have 11 | 12 | $$ 13 | dv = \frac{G\;\!'(s)}{G(s)} ds = -\, \frac{F\;\!'(s)}{G(s)} ds = -\, \frac{f(s)}{G(s)} ds 14 | $$ 15 | 16 | 17 | With the substitution, the lower limit of integration becomes $\log G(0) = \log 1 = 0$, and the upper limit becomes $\log G(t)$. 18 | Therefore, 19 | 20 | \begin{equation} \label{eq_h_G} 21 | \int_0^t h(s) ds = \int_0^{\log G(t)} - dv = -\log G(t) 22 | \end{equation} 23 | 24 | 25 | $$ 26 | \log G(t) = - \int_0^t h(s) ds 27 | $$ 28 | 29 | $$ 30 | G(t) = 1 - F(t) = \exp \left( - \int_0^t h(s) ds \right) 31 | $$ 32 | 33 | $$ 34 | F(t) = 1 - \exp \left( - \int_0^t h(s) ds \right) \text{ , for all } t>0 35 | $$ \\ 36 | 37 | 38 | b. The PDF is the derivative of the CDF 39 | 40 | $$ 41 | f(t) = F\;\!'(t) = \left[ 1 - \exp \left( - \int_0^t h(s) ds \right) \right]' 42 | $$ 43 | 44 | \begin{equation} \label{eq_f_expint} 45 | f(t) = - \exp \left( - \int_0^t h(s) ds \right) \cdot \left( - \int_0^t h(s) ds \right)' 46 | \end{equation} 47 | 48 | To calculate the derivative of the integral in the relation above, let's apply the differential in both sides of equation \eqref{eq_h_G} 49 | 50 | $$ 51 | \left( \int_0^t h(s) ds \right)' 52 | = 53 | \left( - \log G(t) \right)' 54 | = 55 | - \frac{G\;\!'(t)}{G(t)} 56 | = 57 | \frac{ (F(t)-1)' }{G(t)} 58 | = 59 | \frac{f(t)}{1 - F(t)} 60 | = 61 | h(t) 62 | $$ 63 | 64 | Substituting this result in equation \eqref{eq_f_expint} 65 | 66 | $$ 67 | f(t) = - \exp \left( - \int_0^t h(s) ds \right) \cdot (-h(t)) 68 | $$ 69 | 70 | $$ 71 | f(t) = h(t) \exp \left( - \int_0^t h(s) ds \right) \text{ , for all } t>0 72 | $$ 73 | -------------------------------------------------------------------------------- /src/chapters/4/sections/indicator_r.v.s/problems/59.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item WLOG, let $m_{1} > m$ 3 | be the second median of $X$. Then, by the 4 | definition of medians, $P(X \leq m) \geq \frac{1}{2}$ and $P(X \geq m_{1}) \geq 5 | \frac{1}{2}$. Then, $P(X \in (m,m_{1})) = 0$. If $m_{1} > m + 1$, then 6 | there exists an $m_{2} \in (m, m_{1})$, such that $P(X = m_{2}) = 0$. This 7 | implies that $m_{2} = 1$, since that is the only value of $X$ with 8 | probability $0$. However, then $m < 1$, which precludes $m$ from being a 9 | median. Thus, $m_{1}$ must be $1 + m$. Since we know $23$ to be a median of $X$, 10 | we need to check whether $22$ or $24$ are medians of $X$. Computation via the 11 | CDF of $X$ shows that niether $22$, nor $24$ are medians. Hence, $23$ is the 12 | only median of $X$. 13 | 14 | \item Let $I_{j}$ be the indicator variable for the event $X \geq j$. Notice 15 | that the event $X = k$ (the first occurance of a birthday match happens when 16 | there are $k$ people) implies that $I_{j}=1$ for $j \leq k$ and vice versa. 17 | Thus, $$X = \sum_{j=1}^{366}I_{j}$$. 18 | 19 | Then, $$\text{E}(X) = \sum_{j=1}^{366}P(I_{j}=1) = 1 + 1 + \sum_{j=3}^{366}P(I_ 20 | {j}=1) = 2 + \sum_{j=3}^{366}p_{j}$$ 21 | 22 | \item $2 + 22.61659 = 24.61659$ 23 | 24 | \item $\text{E}(X^{2}) = 25 | \text{E}(I_{1}^{2} + \dots + I_{366}^{2} + 2\sum_{j=2}^ 26 | {366}\sum_{i=1}^{j-1}(I_{i}I_{j}))$. Note that $I_{i}^{2} = I_{i}$ and $I_{i}I_ 27 | {j} = I_{j}$ for $i < j$. Thus, 28 | 29 | \begin{align*} 30 | \text{E}(X^{2}) &= \text{E}(I_{1} + \dots + I_{366} + 2\sum_{j=2}^ 31 | {366}\sum_{i=1}^{j-1}I_{j}) \\ 32 | &= 2 + \sum_{j=3}^{366}p_{j} + 2\sum_{j=2}^{366}((j-1)\text{E}(I_{j})) \\ 33 | &= 2 + \sum_{j=3}^{366}p_{j} + 2\sum_{j=2}^{366}((j-1)p_{j}) \\ 34 | &\approx 754.61659 35 | \end{align*} 36 | 37 | $\text{Var}(X) \approx 754.61659 - (\text{E}(X))^{2} \approx 754.61659 - 605.98 = 38 | 148.63659$. 39 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/5/sections/pdfs_and_cdfs/problems/8.tex: -------------------------------------------------------------------------------- 1 | (a) 2 | Let $F$ be the CDF of the Beta distribution with parameters $a=3$, $b=2$. 3 | 4 | Due to the properties of the CDF, $F$ must be 0 for $x \le 0$ and 1 for $x \ge 1$. 5 | 6 | For $0 < x < 1$: 7 | 8 | \begin{equation*} 9 | \begin{split} 10 | F(x) 11 | & = \int_0^x f(t) dt = \int_0^x 12 t^2 (1-t) dt = 12 \int_0^x t^2 dt - 12 \int_0^x t^3 dt \\ 12 | & = 12 \left( \frac{x^3}{3} - \frac{x^4}{4} \right) \\ 13 | & = 4 x^3 - 3 x^4 14 | \end{split} 15 | \end{equation*} 16 | 17 | Then: 18 | 19 | $$ 20 | F(x) = 21 | \begin{cases} 22 | 0 &\text{ , for } x \le 0 \\ 23 | x^3(4 - 3x) &\text{ , for } 0 < x < 1 \\ 24 | 1 &\text{ , for } x \ge 1 25 | \end{cases} 26 | $$ 27 | 28 | 29 | (b) 30 | \begin{equation*} 31 | \begin{split} 32 | P(0 < X < 1/2) 33 | & = F(1/2) - F(0) = \left( \frac{1}{2} \right)^3 \left( 4 - \frac{3}{2} \right) - 0 \\ 34 | & = \frac{5}{16} 35 | \end{split} 36 | \end{equation*} 37 | 38 | 39 | (c) 40 | The mean of $X$ can be calculated by the definition of expectation: 41 | 42 | \begin{equation*} 43 | \begin{split} 44 | E(X) 45 | & = \int_0^1 x f(x) dx = \int_0^1 12 x^3 (1-x) dx \\ 46 | & = 12 \int_0^1 x^3 dx - 12 \int_0^1 x^4 dx = 12 \left( \frac{1}{4} - \frac{1}{5} \right) \\ 47 | & = \frac{3}{5} 48 | \end{split} 49 | \end{equation*} 50 | 51 | 52 | By the definition of variance: 53 | 54 | $$ 55 | \mathrm{Var}(X) = E(X^2) - (EX)^2 56 | $$ 57 | 58 | Let's calculate the second moment of $X$ by LOTUS: 59 | 60 | \begin{equation*} 61 | \begin{split} 62 | E(X^2) 63 | & = \int_0^1 x^2 f(x) dx = \int_0^1 12 x^4 (1 - x) dx \\ 64 | & = 12 \int_0^1 x^4 dx - 12 \int_0^1 x^5 dx = 12 \left( \frac{1}{5} - \frac{1}{6} \right) \\ 65 | & = \frac{2}{5} 66 | \end{split} 67 | \end{equation*} 68 | 69 | 70 | Substituting this value into the definition of variance: 71 | 72 | $$ 73 | \mathrm{Var}(X) = \frac{2}{5} - \left( \frac{3}{5} \right)^2 = \frac{1}{25} 74 | $$ 75 | -------------------------------------------------------------------------------- /src/chapters/4/sections/poisson_approximation/problems/73.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item Let $X$ be the number of people that play the same opponent in both 3 | rounds. Let $I_{j}$ be the indicator variable that person $j$ plays against the 4 | same opponent twice. $P(I_{j}=1) = \frac{1}{99}$. Then, $\text{E}(X) = \sum_ 5 | {j=1}^{100}P(I_{j}=1) = 100/99$. 6 | 7 | \item There is a strong dependence between trials. For instance, if we know that 8 | the first $50$ players played the same opponent twice, then all of the players 9 | played the same opponents twice. Moreover, knowing each of the $I_{i}$ gives us perfect information about one other $I$ - they are strongly pairwise dependent. 10 | 11 | \item Consider the $50$ pairs that played each other in round one. Let $I_{j}$ 12 | be the indicator variable for pair $j$ playing each other again in the second 13 | round. $P(I_{j}=1) = \frac{1}{99}$. Then, the expected number of pairs that 14 | play the same opponent twice is $\text{E}(Z) = \frac{50}{99} \approx \frac{1}{2}$. 15 | 16 | We can approximate the number of pairs that play against one another in both 17 | rounds with $Z \sim \text{Poiss}(\frac{1}{2})$. Note that $X=2Z$. $P(X = 0) \approx P(Z = 18 | 0) = e^{-\frac{1}{2}} \approx 0.6$. 19 | 20 | $P(X = 2) \approx P(Z = 1) = \frac{(\frac{1}{2})^{1}e^{-\frac{1}{2}}}{1!} 21 | \approx 0.32$. 22 | 23 | Note that the approximation in part C is more accurate - the independence of the same pairs playing against each other is much stronger than the independence of individuals who play the same opponent. Knowing that the players in Game 1 of round 2 played against each other in round 1 gives us very little information about whether players in any other games also played against each other. Whereas, knowing that Player 1 in round 2 plays against the same player (say, player 71) guarantees that we know that that player 71 also plays against the same player. 24 | \end{enumerate} 25 | -------------------------------------------------------------------------------- /src/chapters/5/sections/mixed_practice/problems/59.tex: -------------------------------------------------------------------------------- 1 | (a) Let $\theta_1$, $\theta_2$ and $\theta_3$ be the angles corresponding to points A, B and C respectively. 2 | From the statement of the problem, those angles are i.i.d. $\mathrm{Unif}(0,2\pi)$. 3 | 4 | The angles $\theta_1$, $\theta_2$ and $\theta_3$ divide the $[0,2\pi)$ range in four successive sub-intervals. 5 | The argument is wrong because the problem is not symmetric with respect to the three arcs, but rather with respect to the four angle sub-intervals. 6 | The average length of each sub-interval is $2\pi/4=\pi/2$, by symmetry. 7 | The length of the arc that contains the point (1,0) is the sum of the first and fourth sub-intervals, so it is twice as long as the other arcs on average. \\ 8 | 9 | (b) 10 | \[\theta_1 = \text{Unif}(0, 2\pi)\] 11 | \[\theta_2 = \text{Unif}(0, 2\pi)\] 12 | \[\theta_3 = \text{Unif}(0, 2\pi)\] 13 | 14 | \[L_1 = \text{min} (\theta_1, \theta_2, \theta_3)\] 15 | CDF, 16 | \begin{flalign*} 17 | F(y) & = 1 - P(\text{min}(\theta_1, \theta_2, \theta_3) > y) \\ 18 | & = 1 - ( \frac{2\pi - y}{2\pi} )^3 \text{ , for } 0 \le y < 2\pi 19 | \end{flalign*} 20 | PDF, 21 | \begin{flalign*} 22 | f(y) & = \frac{d}{dy} F(y) \\ 23 | & = \frac{3}{2\pi} (1 - \frac{y}{2\pi})^2 \text{ , for } 0 \le y < 2\pi 24 | \end{flalign*} 25 | 26 | (c) 27 | \begin{flalign*} 28 | \mathbb{E}[L] & = 2 \mathbb{E}[L_1] \\ 29 | & = 2 \int_{0}^{2\pi} y \frac{3}{2\pi} (1 - \frac{y}{2\pi})^2 dy \\ 30 | & = \frac{3}{\pi} \int_{0}^{2\pi} (y + \frac{y^3}{4\pi^2} - \frac{y^2}{\pi}) dy \\ 31 | & = \frac{3}{\pi} [ \frac{4\pi^2}{2} + \frac{1}{4\pi^2} \frac{16\pi^4}{4} - \frac{1}{\pi} \frac{8\pi^3}{3}] \\ 32 | & = \pi 33 | \end{flalign*} 34 | 35 | We can reach the same result from the qualitative explanation given in part (a): since $L$ is the sum of the first and fourth sub-intervals, where the length of each sub-interval is $\pi/2$ on average, $\mathbb{E}[L] = \pi/2+\pi/2 = \pi$. 36 | -------------------------------------------------------------------------------- /src/chapters/2/sections/monty_hall/problems/47.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item Contestant wins under the "stay-stay" strategy if and only if the Car is 3 | behind Door $1$. 4 | 5 | $$P(S) = \frac{1}{4}$$ 6 | 7 | \item If the Car is not behind Door $1$, Monty opens one of the two doors 8 | revealing a Goat. Contestant stays. Then, Monty opens the other door with a Goat 9 | behind it. Finally, contestant switches to the Door concealing the Car. 10 | 11 | $$P(S) = P(C_{1})P(S|C_{1}) + P(C_{1}^{c})P(S|C_{1}^{c})$$ 12 | 13 | $$P(S) = 0 + \frac{3}{4} * 1 = \frac{3}{4}$$ 14 | 15 | \item Under the "switch-stay" strategy, if the Car is behind Door $1$ the 16 | contestant loses. Given that the Car is not behind Door $1$, Monty opens one of 17 | the Doors containing a Goat. The contestant will win if they switch to the Door 18 | containing the Car and will lose if they switch to the Door containing the last 19 | remaining Goat. 20 | 21 | Thus, 22 | 23 | $$P(S) = P(C_{1})P(S|C_{1}) + P(C_{1}^{c})P(S|C_{1}^{c}) = 0 + \frac{3}{4} * 24 | \frac{1}{2} = \frac{3}{8}$$ 25 | 26 | \item Under the "switch-switch" strategy, if the car is behind Door $1$, then 27 | Monty opens a door with a Goat behind it. The contestant switches to a door 28 | with a Goat behind it. Monty then opens the last door containing a Goat, at 29 | which point the contestant switches back to the door containing the Car. 30 | 31 | If Door $1$ contains a Goat, Monty opens another Door containing a Goat and 32 | presents the contestant with a choice. If the contestant switches to the 33 | remaining door containing a Goat, then Monty is forced to open Door $1$, 34 | revealing the final Goat. The contestant switches to the one remaining Door 35 | which contains the Car. If, on the other hand, the contestant switches to the 36 | door containing the Car, then on the subsequent switch they lose the game. 37 | 38 | Thus, 39 | 40 | $$P(S) = \frac{1}{4}*1 + \frac{3}{4}* \frac{1}{2} = \frac{5}{8}$$ 41 | 42 | \item "Stay-Switch" is the best strategy. 43 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/2/sections/first-step_analysis_and_gamblers_ruin/problems/49.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item 3 | \begin{align*} 4 | P(A_{2}) &= p_{1}p_{2} + q_{1}q_{2} \\ 5 | &= (1-q_{1})(1-q_{2}) + \left(b_{1} + \frac{1}{2}\right)\left(b_{2} + \frac{1} 6 | {2}\right) \\ 7 | &= \left(b_{1} - \frac{1}{2}\right)\left(b_{2} - \frac{1}{2}\right) + \left(b_ 8 | {1} + \frac{1}{2}\right)\left(b_{2} + \frac{1} 9 | {2}\right) \\ 10 | &= \frac{1}{2} + 2b_{1}b_{2} 11 | \end{align*} 12 | 13 | \item 14 | By strong induction, $$P(A_{n}) = \frac{1}{2} + 2^{n-1}b_{1}b_{2}...b_{n}$$ for 15 | $n \leq 2.$ 16 | 17 | Suppose the statement holds for all $n \leq k-1$. 18 | Let $S_{i}$ be the event that the $i$-th trial is a success. 19 | 20 | \begin{align*} 21 | P(A_{k}) &= p_{k}P(A_{k-1}^{c} | S_{k}) + q_{k}P(A_{k-1} | S_{k}^{c}) \\ 22 | &= p_{k}\left(1 - \left(\frac{1}{2} + 2^{k-2}b_{1}b_{2}...b_{k-1}\right)\right) 23 | + q_{k}\left(\frac{1}{2} + 2^{k-2}b_{1}b_{2}...b_{k-1}\right) \\ 24 | &= p_{k}\left(\frac{1}{2} - 2^{k-2}b_{1}b_{2}...b_{k-1}\right) + q_{k}\left( 25 | \frac{1}{2} + 2^{k-2}b_{1}b_{2}...b_{k-1}\right) \\ 26 | &= \frac{1}{2} + (q_{k} - p_{k})2^{k-2}b_{1}b_{2}...b_{k-1} \\ 27 | &= \frac{1}{2} + 2b_{k}2^{k-2}b_{1}b_{2}...b_{k-1} \\ 28 | &= \frac{1}{2} + 2^{k-1}b_{1}b_{2}...b_{k-1}b_{k} 29 | \end{align*} 30 | 31 | \item 32 | if $p_{i} = \frac{1}{2}$ for some $i$, then $b_{i} = 0$ and $P(A_{n}) = \frac{1} 33 | {2}.$ 34 | 35 | if $p_{i} = 0$ for all $i$, then $b_{i} = \frac{1}{2}$ for all $i$. Hence, 36 | the term $2^{k-1}b_{1}b_{2}...b_{k-1}b_{k}$ equals $\frac{1}{2}$. Thus, $P(A_ 37 | {n}) = 1.$ This makes sense since the number of successes will be $0$, which is 38 | an even number. 39 | 40 | if $p_{i} = 1$ for all $i$, then $b_{i} = -\frac{1}{2}$ for all $i$. Hence, the 41 | term $2^{k-1}b_{1}b_{2}...b_{k-1}b_{k}$ will either equal to $\frac{1}{2}$ or $- 42 | \frac{1}{2}$ depending on the parity of the number of trials. Thus, $P(A_{n})$ 43 | is either $0$ or $1$ depending on the parity of the number of trials. 44 | 45 | This makes sense since, if every trial is a success, the number of successes 46 | will be even if the number of trials is even. The number of successes will be 47 | odd otherwise. 48 | 49 | \end{enumerate} -------------------------------------------------------------------------------- /src/chapters/5/sections/exponential/problems/37.tex: -------------------------------------------------------------------------------- 1 | a. We need to find the value of \(t\) such that \(F(t) = 1/2\) - this will indicate that there is a 1/2 chance that the particle has decayed before time t.\\ 2 | 3 | \(1-e^{-\lambda t} = 1/2\) implies \(ln(2) = \lambda t\), so \(t = ln(2)/\lambda\)\\ 4 | 5 | b. We need to compute \(P(t < T < t+\epsilon | T > t) = P(t < T < t+\epsilon)/ P(T > t)\). This is \(\frac{(1-e^{-\lambda(t+\epsilon)})-(1-e^{-\lambda t})}{e^{-\lambda t}} = 1 - e^{-\lambda\epsilon}\). Using the approximation given in the hint and the assumption that \(\epsilon\) is small enough that \(\epsilon\lambda \approx 0\), this is about \(1-(1-\epsilon\lambda) = \epsilon\lambda\).\\ 6 | 7 | c. \(P(L > t) = P(T_{1}>t)P(T_{2}>t)...P(T_{n}>t) = e^{-n\lambda t}\), so \(L \sim Expo(n\lambda)\). Therefore, if \(X \sim Expo(1)\), we have \(L = X/n\lambda\). Then since \(E(X) = 1\) and \(Var(X)=1\), we can get \(E(L) = 1/(n\lambda)\) and \(Var(L) = 1/(n^{2}\lambda^{2})\)\\ 8 | 9 | d. M must be equal to the sum of \(D_{1} + D_{2} + D_{3} +...+D_{n}\), where \(D_{i}\) is the amount of time between the \(i-1\)th and \(i\)th decay event. We observe that \(D_{i}\) must then be the minimum of \(n-i+1\) \(Expo(\lambda)\) variables - for example, \(D_{1}\) is the first particle to decay out of n particles, \(D_{2}\) is the first particle to decay out of the remaining n-1 particles, etc. Since \(Expo\) is memoryless, \(D_{i+1}\) is independent of \(D_{i}\) as the amount of time it takes for the next particle to decay is not affected by the amount of time it took the previous particle to decay. Therefore, \(D_{i} \sim Expo((n-i+1)\lambda)\).\\ 10 | 11 | Then \(E(M) = E(D_{1}) + E(D_{2}) +... +E(D_{n}) = \frac{1}{\lambda} \sum_{i=1}^{n} \frac{1}{i} \) \\ 12 | 13 | Now we calculate the variance of M, recalling that the variance of the sum of independent r.v.s is equal to the sum of variances 14 | 15 | \(\mathrm{Var}(M) = \mathrm{Var}(D_1 + D_2 + \dots + D_n)\) 16 | 17 | \(\mathrm{Var}(M) = \mathrm{Var}(D_1) + \mathrm{Var}(D_2) + \dots + \mathrm{Var}(D_n)\) 18 | 19 | Since \(\mathrm{Var}(D_i) = 1 / [ (n-i+1)^2 \lambda^2 ]\), 20 | 21 | \[ 22 | \mathrm{Var}(M) = \sum_{i=1}^n \frac{1}{(n-i+1)^2 \lambda^2} = \frac{1}{\lambda^2} \sum_{i=1}^n \frac{1}{i^2} 23 | \] 24 | -------------------------------------------------------------------------------- /src/chapters/1/sections/story_proofs/problems/21.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate}[label=(\alph*)] 2 | \item Case 1: If Tony is in a group by himself, then we have to break the 3 | remaining $n$ people into $k-1$ groups. This can be done in 4 | $$ 5 | \left\{ 6 | \begin{array}{cc} 7 | n\\ 8 | k-1 9 | \end{array} 10 | \right\} 11 | $$ 12 | ways. 13 | 14 | Case 2: If Tony is not in a group by himself, then we first break up the 15 | remaining $n$ people into $k$ groups. Then, Tony can join any of them. 16 | The number of possible groups then is 17 | $$ 18 | k\left\{ 19 | \begin{array}{cc} 20 | n\\ 21 | k 22 | \end{array} 23 | \right\} 24 | $$ 25 | 26 | Case 1 and 2 together count the number of ways to break up $n+1$ people into 27 | $k$ non empty groups, which is precisely what the left side of the equation counts. 28 | 29 | \item Say Tony wants to have $m$ in his group. That is to say he does not want 30 | $n-m$ people. These $n-m$ people must then be broken into $k$ groups. 31 | 32 | The number of people Tony wants to join his group can range from $0$ to $n-k$. 33 | The reason for the upper bound is that at least $k$ people are required to 34 | make up the remaining $k$ groups. 35 | 36 | Taking the sum over the number of people in Tony's group we get 37 | $$\sum_{j=0}^{n-k}{n \choose j}\left\{ 38 | \begin{array}{cc} 39 | n-j\\ 40 | k 41 | \end{array} 42 | \right\} 43 | $$ 44 | 45 | Now, instead of taking the sum over the number of people Tony wants in his 46 | group, we can equivalently take the sum over the number of people Tony does 47 | not want in his group. Hence, 48 | 49 | $$\sum_{j=0}^{n-k}{n \choose j}\left\{ 50 | \begin{array}{cc} 51 | n-j\\ 52 | k 53 | \end{array} 54 | \right\} = \sum_{i=n}^{k}{n \choose i}\left\{ 55 | \begin{array}{cc} 56 | i\\ 57 | k 58 | \end{array} 59 | \right\} 60 | $$ 61 | Since the sum counts all possible ways to group $n+1$ people into $k+1$ groups, 62 | we have 63 | $$ 64 | \sum_{i=n}^{k}{n \choose i}\left\{ 65 | \begin{array}{cc} 66 | i\\ 67 | k 68 | \end{array} 69 | \right\} = 70 | \left\{ 71 | \begin{array}{cc} 72 | n+1\\ 73 | k+1 74 | \end{array} 75 | \right\} 76 | $$ 77 | as desired. 78 | 79 | \end{enumerate} --------------------------------------------------------------------------------