Exercises for the Math 21b Bio/statistics section final exam
My
purpose here is to provide a collection of exercises that use the material from
these topics. The answers to the
exercises are at the end.
By the way, don’t take the exercises
as indicative of the final exam problems.
In particular, some are quite involved and are designed not so much to
test your knowledge as to broaden your view of a given topic as you work
through the answers. In any event, if
you can come to terms with the exercises below, you will do fine with the probability
and statistics part of the final exam.
1. Which of the following are not probability functions on [0, 1]?
a)
π sin(πx)
b) e-x c)
π cos(πx)
d) ![]()
2. Using the probability function e-x on [0, ∞), compute the probability that x
lies in [1, 2] È [3, ∞).
3. Use the constant
probability function
on [0, 2π] to
compute the probability that
sin2q is less than
.
4. Give the sample space [0, ∞) the exponential probability function e-x. Suppose that a and b are such that 0 ≤ a < b. Write down the probability that the random variable x ® x2 has a value between a and b.
5. Given that x is less than 4, what is the probability as computed using the exponential function e-x on [0, ∞) that x is greater than 2?
6. Take the Gaussian probability function
with mean 3 and standard deviation 2 for the line, (-∞, ∞). Are there sets A and B in (-∞, ∞)
such that P(A|B) =
, P(B|A) =
and P(B) =
?
7. Suppose that N is a positive
integer. Write down the sample space for
the possible outcomes of flipping N coins simultaneously. Write a sum that gives the probability of at
least three heads on the N coins if the probability of getting heads on any one
coin is
and if it is assumed
that the N coins act independently
8. Use the exponential function e-x as a probability function on [0, ∞).
a) What is the probability that the closest integer to x is odd?
b) What is the conditional probability that the integer closest to x is odd given
that x is larger than 1?
c) Is the event that the integer closest to x is odd independent from the event that
x is greater than 2?
9. Compute the mean and standard deviation of the random variable x ® x2 for the
probability
function
on [0, ∞).
10. Suppose that -∞ ≤ a < b
≤ ∞ and that p(x) is a probability function on [a, b] with mean m.
Explain why
x2 p(x) dx - m2
is the square of the standard deviation.
11. Use the
probability function
cos(x) on [-
,
]. What are the mean
and standard
deviation for the random variable x ® sin2(x)?
12. Use the probability function
cos(x) on [-
,
]. Which of the
following is the probability that the random variable sin2(x) has
value between 0 and
?
a)
b)
c) ![]()
d) ![]()
e)
13. Let
N be a positive integer, and let S denote the sample space for the possible
outcomes of N coin flips. Give N the
probability function for which the probability of any given coin landing heads
is independent from any other, and for which the probability of any given coin
landing heads is
. Define f to be the
random variable that multiplies the number of heads times the number of tails.
a)
Which is of the following is the mean of f:
N,
(N2+N),
N2,
N(N-1)?
b) Assume that N > 2 and is even. Is f independent of the random variable that
gives 0 when the number of heads is odd and 1 when the number of heads is even.
c) Write down a sum that gives the characteristic function for the random
variable that is 0 when the number of heads is odd and 1 when the number of heads is even.
14. Use the probability function
on [-π,
π]. Are the random variables x ® cos(x) and x ®
sin(x) independent?
15. Suppose that the probability that I am
sick on any particular day is
, the probability that I am absent any particular day is
, and the probability that I am absent given that I am sick
is
. If I am absent on a
given day, what is the probability that my absence is due to being sick?
16. Suppose that a system has four possible
states, that I’ll label as {1, 2, 3, 4}.
Suppose, in addition, that after any given unit of time, the probability
from going from any even state to any odd state is
, the probability of going from any even state to any even
state is
, the probability for going from any odd state to any even
state is
and the probability
from going from any odd state to any odd state is
. Let
(t) denote the vector whose k’th component is the probability
of being in state k at time t.
a)
Write down a matrix, A, such that the equation
(t+1) = A
(t) holds.
b)
What is limt®∞
(t)?
c)
Denote the vector you found in b) by
. Explain why
(1) =
as long as the
entries of
(0) sum to one.
17. Suppose that three coins are flipped simultaneously and we don’t know the probability of heads although we do know that the probability is the same for each coin, and that the probability for any one coin is independent of that for any other. Define a function, f, on the sample space to be 1 if there is an odd number of heads and zero otherwise. Thus, f has two possible values.
a) Given that the probability of heads on any coin is some p Î [0, 1], write down
the probability that f = 1 in terms of p.
b) In terms of p, what is the mean and standard deviation for f?
c) Suppose that we now flip the three coins some large number of times and see
that the average value of f is
. According to the
Central Limit Theorem, which of the following is the choice for p:
,
,
,
?
d)
If the fraction of times f is 1 after a large number of flips is
, what would a
Bayesian guess for the probability function on the sample space for flipping three coins?
18. Suppose that an experiment is repeated
100 times and a certain measurement can have one of two values either 1 and 0
each time. In this regard, assume that
the probability of measuring 1 is the same for each run, and that the
probability for a measurement on any given run is independent of that for any
other. If the probability of measuring 1
on any given run is postulated to be
, what is the probability of precisely n Î {0, 1, …, 100} of the runs giving the
measurement 1?
19. As in Problem 18, suppose that an experiment is repeated 100 times and a certain
measurement can have one of two
values either 1 and 0 each time. Assume that the probability of measuring 1 is
the same for each run, and that the probability for a measurement on any given
run is independent of that for any other.
As before, assume that the probability of measuring 1 on any given
experiment is
. Let n denote the number
of times that 1 is measured.
Differentiate some number of times the characteristic polynomial for the
associated binomial probability function to determine the mean of the random
variable n ® f(n) where f(0) = f(1) =
f(2) = 0 and f(n) = n(n-1)(n-2) in the case that n ≥ 3.
20. Continue
here with the set up used in the previous two problems. Suppose that the measured number of
occurrences of the measurement 1 is 25 after 100 runs of the experiment. Given that you will abandon your assumption
of
as the probability of
getting 1 on any given run if the P-value for the number of occurrences is less
than
, should you do so?
21. Make up a scenario where you would want to use a Poisson probability function to predict the frequency of occurrences in repeated runs of a given experimental protocol.
22. Suppose that a given situation has
possible outcomes in the set {0, 1, 2, …} of non-negative integers and is
modeled using the Poisson probability function with mean 25. Explain why
is an upper bound for
the probability of measuring n ≥ 40 and why
is an upper bound for
measuring n ≥ 50.
23. Suppose that large meteor hits on the earth are unrelated and that the average time between hits is 30 million years.
a) Use an exponential probability function to determine the probability of a large
meteor hitting the earth in the next 100 years (your lifetime plus change).
b) Given that the last large meteor hit on the earth was 65 million years ago, what
is the probability of a large meteor hitting the earth in the next 100 years?
24. Suppose that a given experiment is repeated many times and a certain quantity is measured each time. Suppose that the mean of the measurements is 10 and the variance is 2. (The square of the variance is the sum of the squares of the differences from the mean.)
a) Write down the most likely Gaussian probability function to use to predict the
fraction of measurements that lie between 6 and 8.
b) Use your answer to Part a to write down an integral that gives the desired
prediction.
25. Suppose that the birth weights of new born children in Iceland distribute in a random fashion between 6 and 9 pounds. Give a Gaussian probability function that can be used to predict the average birth weight of 1000 Icelandic babies.
26. Redo Problem 25 when the variations in
the birth weights of new born children in Iceland are modeled instead by the
Gaussian probability function with mean 7.5 and standard deviation
√3.
27. In Las Vegas, you can gamble on the outcome of rolling a pair of six sided dice.
The sides of each die are numbered
from 1 to 6 and you win if the sum of the numbers showing on top are either 7
or 11. You lose otherwise. The probability of winning if the dice are
unbiased is
. If you are
interested in determining whether the dice used are fair, you can watch the
game played many times. Suppose that you
watch N games.
a) Assuming the dice are fair, give an expression in terms of n Î {0, 1, …, N} for
the probability of n wins in N games.
b) Use the Central Limit Theorem to estimate an upper bound for the probability of
seeing less than 144 wins in 900 games under the assumption that the dice are fair. You needn’t evaluate square roots or exponentials that appear in your answer.
28. Let S denote the sample space of pairs of the form (j, k) where j and k are
integers in the set {1, …, n}. Suppose that S has a probability function, and let P(j|k) denote the conditional probability that the first entry in a pair is j given that the second entry is k.
a) Explain why the matrix whose entry in the j’th column and k’th row is P(j|k) is a
Markov matrix.
b) Suppose that A is an n ´ n Markov matrix and p is a probability function on the
set {1, …, n}. Use A and p to determine a probability function on S with the following two properties: First, p(k) is the probability that the second entry of any given pair from S is k. Second, the conditional probability P(j|k) is Ajk.
29. Let A denote the Markov matrix
. Suppose that
(0) =
and that for
any t Î {1,2,…}, the vector
(t) is defined to equal A
(t-1).
a)
What is limt®∞
(t)?
b)
How big must t be before before the difference between this limit and
(t) is a
vector whose length is less than
?
30. Suppose
that the concentration in the blood of a given medicinal drug is measured as a
function of time. In particular, suppose
that measurements are made at a sequence of times t1 < t2
< ··· < tn, that yield the corresponding sequence of values {y1,
…, yn}. In addition, suppose
that it is believed that the function, t ®
y(t), that describes the concentration as a function of t must have the form
y(t) = a e-t + b e-2t where a and b are constants. Derive an expression in terms of the data {(tk,
yk)} for the pair (a, b) that minimize ∑k (y(tk)
– yk)2.
1. b) is not normalized to have integral 1 and c) is negative in places.
2. e-1 – e-2 + e-3 which is the sum of the integrals of e-x over the two regions.
3. The function
sin2q is less than
on
of the circle, so the
probability is
.
4. e-√a – e-√b. Indeed, x2 is between a and b, if and only if x is between √a and √b.
5. (e-2 – e-4)/(1 – e-4).
6. No. Here is why: Since P(A|B) = P(A Ç B)/P(B) and P(B|A) = P(A Ç B)/P(A), one has p(A) = P(A|B) P(B) P(B|A)-1. With the numbers given, this would give p(A) > 1.
7. S is the set of all N-tuples of the
form (a1, …, aN) where each ak can be either H
or T. The probability is ∑k=3,4,…
(
)k(
)N-k.
8. a)
The closest integer to x is odd if and only if 2k+
< x < 2k+
for some
integer k from the set {0, 1, 2, …}. Thus, the probability is
e-1/2 – e-3/2 + e-5/2 – e-7/2 + ··· = e-1/2 ∑k=0,1,2,… (-1)k e-k = e-1/2 (1 + e-1)-1.
b) This is (e-1 – e-3/2 + e-5/2 – e-7/2 + ···)/e-1 = 1 - e-1/2 (1 + e-1)-1.
c) Yes. The probability that the closest integer to x is odd and x is greater than 2
is equal to e-5/2 – e-7/2 + ··· which is e-2(e-1/2 - – e-3/2 + e-5/2 – e-7/2 + ···). The latter is the product of the probability that x is greater than 2 (this being e-2) with the probability found from a) that the closest integer to x is odd. A similar argument shows that the event that the integer closest to x is odd is independent from the event that x is greater than any given even integer.
9. The mean is
and the standard
deviation is
.
10. As defined, s2
=
(x - m)2
p(x)dx and writing out the square finds this equal to
x2 p(x)dx – 2m
x p(x)dx + m2
p(x)dx. Since the
integral that appears in the middle term is m
and that in the final term is 1, this is
x2 p(x) x – 2m2
+ m2.
11. The mean is
and the standard
deviation is
.
12.
.
13. a) Let n denote the number of heads. Then f = n (N – n). We know that n can
take values in {0, …, N} and that
the probability of any given value, k, from this set is given by Ã(k) =
(
)k(
)N-k. Thus,
the mean of n is
N and that square of the standard deviation of n is
N. Now, the square of the
standard deviation is the mean of n2 -
N2, so the mean of n2 is
N +
N2. Thus,
the mean of f is N times the mean of n minus the mean of n2. Granted this, then the mean of f is therefore
be equal to
N2 -
N -
N2 =
N(N-1).
b) When n is even, then f is even; and when n is odd, then f is odd. Thus, the
random variable that gives 0 when
n is odd and 1 when n is even can be written as
(1 + (-1)f).
This shows that the two random variables can not be independent.
c)
Let a = ∑k is odd and
1≤k≤N
(
)k(
)N-k, thus a
is the probability that n is odd.
The characteristic functional is
equal to (1-a) + a t .
Note that the sum for a can be
computed in closed form: a =
+(
)N+1.
14. These two random variables are not independent. This can be seen from the fact
that the absolute value of one can be deduced knowing that of the other.
15.
. Use Bayes’
rule: P(Sick|Absent) = P(Absent|Sick)
P(Sick)/P(Absent).
16. a)
.
b)
= ![]()
c) Since the span of the image of A is 1 dimensional (all of its columns are the
same), A has three eigenvalues that are
zero. Denoting these by
1,
2 and
3,
the vector
(0) must have the form
+ a1
1 + a2
2 + a3
3 since the entries of each
k sum to zero and the entries of
sum to 1. Thus, A
(0) =
.
17. a) p3 + 3 p (1-p)2 = p (4p2 – 6p + 3).
b) m = p (4p2 – 6p + 3) and s = (m-m2)1/2.
c) ![]()
d) P(HHH) = P(HTT) = P(THT) = P(TTH) =
,
P(TTT) = P(THH) = P(HTH) = P(HHT) =
.
To explain, the task is to guess the values for a probability function, p, on the
set {HHH, HHT, HTH, THH, HTT, THT, TTH, TTT}. Label these elements
from 1 to 8. Let q0 =
and q1 =
. Then one can write q0
= p5+p6+p7+p8 and
likewise write q1 = p1+p2+p3+p4. This has the form of qa = ∑1≤j≤8 Baj pj. The
Bayesian will take pj = ∑a=1,2 (Baj/(∑k Bak) qa)
18.
(
)n(
)100-n .
19. The characteristic function is the
polynomial in t given by t ® Ã(t) = (
+
t)100. This
is equal to ∑0≤n≤100 tn p(n) where p(n)
=
(
)n(
)100-n is the probability of seeing n occurrences
of 1. Differentiating the identity Ã(t) = ∑n tn p(n)
three times finds that its third derivative at t = 1 equals ∑n≥3
n (n-1) (n-2) p(n). This is the mean of
the random variable f(n). Meanwhile,
differentiating (
+
t)100 three times and setting t = 1 gives
100·99·98/1000 = 88.2. Thus, the mean is
88.2.
20. Yes. The mean for the binomial
probability in this case is 10 and the standard deviation is 3. As 25-10 = 15 = 5s, and the square of 5 is 25, the Chebychev inequality asserts
that the probability of 25 or more occurrences of 1 is less than
.
21. The average number of large meteor hits on the earth is 1 per 30 million years. Assuming that these meteors are not travelling together (i.e. not two halves of some broken comet), how likely is it for a two huge meteors to hit the earth in 2005?
22. The mean is 25 so the standard deviation is 5. Granted this, use the Chebychev inequality.
23. a) 1- e-x where x = 3 ´ 10-5. This is pretty close to 3 ´ 10-5.
b) 1 – e-x where x = 3 ´ 10-5.
24. a)
e
.
b) ![]()
e
dx
25.
e![]()
26.
e![]()
27. a)
.
b) Let S = {W, L} where W means win and L means lose. Define a random
variable, f, on S so that f(W) =
1 and f(L) = 0. The mean of f is mean
and the standard
deviation is
√2. Let {f1,
…, f900} denote 900 identical versions of this same random
variable. According to the central limit
theorem, the probabilities for the values of f =
(f1+ ···+ f900) are determined by the
Gaussian probability function with mean
and standard deviation
√2. Now,
differs from
by
and this is R (
√2) where R = 18 (5√2)-1.
The Central Limit Theorem therefore finds that the probability of less
than 144 wins is less than
e-81/25.
28. a) Each P(j|k) is non-negative since these are probabilites, and P(1|k)+···+P(n|k) =
1 for each k since the sum of the conditional probabilities must be 1.
b) The definition of the conditional probability tells us that we should set P(j|k) to
equal the p((j,k))/p(k). Thus, p((j,k)) = P(j|k) p(k) = Ajk p(k).
29. a) This limit is
1 =
.
b) The other eigenvalue is -
and the eigenvector is
2 =
. Thus,
(0) =
1 - ![]()
2 and
(t) -
1 = -
(-
)t
2 has norm √2
(
)t. Thus,
we
need t ≥
ln(
√2).
30. Let A denote the matrix with n rows and 2
columns whose k’th row is (e
, e
). Then
= (ATA)-1AT![]()
where
is the vector in Rn
whose k’th entry is yk.