%hw7.tex:
%%a Plain TeX file by Doron Zeilberger (x pages)

%begin macros
\def\L{{\cal L}}
\baselineskip=14pt
\parskip=10pt
\def\halmos{\hbox{\vrule height0.15cm width0.01cm\vbox{\hrule height
  0.01cm width0.2cm \vskip0.15cm \hrule height 0.01cm width0.2cm}\vrule
  height0.15cm width 0.01cm}}
\font\eightrm=cmr8 \font\sixrm=cmr6
\font\eighttt=cmtt8
\magnification=\magstephalf
\def\P{{\cal P}}
\def\Q{{\cal Q}}
\def\1{{\overline{1}}}
\def\2{{\overline{2}}}
\parindent=0pt
\overfullrule=0in
\def\Tilde{\char126\relax}
\def\frac#1#2{{#1 \over #2}}
%\headline={\rm  \ifodd\pageno  \RightHead  \else  \LeftHead  \fi}
%\def\RightHead{\centerline{
%Title
%}}
%\def\LeftHead{ \centerline{Doron Zeilberger}}
%end macros

\centerline
{
\bf
Solutions to Homework 7 SOSC 30100, Sept. 190, 2013
}


{\bf 1.} 
(a) the probability that ``3'' does {\bf not} come up in four tosses of a fair die is $(1-\frac{1}{6})^4=(\frac{5}{6})^4$
(since the tosses are {\it independent}. Hence the probability that a ``3'' {\it does} come up is
$1-(\frac{5}{6})^4=\frac{671}{1296}=.51774\dots$

(b) the probability that a `snake's eye' does {\bf not} come up in twenty-four tosses of a pair of fair dice is $(1-\frac{1}{36})^24=(\frac{35}{36})^24$
(since the tosses are {\it independent}. Hence the probability that a snake's eyes {\it does} come up is
$1-(\frac{35}{36})^24=.4914\dots\dots$ .  

I would rather bet on (a).

{\bf 2.} (a) If there is no limit to the number of committees that a person can chair, then
for each committee that are $50$ (independent) choices of chair. Hence the total number is $50^{10}$.

If a person can chair at most one committee, then the number is
$$
50 \cdot 49 \cdot 48 \cdots ... 41 = \frac{50!}{40!} \quad .
$$

(There are $50$ possibilities for the chair of the first committee, $49$ for the chair of the second committee, etc.).



(b) If you don't care who the chair is, then the number of ways is the multinomial coefficient
$$
\frac{50!}{5!^6 10!^2} \quad .
$$


If in addition, you have to pick a chair for each committee, then the number of possibilities is
$$
\frac{50!}{5!^6 10!^2} \cdot (5^6 \cdot 10^2) =
\frac{50!}{4!^6 9!^2} \quad .
$$


{\bf 3.} 

(a) Using Bayes' law,  the probability that starting a negative campaign is indeed a {\bf bad} idea,
if the focus group decided that it is
$$
\frac{(0.4)(0.8)}{(0.6)(0.3)+ (0.4)(0.8)}=\frac{0.32}{0.5}= 0.64 \quad .
$$
Hence the probability that it is a {\bf good} idea is $1- 0.64=0.36$.


(b) Now the modified {\it prior} that starting a negative campaign is a good idea is $0.36$ and that it is
a bad idea is $0.64$. If the second focus group decided that it is a good idea after all, then
the probability that it is indeed a good idea is
$$
\frac{(0.36)(0.7)}{(0.36)(0.7)+ (0.64)(0.2)}=\frac{0.32}{0.5}= 0.6631\dots \quad .
$$


(c) If things are reversed, then the probability that starting a negative campaign, after the first focus group is
$$
\frac{(0.6)(0.7)}{(0.6)(0.7)+ (0.4)(0.2)}=\frac{0.42}{0.5}= 0.84\dots \quad ,
$$
and after the second focus group it is
$$
\frac{(0.84)(0.3)}{(0.84)(0.3)+ (0.16)(0.8)}= 0.6631\dots \quad .
$$

You get the same probability.


{\bf 4.}
(a)
$$
\int_b^{\infty} \frac{1}{b} exp(-\frac{x}{b}) ] \, dx = 1- F(b)= 1- (1- exp(-b/b)) = e^{-1}= \frac{1}{e} \quad .
$$

(b)
$$
\int_0^{2b} \frac{1}{b} exp(-\frac{x}{b})  \, dx =  F(2b)= (1- exp(-(2b)/b)) = 1- e^{-2}= 1- \frac{1}{e^2} \quad .
$$


{\bf 5.}

(a)
$$
Pr(X=1)= \frac{3}{28}+ \frac{3}{14} + \frac{1}{28}= \frac{10}{28}= \frac{5}{14} \quad ,
$$
$$
Pr(X=2)= \frac{9}{28}+ \frac{3}{14} = \frac{15}{28} \quad ,
$$
$$
Pr(X=3)= \frac{3}{28} \quad .
$$

$$
Pr(Y=0)= \frac{3}{28}+ \frac{9}{28} + \frac{3}{28}= \frac{15}{28} \quad ,
$$
$$
Pr(Y=1)= \frac{3}{14}+ \frac{3}{14} = \frac{3}{7} \quad ,
$$
$$
Pr(Y=2)= \frac{1}{28} \quad .
$$


(b) The expectation of a random variable is $\sum_{s \in S} X(s) Pr(X=s)$, so:
$$
E(X)=
1 \cdot Pr(X=1) +  2 \cdot Pr(X=2) +  3 \cdot Pr(X=3) =
\frac{10}{28} + 2 \cdot \frac{15}{28} + 3 \cdot \frac{3}{28} =
\frac{10+30+9}{28}=\frac{49}{28}=\frac{7}{4} \quad .
$$
Similarly,
$$
E(Y)=
0 \cdot Pr(Y=0) +  1 \cdot Pr(Y=1) +  2 \cdot Pr(Y=2) =
0 \cdot \frac{15}{28} + 1 \cdot \frac{3}{7} + 2 \cdot \frac{1}{28} = \frac{1}{2} \quad .
$$


(c) The variance of a random variable is $\sum_{s \in S} (X(s)- \mu)^2 Pr(X=s)$, where $\mu$ is the expectation.

So, since for $E(X)=\frac{7}{4}$,
$$
Var(X)=
(1-\frac{7}{4})^2 \cdot Pr(X=1) +  (2-\frac{7}{4})^2 \cdot Pr(X=2) +  (3 -\frac{7}{4})^2 \cdot Pr(X=3) =
(1-\frac{7}{4})^2 \cdot \frac{10}{28} +  (2-\frac{7}{4})^2 \cdot \frac{15}{28} +  (3 -\frac{7}{4})^2 \cdot \frac{3}{28} \quad
$$

Also, since $E(Y)=\frac{1}{2}$,
$$
Var(Y)=
(0-\frac{1}{2})^2 \cdot Pr(Y=0) +  (1 -\frac{1}{2})^2 \cdot Pr(Y=1) +  (2-\frac{1}{2})^2 \cdot Pr(Y=2) =
\frac{1}{4} \cdot \frac{15}{28} + \frac{1}{4} \cdot \frac{3}{7} + \frac{9}{4} cdot \frac{1}{28}  \quad .
$$

The Covarianace of two random variables $X$ and $Y$ is the expectation of $(X-E(X))(Y-E(Y))$

So
$$
Cov(X,Y)=
\frac{3}{28} (1- \frac{7}{4}) ( 0 - \frac{1}{2}) + \cdots
$$

(d) They are not independent, since for example, the probability that $X=2$ and $Y=1$, $\frac{3}{14}$
is {\bf not} the product of the $Pr(X=2)=\frac{5}{28}$ and $Pr(Y=1)=\frac{3}{17}$.

{\bf 6.} 

(a) The {\it expectation} of a continuous random variable whose probability density function is $f(x)$ is
$$
\int_{-\infty}^{\infty} x f(x) \, dx.
$$
So, in this case
$$
E(X)=\int_{x=0}^{\infty} x e^{-x} = 1 \quad .
$$
(By integration by parts, or using Maple).


(b)
$$
E(X^2)= \int_{0}^{\infty} x^2 e^{-x} =2\, dx.
$$
(using Maple).


(c)
$$
Var(X)=E(X^2)-E(X)^2= 2- 1^2 = 2 -1 =1 \quad .
$$


(d)
$$
E(e^{2X/3})= \int_{0}^{\infty} e^{2x/3} e^{-x}  = \int_{0}^{\infty} e^{-x/3}  = \frac{e^{-x/3}}{-1/3} \Bigl \vert_{0}^{\infty} =
-3e^{-x/3} \Bigl \vert_{0}^{\infty} = -3 (0-1) =3 \quad .
$$


{\bf 7.} 

(a) $E(X+Y)=E(X)+E(Y)=-2+1=-1$

(b) $Var(X+Y)=Var(X)+Var(Y)=9+16=25$, $Var(X-Y)=Var(X)+Var(Y)=9+16=25$

(c) and (d) too advanced!

\end








