

Hypothesis Testing: Dichotomous Variables
Practice Problems (Answers)
Homework
For discrete variables:
P(A)=  # outcomes favoring A Total # possible outcomes 
Ex. Probability of drawing an ace from a deck of cards is 4/52.
For continuous variables:
P=  Area under a portion of the curve Total area under the curve 
Since the total area under the curve is 1, we define P as the proportion of area under the curve. For example, as we saw in the section on relative standing, the probability of choosing a random person with an IQ between 85 and 115 is .6826
This problem will help illustrate the terms defined above as well as the basic logic for all of hypothesis testing. Let’s say you use a coin to help you make decisions. 'Heads' means you study and 'tails' means you socialize. However, you feel that you are getting the raw end of the deal and believe the coin is biased. Thus, the research question asks whether the coin is biased. Let us examine the method for answering this question. Before we are ready to start flipping the coin a bunch of times and test the hypothesis, we need to get a deeper understanding of the concept of a Binomial Distribution that we defined above.
Explanation
First let us consider what can happen if we toss a coin once (i.e., N=1). The possible outcomes are:
In summary, the binomial distribution for N=1 is:
Possible outcomes  H^{1}T^{0}  H^{0}T^{1} 

Probability  1/2  1/2 
Next let us consider what can happen if we toss a coin twice (i.e., N=2). The possible outcomes are:
Note, however, that the head and a tail can occur in 2 ways (HT or TH). Thus, the possible outcomes are:
2 heads (1H^{2}), a head and a tail (2H^{1}T^{1}), and 2 tails (1T^{2}).
In summary, the binomial distribution for N=2 is:
Possible outcomes  H^{2}T^{0}  2H^{1}T^{1}  H^{0}T^{2} 

All possible outcomes  HH  HT TH 
TT 
Probability  1/4  2/4  1/4 
Now consider tossing the coin three times (i.e., N=3):
Different Possible outcomes  H^{3}T^{0}  H^{2}T^{1}  H^{1}T^{2}  H^{0}T^{3}  ∑coefficients=8 

All possible outcomes  HHH  HHT HTH THH 
HTT THT TTH 
TTT  
Coefficients (or # all possible outcomes) 
1  3  3  1 
Thus, the binomial distribution for N=3 is:
Possible outcomes  H^{3}T^{0}  H^{2}T^{1}  H^{1}T^{2}  H^{0}T^{3} 

Probability  1/8  3/8  3/8  1/8 
As you might guess, constructing a binomial when N>3 gets to be difficult and thus there are more efficient methods.
A couple of methods to generate coefficients more quickly:
(a + b)^{2} = (a + b)(a + b) = 1a^{2} + 2ab + 1b^{2} (a + b)^{3} = (a + b)(a + b)(a + b) = (a + b)(a^{2} + 2ab + b^{2}) = a^{3} + 2a^{2}b + ab^{2} + a^{2}b + 2ab^{2} + b^{3} = 1a^{3} + 3a^{2}b + 3ab^{2} + 1b^{3}Note that the exponent equals the number of tosses and the formula gives the coefficients. However, this, too, is a tedious technique.
N  Coefficients  N+1  2^{n} 

1  1 1 
2 

2  1 2 1 
4 

3  1 3 3 1 
8 

4  1 4 6 4 1 
16 

5  1 5 10 10 5 1 
32 

6  1 6 15 20 15 6 1 
64 

7  1 7 21 35 35 21 7 1 
128 

8  1 8 28 56 70 56 28 8 1 
256 

9  1 9 36 84 126 126 84 36 9 1 
512 

10  1 10 45 120 210 252 210 120 45 10 1 
1024 
Thus, this technique works well with small N's.
Hypothesis Name  Meaning  Comments  

Null or H_{o}  The coin is fair  p=q  Always an exact statement 
Alternative or H_{A }or H_{1}  The coin is funny  p≠q  Never an exact statement 
Improbable Due to Chance 
Probable Due to Chance 

Alternative Hyp.  Type  Meaning  Test to be used 

p≠q  Nondirectional  Coin is biased.  Twotailed 
p<q  Directional  Coin is biased for T.  Onetailed 
p>q  Directional  Coin is biased for H.  Onetailed 
Nondirectional tests are most common. Directional hypotheses are sometimes used when we have a theory and/or prior data that leads us to such a specific prediction. To keep things simple, in this class, we will use twotailed tests exclusively.
 Research Question
Is the coin biased?
 Hypotheses
Let p equal the probability of a head and q the probability of a tail.
In Symbols In Words H_{o} p=q The coin is fair H_{A} p≠q The coin is funny These hypotheses should be specific to what is being tested (in this case, the coin).
Possible outcomes 
H^{10}T^{0}  H^{9}T^{1}  H^{8}T^{2}  H^{7}T^{3}  H^{6}T^{4}  H^{5}T^{5}  H^{4}T^{6}  H^{3}T^{7}  H^{2}T^{8}  H^{1}T^{9}  H^{0}T^{10} 

P  
The probabilities of an event as rare as 9 heads are shown in color above and are summed below.
Event  Probability 

10 heads  .001 
9 heads  .010 
9 tails  .010 
10 tails  .001 
Total  = .022 (or .011 x 2) 