You are on page 1of 2

Ismor Fischer, 8/19/2009

1.5 Problems

In this section, we use some of the terminology that was introduced in this chapter, most of which
will be formally defined and discussed in later sections of these notes.

1-1. Suppose that n =100 tosses of a coin result in X =38 Heads. What can we conclude about
the fairness of the coin at the =.05 significance level? At the =.01 level?

1-2. Suppose that a given coin is known to be fair or unbiased (i.e., the probability of Heads
is 0.5 per toss). In an experiment, the coin is to be given n =10 independent tosses,
resulting in exactly one out of 2
possible outcomes. Rank the following five outcomes in
order of which has the highest probability of occurrence, to which has the lowest.

Outcome 1: (H H T H T T T H T H)

Outcome 2: (H T H T H T H T H T)

Outcome 3: (H H H H H T T T T T)

Outcome 4: (H T H H H T H T H H)

Outcome 5: (H H H H H H H H H H)

Suppose now that the bias of the coin is not known. Rank these outcomes in order of which
provides the best evidence in support of the hypothesis that the coin is fair, to which
provides the best evidence against it.

1-3. Let X =Number of Heads in n =50 random, independent tosses of a fair coin. Then the
expected value is E[X] =25, and the corresponding p-values for this experiment can be
obtained by the following probability calculations (for which you are not yet responsible).

P(X 24 or X 26) = 0.8877

P(X 23 or X 27) = 0.6718

P(X 22 or X 28) = 0.4799

P(X 21 or X 29) = 0.3222

P(X 20 or X 30) = 0.2026

P(X 19 or X 31) = 0.1189

P(X 18 or X 32) = 0.0649

P(X 17 or X 33) = 0.0328

P(X 16 or X 34) = 0.0153

P(X 15 or X 35) = 0.0066

P(X 14 or X 36) = 0.0026

P(X 13 or X 37) = 0.0009

P(X 12 or X 38) = 0.0003

P(X 11 or X 39) = 0.0001

P(X 10 or X 40) = 0.0000

P(X 0 or X 50) = 0.0000

Now suppose that this experiment is conducted twice, and X =18 Heads are obtained both
times. According to this chart, the p-value =0.0649 each time, which is above the =.05
significance level; hence, both times, we conclude that the sample evidence seems to
support the hypothesis that the coin is fair. However, the two experiments taken together
imply that in this random sequence of n =100 independent tosses, X =36 Heads are
obtained. According to the chart on page 1-4, the corresponding p-value =0.0066, which
is much less than =.05, suggesting that the combined sample evidence tends to refute the
hypothesis that the coin is fair. Explain this apparent discrepancy.

Ismor Fischer, 8/19/2009
1-4. In this problem, we will use the R programming language to simulate n =100 random
tosses of a coin.

(a) First, assume the coin is fair or unbiased (i.e., the probability of Heads is 0.5 per toss),
and use the Binomial distribution to generate a random sequence of n = 100
independent tosses; each outcome is coded as Heads =1 and Tails =0.

pr ob <- 0. 5 ( )
seq <- r bi nom( 100, 1, pr ob)
seq # view the sequence
sum( seq) # count the number of Heads

From the chart on page 1-4, calculate the p-value of this experiment. At the =0.05
significance level, does the outcome of this experiment tend to support or reject the
hypothesis that the coin is fair? Repeat the experiment several times.

(b) Suppose we run this experiment 500 times, and count the number of Heads each time.
Let us view the results, and display some summary statistics,

X <- r bi nom( 500, 100, pr ob)
sor t ( X)
t abl e( X)
summar y( X)

as well as graph them, using each of the following methods, one at a time.

st r i pchar t ( X, met hod =" st ack" , yl i m=r ange( 0, 100) , pch =19)
# Dotplot
st em( X, scal e = 2) # Stemplot

hi st ( X) # Histogram

(c) Now compare the sample proportions obtained, with the theoretical probabilities on page 1-4.

l ower <- 49: 0
upper <- 51: 100

pr op <- NULL
f or ( k i n 1: 50) {l ess. eq <- whi ch( X <= l ower [ k] )
gr eat er . eq <- whi ch( X >= upper [ k] )
v <- c( l ess. eq, gr eat er . eq)
pr op <- c( pr op, l engt h( v) / 500) }

cbi nd( l ower , upper , pr op)

(d) Suppose now that the coin may be biased. Replace line ( ) above with the following R
code, and repeat parts (a) and (b).

pr ob <- r uni f ( 1, mi n = 0, max = 1)

Also, estimate the probability of Heads from the data. Check against the true value of pr ob.