\magnification=\magstep1
\centerline{MONT 107N -- Understanding Randomness}
\centerline{Selected Solutions for Problem Set 4}
\centerline{April 12, 2010}
\bigskip
\noindent
Chapter 26/6 (a)  Since this part says the 350 people are chosen
from a {\it large} population, under the null hypothesis that the 
selection {\it was random}, we can model the process of selection
by thinking of drawing 350 times with replacement from the box
$[0,1]$.  The expected number of 1's is 175 and the SE for the 
number is $\sqrt{350}\times \sqrt{(.5)(.5)} \doteq 9.35$.  Then
the observed $z$-statistic is 
$$z = {102 - 175\over 9.35} \doteq -7.8$$
This is so small that the $p$-value of the test is approximately
zero.  

(b)  Note that the problem says the selection is done {\it without
replacement} now.  This means that in computing the SE we must
use the {\it correction factor} from pp. 367-370 in the book.
The SE for the number of 1's is 
$$\sqrt{{350 - 100\over 350 - 1}} \times \sqrt{100} \times \sqrt{(.29)(.71)} \doteq 3.84$$
Then 
$$z = {9 - 29\over 3.84} \doteq -5.21.$$
Again, the $p$-value is almost zero.  

(c) The conclusion to be drawn from both parts here is that the
jury selection was biased against women.
\bigskip
\noindent
8.  The null hypothesis is that the average educational level 
in the county is also 13 (the national average), and the
alternative is that the average in the county is higher.  Note that
we are {\it not comparing two independent samples here}, so 
this is a one-sample test, not a two-sample test.  
Using the SD of the sample to estimate the SD of the 
county population, we compute
$$z = {14 - 13\over 5/\sqrt{1000}} = 6.32.$$
This is very strong evidence to reject the null hypothesis ($p \doteq 0$).  
\bigskip
\noindent
9.  You need to think about this one like this:  On each trial, the 
computer is drawing 100 times with replacement from the 
$[0,0,0,0,1]$ box.  So the EV for the sum is $100 \times {1\over 5} = 20$ and
the SE for the sum is $\sqrt{100} \times \sqrt{(1/5)(4/5)} = 4$.  Now, we are repeating
that process 144 times.  So this should be like drawing 144 random
samples from a population with average $20$ and SD $ = 4$ and computing
the average.  The null hypothesis is that this is a good model for
the process the computer program is performing. 
But then the SE for the average is $4/\sqrt{144} = 4/12 \doteq .33$.
However, using the observed average 21.13, we get
$$z = {21.13 - 10\over .33} \doteq 3.39.$$
The chance of observing a $z$ value this big if the null hypothesis
is true is very small.  So there must be something wrong.  
\bigskip
\noindent
Chapter 27/2.  (a)  We want to test the alternative hypothesis
that box B contains a greater percentage of positive numbers
versus the null hypothesis that the two percentages are the 
same.  There are essentially two different ways that
are used to estimate standard errors in problems like this.  Let us
work the problem both ways and compare the results.  
\bigskip
\noindent
{\it Method 1:}  Use the bootstrap to estimate the SE for the 
percent from each box, then combine using the formula for
the SE for the difference:  
$${\rm SE}_A = \sqrt{(.5)(.5)\over 100} \times 100\% = 5\%$$
and
$${\rm SE}_B = \sqrt{(.524)(.476)\over 250}\times 100\% \doteq 3.2\% $$ 
Then
$${\rm SE}_{\rm diff} = \sqrt{SE_A^2 + SE_B^2} = \sqrt{5^2 + 3.2^2} \doteq 5.94\% .$$
If we wanted to combine the calculation into one formula,
the SE for the difference could be written like this:
$$\eqalign{
{\rm SE}_{\rm diff} &= \sqrt{ \left(\sqrt{(.5)(.5)\over 100}\right)^2 + 
\left(\sqrt{(.524)(.476)\over 250}\right)^2} \times 100\%\cr
&=\sqrt{{(.5)(.5)\over 100} + {(.524)(.476)\over 250}} \times 100\%\cr
&\doteq 5.91\%,\cr}$$
which is a more accurate approximation since we were not rounding
as we went along.
Note that in the simplified form on the second line above,
the terms under the square root here are {\it not squared}.
The squaring in the formula for the SE of the difference just gets
rid of the square roots in the formulas for ${\rm SE}_A$ and ${\rm SE}_B$. 
\bigskip
\noindent
{\it Method 2:}  The slightly troubling part of Method 1 is that if we
are thinking of an SE for computing $z$ in a hypothesis test, we usually
want to be doing the computation under the assumption the null hypothesis
is {\it true}, and that means that we should not be using the two separate
fractions $.5$ and $.524$.  The way to get around this objection is to
lump the two samples together and get a common value for the fraction of 
positive numbers like this:
$${50 + 131\over 350} \doteq .517$$
Then we just use this at both places in the formula for the SE
of the difference:
$${\rm SE}_{\rm diff} = \sqrt{{(.517)(.483)\over 100} + {(.517)(.483)\over 250}}
\times 100\% = 5.91\% $$
\bigskip
\noindent
Note that the two computations come out (almost) the same in 
this case(!)  This explains why people often use Method 1 -- it is a
computational shortcut that gives virtually equivalent results in most
cases.  Still, Method 2 is the ``logically correct way'' to estimate
SE's in this case, and I would say it is better for that reason.  

To finish the problem, using either estimate for ${\rm SE}_{\rm diff}$,
$$z = {52.4 - 50\over 5.9} \doteq .406$$
This means that the difference could easily be due to chance.  

The same comments apply in problems 3, 5, and part (a) of 7. 

\bigskip 
\noindent
4.  This was a tricky question that fooled most people.  So 
I treated it as an Extra Credit question in computing
the scores for the problem set.   Recall that
in applying the test for difference of means (or percents), we must
assume that the two random samples are independent.  We cannot do
that here, since it {\it the same group of people} that gave the 
ratings for doctors and for druggists.  The two-sample $z$-test should not
be applied in this situation.   
\bye
