0% found this document useful (0 votes)
162 views6 pages

36-225 - Introduction To Probability Theory - Fall 2014: Solutions For Homework 1

The document provides solutions to exercises from an introduction to probability theory course. It includes: 1) A histogram and calculations for exercise 1.4 on the percentage of outstanding shares held by insiders. 2) Calculations and explanations for exercise 1.10 on the empirical rule and internet usage. 3) Removing an outlier value and verifying that the empirical rule holds for the remaining data in exercise 1.16.

Uploaded by

Nick Lee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
162 views6 pages

36-225 - Introduction To Probability Theory - Fall 2014: Solutions For Homework 1

The document provides solutions to exercises from an introduction to probability theory course. It includes: 1) A histogram and calculations for exercise 1.4 on the percentage of outstanding shares held by insiders. 2) Calculations and explanations for exercise 1.10 on the empirical rule and internet usage. 3) Removing an outlier value and verifying that the empirical rule holds for the remaining data in exercise 1.16.

Uploaded by

Nick Lee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

36-225 Introduction to Probability Theory Fall 2014

Solutions for Homework 1


1) Exercise 1.4 (12 pts)
a) One can construct the histogram in a manner similar to that shown in the first set of lecture
notes:
> d = scan("otc.dat")
Read 40 items
> hist(d,prob=T,col="blue",xlab="Percentage of Outstanding Shares",main="")

0.15
0.00

0.05

0.10

Density

0.20

0.25

0.30

As noted on the homework assignment sheet, using prob=T does not give you a relative
frequency histogram, but rather a density histogram. From this, you could construct a relative
frequency histogram by multiply each bin height by each bin width.
The histogram:

10

12

Percentage of Outstanding Shares

b) You can obviously do this by hand: 18 of 40 values are greater than 4%, so the proportion is
0.45 or 45%. In R:
> length(which(d>4))/length(d)
[1] 0.45
c) You can also do this by hand: 29 of 40 values are less than 5%, so the probability is 0.725. In
R:
> length(which(d<5))/length(d)
[1] 0.725
2) Exercise 1.10 (4 pts)
a) One standard deviation below the mean is 14 17 = 3.
b) By the empirical rule, the proportion of those who spend between 3 and 31 hours per year
on the Internet should be 68%. Thus the probability of observing a single person with Internet
usage below -3 hours or above 31 hours is 32%; since symmetry of the underlying population
is implicitly assumed, we can state that the probability of observing a value less the -3 to be
32%/2 or 16%.
c) Its pretty obvious that time spent doing an activity cannot be negative. So the distribution
must be cut off at zero hours, and as a result it cannot be bell-shaped or mound-shaped...so
the empirical rule does not hold here.

3) Exercise 1.16 (8 pts)


There are many ways to take out the largest value of otc.dat; one especially pithy way is
> dprime = sort(d)[-length(d)]
> dprime
[1] 2.61 2.62 2.63 2.68 2.69 2.74 2.74 2.88 2.89 2.99 3.03 3.11 3.20
[14] 3.26 3.36 3.44 3.48 3.62 3.69 3.78 3.93 3.94 4.05 4.40 4.43 4.55
[27] 4.79 4.81 4.94 5.07 5.26 5.49 5.91 5.98 6.07 6.27 7.13 7.15 7.99
(Another way, if you use R Studio, is to go to the Console window, type fix(d), go to the new
window displaying the data, delete the largest value, and click save. If you do this, substitute d
for dprime over the rest of the solution below.) Then:
> xbar = mean(dprime)
> s = sd(dprime)
> c(xbar,s)
[1] 4.194872 1.441822
> c(xbar-s,xbar+s)
[1] 2.753049 5.636694
> c(xbar-2*s,xbar+2*s)
[1] 1.311227 7.078517
> c(xbar-3*s,xbar+3*s)
[1] -0.1305955 8.5203391

# 4.39 1.87
# 2.52 6.26
# 0.65 8.13
# -1.22 10

The numbers to the right of the # signs are the answers from Exercise 1.15. The lesson: one
outlier can significantly affect results, by shifting the sample mean and increasing the sample
standard deviation.
What we have not done yet is to do the comparison with the empirical rule:
> length(which(abs(dprime-xbar)<s))/length(dprime)
[1] 0.6410256
> length(which(abs(dprime-xbar)<2*s))/length(dprime)
[1] 0.923077
> length(which(abs(dprime-xbar)<3*s))/length(dprime)
[1] 1
These results indicate that the empirical rule approximately holds, thus the underlying population
is bell-shaped or mound-shaped.

4) Exercise 1.24 (12 pts)


a) Exercise 1.17 indicates that we can approximate the population standard deviation using the
sample range divided by 4:
> d = scan("aqua.dat")
Read 20 items
> (max(d)-min(d))/4
[1] 8.5
> r = range(d)
# alternative approach
> (r[2]-r[1])/4
# youd expect range to give the range, but oh well
[1] 8.5

0.03
0.02
0.00

0.01

Density

0.04

0.05

b) The histogram:

80

90

100

110

Heart Rate (bpm)

A visual approximation to the mean is y 95. (Your estimate may vary.) To estimate s, we
need the central 68% or so of the empirical distribution. The central two bins have relative
frequency 5 0.05, so combined they have 50% of the values. Lets add one bin to either side:
5 0.02 + 5 0.01 = 0.15, or 0.65 in all. This is close enough for government work. So s would be
the total width of the included bins (20) divided by 2, or s 10.
c) Using R, we get
> mean(d)
[1] 93.7
> sd(d)
[1] 9.553726
These compare favorably with our by-eye estimates of 95 and 10.
d) Using R, we get
> n = length(d)
> length(which(abs(d-mean(d))<sd(d)))/n
[1] 0.65
# expect 0.68 -- GOOD
> length(which(abs(d-mean(d))<2*sd(d)))/n
[1] 1
# expect 0.95 -- OK
> length(which(abs(d-mean(d))<3*sd(d)))/n
[1] 1
# expect 1.00 -- GOOD
Why did the empirical rule break, at least for the y 2s limits? Look at the histogram: the
leftmost bin indicates a deviation from a bell shape. These relative outliers bias our estimation
of the population standard deviation upwards, so the y 2s range becomes larger than it should
be.
5) Exercise 1.32 (12 pts)
We begin with the definition of sample variance:
" n
#
X
1
2
2
s =
(yi y)
n 1 i=1
" n
#
X
2
2
(n 1)s =
(yi y)
i=1

(n 1)s2

"n
in
X
i=1

(yi y)2 +

n
out
X
i=1

#
(yi y)2 .

Here, nin is the number of measurements in the range y ks, while nout is the number of outside
that range. Heres the key: the left summation can be anything from 0 to nin k 2 s2 , while the right
summation can be anything from nout k 2 s2 to . Thus the minimum value on the right-hand
side of the equality is 0 + nout k 2 s2 = nout k 2 s2 . So now we know
(n 1)s2

nout k 2 s2

(n 1) nout k 2 .
However, if n 1 is nout k 2 , then n > nout k 2 . So:
n
n
nout
nout
n
n nin
n
1f
f

>

nout k 2

>

k2

<
<
<

1
k2
1
k2
1
k2

> 1

1
.
k2

We will return to Tchebysheffs theorem in future lectures.


6) Exercise 1.38 (8 pts)
Ill answer this in the form of a table:
k
1
2
3

f
1 1/1 = 0.000
1 1/4 = 0.750
1 1/9 = 0.889

Lower Bound
0
0
0

Upper Bound
34+53 = 87
34+253 = 140
34+353 = 193

What we find is that (a) Tchebysheffs theorem says nothing useful about k = 1, just that none
of the data are required to be within the range (0,87) (where we truncate the effective lower
limit at zero, since chloroform amounts cannot be negative); (b) 75% of the data has to be in the
range (0,140), and (c) 88.9% of the data has to be in the range (0,193). (You can add other k
values as well.) The theorem says nothing else, i.e., there are no restrictions on the shape of the
underlying distribution.
7) Problem 7 (8 pts)
to help us: A = A S = A (B B)
=
a) Here, we use the fact that the sample space S = B B

(A B) (A B).
= S (A B)
=
b) Here, we use S as well as the equality of part (a): (A B) = A B

(A A) (A B) = A (A B) = (A B) (A B) (A B).
=
c) We have that A = {1, 3, 5}, and thus A = {2, 4, 6}, and that B = {1, 2, 3}, and thus B
{4, 5, 6}. For the left side of part (b), we find that A B = {1, 3} = {2, 4, 5, 6}, while for the
right side, we have that
(A B)

(A B) (A B)

({2, 4, 6} {1, 2, 3}) ({2, 4, 6} {4, 5, 6}) ({1, 3, 5} {4, 5, 6})

= {2} {4, 6} {5}


= {2, 4, 5, 6} .

8) Problem 8 (8 pts)
While the solutions are presented below, it may be helpful to you to illustrate these solutions to
yourself using a number line graph.
a) A = {y : 1 y 5} = {y : y < 1 or y > 5} = {y : y < 1} {y : y > 5}. Note that the or
could also be written in set-builder notation as .
b) A B = {y : 1 y 5} {y : 3 < y 7} = {y : 1 y 7}
c) Here, we have that
B C

= {y : 3 < y 7} {y : y 0}
= {y : 3 < y 7} {y : y > 0}
= {y : 3 < y 7} = B

d) Here, we have that


C
A B

= {y : 1 y 5} {y : 3 < y 7} {y : y 0}
= {y : y < 1 or y > 5} {y : y 3 or y > 7} {y : y > 0}
= {y : y < 1 or y > 7} {y : y > 0}
= {y : 0 < y < 1} {y : y > 7}

e) (A B) C = {y : 1 y 7} {y : y 0} = , where we apply the answer of part (b).


9) Exercise 2.14 (8 pts)
Let N be the event that the adult needs glasses and U be the event that the adult uses glasses.
Then we can rewrite the interior of the 2 2 table as
) = 0.14
P (N U

) = 0.40
P (N U

P (N U ) = 0.44
U ) = 0.02
P (N

) by Axiom 3. Thus P (N ) = 0.44+0.14 = 0.58.


a) Needs glasses = P (N ) = P (N U )+P (N U
) = 0.14.
b) Needs glasses but does not use them = P (N U
) by Axiom 3. Thus
c) Uses glasses [regardless of need] = P (U ) = P (U N ) + P (U N
P (U ) = 0.44 + 0.02 = 0.46.

10) Exercise 2.16 (8 pts)


From the problem text it is straightforward to define the probabilities of having each blood type:
P (O+ ) =

a) P (O+ ) =

1
,
3

P (O ) =

1
,
15

P (A+ ) =

1
,
3

P (A ) =

1
16

1
3

b) P (O) = P (O+ ) P (O ) = P (O+ ) + P (O ) =


fact that O+ and O are disjoint events.
c) P (A) = P (A+ ) P (A ) = P (A+ ) + P (A ) =

1
3

1
3

1
15

1
16

6
15 ,

where the + follows from the

19
48

d) P (neither O or A) = P ((O A)) = 1 P (O A). Since O and A are disjoint events, 1


6
49
P (O A) = 1 P (O) P (A) = 1 15
19
48 = 240 .

11) Problem 11 (8 pts)


Let E, M, S denote the event of a random selected student having an Economics, Mathematics,
and Statistics major respectively. Then:
P (E)

P (M )

P (S)

P (E M S)

P (M E)

P (S E)

40
120
50
120
65
120
2
120
5
120
22
120

=
=
=
=
=
=

1
3
5
12
13
24
1
60
1
24
11
60

) = P (S E) P (E S M ) = 11 1 = 1
a) P (E S M
60
60
6
S)
= P (E) P (E M ) P (E S) + P (E M S) =
b) P (E M

1
3

11
60

1
24

1
60

1
8

12) Exercise 2.22 (4 pts)


By Axiom 3, the probability of event A can be treated as the sum of probabilities of two disjoint

events, A B and A B:



P (A) = P (A B) (A B)
.
= P (A B) + P (A B)
Since we are given that B A, we know A B = B. So:
.
P (A) = P (B) + P (A B)

You might also like