% 256f19Assignment3.tex             Conditional probability and independence
\documentclass[11pt]{article} 
%\usepackage{amsbsy} % for \boldsymbol and \pmb 
%\usepackage{graphicx} % To include pdf files!
\usepackage{amsmath}
\usepackage{amsbsy}
\usepackage{amsfonts}
\usepackage[colorlinks=true, pdfstartview=FitV, linkcolor=blue, citecolor=blue, urlcolor=blue]{hyperref} % For links
\usepackage{fullpage}
% \pagestyle{empty} % No page numbers


\begin{document}
%\enlargethispage*{1000 pt} 

\begin{center}   
{\Large \textbf{\href{http://www.utstat.toronto.edu/~brunner/oldclass/256f19}{STA 256f19} 
Assignment Three}}\footnote{Copyright information is at the end of the last page.}
\vspace{1 mm}
\end{center}

\noindent
Please read Section 1.5 (pages 20-28) in the text, and look over your lecture notes. These homework problems are not to be handed in. They are preparation for Term Test 1 and the final exam.  

%\vspace{5mm}
\begin{enumerate} 

%%%%%%%%%%%%%%%%%%%% Conditional Probability %%%%%%%%%%%%%%%%%%%%

\item \label{mathdata} In a Canadian university long ago, there were 3 calculus classes. There was an ``Elite" class for math and computer science students, a ``Mainstream" class for most other fields of study, and a ``Catch-up" course for student who had not taken high school calculus. The Catch-up course met an extra hour a week, and covered pre-calculus material as well as calculus. At the end of the course, they took the same final exam as the Mainstream course. Students either passed the course, or did not. Not passing includes withdrawals and other disappearances, as well as actual failures. The table below shows percentages of students in each category. These are real data.

\begin{center}
\begin{tabular}{l | c c}  
            & Passed & Did Not Pass \\ \hline
Elite       & ~7   & ~2    \\
Mainstream  & 48   & 32    \\
Catch-up    & ~3   & ~8    
\end{tabular}
\end{center}
\vspace{5mm}
Recall that probabilities are numbers between zero and one, inclusive. For a randomly chosen student, what is 
        \begin{enumerate}
            \item The probability of passing? (0.53)
            \item The probability of being in the mainstream course? (0.80)
            \item The probability of passing given that the student is in the Catch-up course? (3/11 = 0.27)
            \item The probability of being in the Elite class given that the student did not pass? (2/42 = 0.476)
        \end{enumerate}

\item Do Exercise 1.5.3 in the text. This problem is small enough so you can just list the outcomes along with their probabilities, and use the definition of conditional probability.

\item A jar contains 15 red balls and 5 blue balls.  What is the probability of randomly drawing a red and then a blue? (15/76 = 0.097)

\item Do Exercise 1.5.5 in the text.

\pagebreak

\item  Two balls are drawn in succession and without replacement, from a jar containing three red balls and four white balls. 
    \begin{enumerate}
        \item What is the probability that the second ball is white given that the first ball is red? (4/6)
        \item What is the probability that the second ball is white? (4/7)
        % P(W2) = P(W2|R1)P(R1) + P(W2|W1)P(W1)
        %       = 2/3 * 3/7 + 1/2 * 4/7 = 4/6 * 3/7 + 3/6 * 4/7
        %       = (12+12)/42 = 24/42 = 12/21 = 4/7 = 0.5714286
        \item What is the probability that the first ball is white given that the second ball is white? (1/2) % P(W1 and W1)/P(W2) = (12/42) / (24/42) = 1/2
    \end{enumerate}

\item Prove $P(A_1 \cap A_2 \cap A_3 \cap A_4) = 
P(A_1) P(A_2|A_1) P(A_3 | A_1 \cap A_2) P(A_4|A_1 \cap A_2 \cap A_3)$. Clearly this can be extended, and is the basis of multiplying down the branches of a tree diagram. 

\item Do Exercise 1.5.7 in the text. % Baseball

\item Do Problem 1.5.13 parts (a) and (b) in the text. The answer to (a) is 1/2, and the answer to (b) is 2/3. % Nice 3 card problem.


\item \label{Rice46} % Problem 46 in Rice. 
This question is taken from \emph{Mathematical statistics and data analysis} by Rice. An urn is a vase or jar.

Urn $A$ has three red balls and two white balls, and urn $B$ has two red balls and
five white balls. A fair coin is tossed. If it lands heads up, a ball is drawn from
urn $A$; otherwise, a ball is drawn from urn $B$.
    \begin{enumerate}
        \item What is the probability that a red ball is drawn? (31/70)
        \item If a red ball is drawn, what is the probability that the coin landed heads up? (21/31)
    \end{enumerate}

\item In this question you will establish that conditional probability satisfies the four basic properties of probability given on page 5 of the text. With $P(A) > 0$,
    \begin{enumerate}
        \item Show $0 \leq P(B|A) \leq 1$.
        \item Show $P(\emptyset | A) = 0$.
        \item Show $P(A|A)=1$.
        \item Show that if $B_1, B_2 \ldots$ are disjoint subsets of $S$, 
          $P\left( (\cup_{k=1}^\infty B_k)|A \right) = \sum_{k=1}^\infty P(B_k|A)$.
    \end{enumerate}
For the last item, please use the tabular format illustrated in lecture.

\item Under what circumstances is $P(A|B) = P(B|A)$? ($P(A)=P(B)$. Of course both probabilities must be greater than zero in order for the conditional probabilities to be defined.)

\item Do Problem 1.5.13, parts (a) and (b). The answer to (a) is 1/2, and the answer to (b) is 2/3.

\item Let $S = \cup_{k=1}^\infty A_k$, disjoint, with $P(A_k)>0$ for all $k$. 
    \begin{enumerate}
        \item Using the formula sheet and the tabular format illustrated in lecture, prove $P(B) = \sum_{k=1}^\infty P(A_k)P(B|A_k)$.
        \item Prove the following version of Bayes' Theorem: $ P(A_j|B) = \frac{P(A_j)P(B|A_j)}{\sum_{k=1}^\infty P(A_k)P(B|A_k)}$. You may use anything from the formula sheet except Bayes' theorem itself.
    \end{enumerate}

\item  % Easy artificial Bayes.
Two balls are drawn in succession and without replacement, from a jar containing eight red balls and four white balls. What is the probability that the first ball was white given that the second ball was red? Use Bayes' theorem. Show your work. (4/11)

\item In the most common form of Down syndrome, the person has an extra 21st chromosome. The result is developmental delay (formerly known as mental retardation), and increased susceptibility to a wide range of medical conditions. Down syndrome appears to be a kind of genetic lottery, with the number of tickets depending on the age of the mother. Older mothers are more likely to have a baby with Down syndrome, but still the majority of babies with Down syndrome are born to mothers under 25, because young women are so much more likely to have babies. 

Down syndrome can be detected with near certainty by amniocentesis, in which a sample of amniotic fluid is taken with a needle. But it's tricky early in pregnancy, because everything is so small. Instead, there's a blood test that works pretty well in the first timester (first 3 months). When the test indicates Down syndrome, it's called a ``positive" result.

For a 30-year old pregnant woman, The probability of a fetus with Down syndrome is around 1/940. The probability of a positive test if the fetus has Down syndrome (the true positive rate) is approximately 0.84. The probability of a positive test if the fetus does not have Down syndrome (the false positive rate) is 0.04. Given a positive test result, what is the probability that the fetus actually has Down syndrome? (3/137 = 0.022)

\vspace{3mm}
%%%%%%%%%%%%%%%%%%%% Independence %%%%%%%%%%%%%%%%%%%%
\hrule \vspace{3mm}

\item Do Exercise 1.5.9 in the text. % Definition workout.

\item Do Exercise 1.4.9 in the text. % Premature geometric

\item \label{Rice77} % Problem 77 in Rice, Ch. 1, but changed a bit.
This question is a modified version of one in \emph{Mathematical statistics and data analysis} by Rice.

A player throws darts at a target. On each trial, independently of the other trials,
she hits the bull's-eye with probability .10. How many times should she throw so
that her probability of hitting the bull's-eye at least once is .6? (At least 9 times.)

\item A jar contains 10 red balls and 20 blue balls. If you sample 5 balls randomly \emph{with} replacement, what is the probability of
    \begin{enumerate} % 
        \item What is the probability of the sequence BRBBR? ($\frac{8}{3^5} = 0.0329$)
        \item It is obvious that all sequences with 2 reds and 3 blues have the same probability. How many such sequences are there?   ($\binom{5}{2} = 10$)
        \item What is the probability of 2 reds? (0.329)
        \item Obtaining $j$ red balls, $j = 0, \ldots, 5$? Give a single formula. Don't simplify. Answer is $\binom{5}{j} \left(\frac{1}{2}\right)^j \left(\frac{2}{3}\right)^{5-j}$
    \end{enumerate}

\item Toss a coin with probability of a head equal to $\theta$ (the Greek letter theta), $n$ times. What is the probability of observing exactly $k$ heads? Based on the last problem, you should be able to just write the answer down. 

\item Do Problem 1.5.14 in the text. Hint: Draw a Venn diagram. % A^c and B ind

\item Let $A$ and $B$ be events of positive probability. Choose one of these statements and prove it. 
    \begin{enumerate}
        \item If $A$ and $B$ are disjoint, then $A$ and $B$ are independent.
        \item If $A$ and $B$ are independent, then $A$ and $B$ are disjoint.
        \item Both (a) and (b)
        \item If $A$ and $B$ are disjoint, then they cannot be independent.
    \end{enumerate}
(Answer is d)
\item Prove that if $P(A)=0$, then the event $A$ is independent of every other event. You do not need to use the tabular format.  

\item Let $A \subset B$, with $P(A)>0$. Is it possible for $A$ and $B$ to be independent? (If $P(B)=1$, yes. If $P(B)<1$, no.)

\item Roll a single fair die repeatedly.
    \begin{enumerate}
        \item What is the probability that the first 2 appears on the 4th roll? (125/1296)
        \item What is the probability that a 2 eventually occurs -- that is, on roll 1 or 2 or \ldots? Show your work. (1)
        \item What is the probability that the first 2 occurs on an odd numbered roll? (6/11)
        \item What is the probability that the third 2 occurs on the fifth roll? There is no need to simplify. My answer is $\binom{4}{2} \left(\frac{1}{6}\right)^3 \left(\frac{5}{6}\right)^2$. % Negative binomial
    \end{enumerate}


\end{enumerate}

% \vspace{20mm}

\noindent
\begin{center}\begin{tabular}{l}
\hspace{6in} \\ \hline
\end{tabular}\end{center}
This assignment was prepared by  \href{http://www.utstat.toronto.edu/~brunner}{Jerry Brunner},
Department of Mathematical and Computational Sciences, University of Toronto. Except for Problems \ref{Rice46} and \ref{Rice77} (which are taken from \emph{Mathematical statistics and data analysis} by Rice),
it is licensed under a 
\href{http://creativecommons.org/licenses/by-sa/3.0/deed.en_US}
     {Creative Commons Attribution - ShareAlike 3.0 Unported License}. Use any part of it as you like and share the result freely. The \LaTeX~source code is available from the course website: 
     
\begin{center}
\href{http://www.utstat.toronto.edu/~brunner/oldclass/256f19} {\small\texttt{http://www.utstat.toronto.edu/$^\sim$brunner/oldclass/256f19}}
\end{center}


\end{document}




\href{http://www.utstat.toronto.edu/~brunner/oldclass/256f18}{STA 256f18}
