You are on page 1of 14

1. Consider two events A and B such that Pr(B) = 1/2 and Pr(A) = 1/3.

Determine the value of Pr(B


∩ Ac) for each of the following conditions:
• A and B are mutually exclusive.
• A ⊂ B.
• Pr(A ∩ B) = 1/8.

Answer: (a) Pr(B ∩ 𝐴𝑐 ) = Pr(𝐴𝑐 ) + Pr(B)-Pr(B ∪ 𝐴𝑐 )

= Pr(𝐴𝑐 ) + Pr(B)-( Pr(𝐴𝑐 ) + Pr(B)) = 0

= Pr(B ∩ 𝐴𝑐 ) = 0

(b) Pr(B ∩ 𝐴𝑐 )= Pr(𝐴𝑐 ) =2/3

c) Pr(B ∩ 𝐴𝑐 ) = Pr(B)- Pr(A ∩ B)


1 1 3
= − =
2 8 8

2. A computer password consists of nine characters


• How many different passwords are possible if each character may be any lowercase letter or
digit?
• How many different passwords are possible if each character may be any lowercase letter or
digit and at least one character must be a digit?
• A computer system requires that passwords contain at least one digit. If 9 characters are
generated at random, and each is equally likely to be any of the 26 letters or 10 digits, what is the
probability that a valid password will be generated?

Answer: (A) the possible passwords would be 9! = 362880.

(B) The different passwords are possible if each character may be any lowercase
letter or digit and at least one character must be a digit = 369 − 269 = (369 − 269 ) = 9.7 ×
1013 .

(C ) = 269 + 10 9 = 5.4 × 1012 .


3. Let A and B be events with Pr(B) = 0.5, Pr(A ∪ B) = 0.8. What is the value of Pr(A) when A and B
are independent?

Answer: , Pr(A ∪ B) = Pr(B) + Pr(A)- = Pr(B ∩ A )

0.8 = 0.5 + Pr(A) –(0.8) × (0.5)

Pr(A)= 0.7

4. A manufacturing plant has 3 different machines denoted M1, M2 and M3. 20%, 35% and 45% of
the production comes from machines M1, M2 and M3 respectively. 3% of the production from M1
is defective, 2% of the production from M2 is defective and 1% of the production from M3 is
defective.
• Compute the production of defective items from this manufacturing plant.
• A truck load of items is brought to quality control clerk who randomly selects one item and finds
it to be defective. What is the probability that this item was manufactured by machine M2?

Answer:
Pr(All defective) = 0.2× 0.03 + 0.35 × 0.02 + 0.45 × 0.01 = 0.0175
In percentage = 1.8 %
0.35∗0.03
b) Pr(M2 defective) = = 0.4
0.0175

5.The return on a one unit investment is found to be a discrete random variable X with probability
mass function given by
𝑐(𝑥 2 +1) 𝑥=−2,0,3
{
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑤
Find the value of c that makes pX(x) a valid probability mass function

Answer : ∑ 𝑐( 4 + 0 + 9 + 4) = 1

C = 1/17

6.
The time to failure (in years) of a certain engine component is a continuous random variableY with
cdf given by
16
F(y) = 1- y>0
(𝑦+4)2
Compute the probability that this component will last at most 6 years.

Answer: probability that this component will last at most 6 years


16 16
F(6) – F(0) = 1- (1 − (6+4)2) − ( 1 − (0+4)2
) = 0.84

7.

Consider a special 8 sided die with 1 face painted 1, 2 faces painted 2, 3 faces painted 3 and 1 face
painted 4 and 1 face painted 5. Assume now that the die is loaded so that the face painted 5 is
three times more likely than each of the other faces. The die is rolled and the face observed.
Determine the sample space and compute the probability that an odd number appears.

Answer: sample space ={ 1,2,3,4,5,6,7,8}


𝑜𝑑𝑑 𝑛𝑢𝑚𝑏𝑒𝑟𝑒𝑑 𝑓𝑎𝑐𝑒𝑠 4
Pr (odd) = = = 0.5
𝑡𝑜𝑡𝑎𝑙 𝑜𝑢𝑡𝑐𝑜𝑚𝑒 8

8.

A radioactive mass emits particles from time to time. The time between two emissions israndom.
Let T represent the time in seconds between two emissions. Assume that the cumulative
distribution function of T is given by •
1
{1 − 𝑒 −5𝑡 𝑡>0
{0 , t ≤ 0
Computer the probability that at least 10 seconds will elapse before the next emission
• Compute the value of Pr(T ∈ [1,2]).

Answer: a) Computer the probability that at least 10 seconds will elapse before the next
emission

F(∞) − 𝐹(10)
1 1
(∞) (10)
= (1 − 𝑒 −5 ) − (1 − 𝑒 −5 )
= 1 − 1 + 0.135 = 0.135

[Pr ≤ 10] = 0.135


1 t
2
b) ∫1 (1 − 𝑒 −5𝑡 ) 𝑑𝑡 = [5 e−5 ] + 𝑡
apply limits
2 1
[5 e−5 ] + 2 − {[5 e−5 ] + 1} = 3.351 +2 – (4.09 +1) = 0.261

= 0.261

9. Probabilities around the union

• Compute Pr(A ∪ B) if it is given that Pr(A) = 1/3 and Pr(B|Ac) = 1/4.


• Compute Pr(B) if it is given that Pr(A ∪ B) = 2/3 and Pr(Ac|Bc) = 1/3.

Answer : by the information


Pr(𝐴𝑐 ) = 1 − Pr(𝐴)
1
Pr(𝐴𝑐 ) = 1 − = 2/3 = 0.667
3

Pr(B ∩ 𝐴𝑐 )⋱ Pr(𝐵)(0.667)
Pr(B|𝐴𝑐 ) = = = Pr(B) = ¼ =0.25
Pr(𝐴𝑐 ) 0.667

Pr(A ∪ B)= Pr(A) + Pr(B) –Pr (B ∩ 𝐴)

= 0.333+0.25-0.25*0.33 =0.4975

Pr(𝐵𝐶 ∩ 𝐴𝑐 )⋱ 1−Pr(𝐴 ∪ 𝐵) 1
b} Pr(Ac|Bc) = = =
Pr(𝐵𝑐 ) 1−Pr(𝐵) 3

Pr(B) = 1

10.

Two independent events A and B are given, and Pr(B|A ∪ B) = 2/3 and Pr(A|B) = 1/2.

Compute Pr(B).

Answer: by the information


Pr(B∩ 𝐴 ∪ 𝐵 )⋱ 2
Pr(B|A ∪ B) = =
Pr(𝐴 ∪ 𝐵) 3

33Pr(B) × Pr( 𝐴 ∪ 𝐵) = 2 Pr(𝐴 ∪ 𝐵)


Pr(B)= 2/3

Pr(A)= Pr(A|B)= ½

Part II - Computational Exploration

1. A system is made up of m independent components connected in series. It is known that each


component fails with the same probability θ. Let W denote the event that the system is functional
(ie working). 1. Find the expression of pW = Pr[W] the probability of W.
2. Compute the theoretical value of pW when m = 4 and θ = 0.05.
3. Write a piece of R code to compute the empirical value of pW when m = 4 and θ = 0.05.
4. Explore your empirical computations for various values of the number n of replications 100,
1000, etc ... and plot your empirical value as a function of n.
5. Comment on the probabilistic law demonstrated by your exploration

Answer; 1.

If the components fail or survive independently of one another, then this probability becomes n
P[system failure] = 1 –∏𝑚𝑖=1(1 – 𝜃𝑖 )
Then the probability of survival of all components is given by
P[system survival] = 1-[ 1 –∏𝑚
𝑖=1(1 – 𝜃𝑖 ) ]
𝑚
= ∏𝑖=1(1 – 𝜃𝑖 )

2.
4

∏(1 – 𝜃𝑖 )
𝑖=1
For all components having same probability then
∏𝑚 4 4
𝑖=1(1 – 𝜃𝑖 ) = (1 − 𝜃) = (1 − 0.05) = 0.814

2.The code shown below generates a sequence of random coin tosses


sequence <- NULL
for(i in 1:5) sequence <- c(sequence, sample(c(’H’,’T’),1)) print(sequence)
1. Change the length of the sequence using 4, 5, 7 , 10, 20, 40
2. Comment on how the length of the sequence impact its characteristics.
3. Relate your comment to the definition of probability.

Answer:

sequence <- NULL


for(i in 1:5) sequence <- c(sequence, sample(c(’H’,’T’),1))
print(sequence)

for sequence =4
sequence <- NULL
for(i in 1:4) sequence <- c(4, sample(c(’H’,’T’),1))
print(4)

for sequence =5
sequence <- NULL
for(i in 1:5) sequence <- c(5, sample(c(’H’,’T’),1))
print(5)

for sequence =7
sequence <- NULL
for(i in 1:7) sequence <- c(7, sample(c(’H’,’T’),1))
print(7)

for sequence =10


sequence <- NULL
for(i in 1:10) sequence <- c(10, sample(c(’H’,’T’),1))
print(10)

for sequence =20


sequence <- NULL
for(i in 1:20) sequence <- c(20, sample(c(’H’,’T’),1))
print(20)

for sequence =40


sequence <- NULL
for(i in 1:40) sequence <- c(40, sample(c(’H’,’T’),1))
print(40)
B]
The checnge in length afftects the total sequence outcome. Changing length changes the number
of sequence occurred.

C] the change in length of sequence may increase or decrease the probability but it will keep it in
the value less than 1.

3. The following code depicts an experiment with two fair six-faced dice
n <- 10000; f <- 0
for(i in 1:n) f <- f + ifelse((sample(6)[1]==sample(6)[1]),1,0) print(f/n)
Roll two dice and compute empirical probability that

1. The first yields an outcome greater than the second


2. The sum of the outcomes is less than 9
3. In each case, compare your empirical probabilities to the theoretical counterparts

Answer:
A] The first yields an outcome greater than the second
[p<6]= p[1]+p[2]+p[3]+p[4]+p[5]
= 1/6+1/6+1/6+1/6+1/6= 5/6

B] . The sum of the outcomes is less than 9


P [sum<9]= p[sum=2]+p[sum=3]+p[sum=4]+p[sum=5]+p[sum=6]+p[sum=7]+p[sum=8]
= 1/36+2/36+3/36+4/36+5/36+6/36+2/36+3/36
P[sum<9]=26/36

C] the empirical probabilities gain the same value as the theoretical values of probability.

4. Consider the following bag U = {b,b,b,b,r,r,r,r,r,r} representing the colors (’b’ for blue, and ’r’ for
red) of the toys being distributed at a children’s playground. Suppose that on this occasion, 3 toys
are to be drawn randomly from the bag and given away to some of the kids attending.

1. Theoretical computations
• Compute the number of ways in which the three toys can be drawn from the bag without
replacement.
• Compute the number of ways in which the three randomly drawn toys will all come out red.
• Compute the number of ways in which the three randomly drawn toys will all come out blue.
• Compute the probability that all the three toys are of the same colors
2. Empirical computations
• Write a piece of R code to empirically compute the estimated probability that all the three toys
are of the same colors, using n = 100 as your number of random samples from the bag.
• Using values of n from 100 to 40000, compute various realizations of the estimated probability
that all the three toys are of the same colors.
• Plot your estimated probabilities as a function of n and comment on what transpires. Specifically
discuss the law at work in the pattern of your plot

Answer:
1. a) The number of ways in which the three toys can be drawn from the bag without
replacement.

𝟏𝟎𝑪𝟏 × 𝟗𝑪𝟏 × 𝟖𝑪𝟏 = 10× 𝟗 × 𝟖 = 𝟕𝟐𝟎 𝒘𝒂𝒚𝒔

b) The number of ways in which the three randomly drawn toys will all come out red.
𝟔𝑪𝟑 = 𝟐𝟎
C) The number of ways in which the three randomly drawn toys will all come out blue.
𝟒𝑪𝟑 = 𝟒
d) The probability that all the three toys are of the same colors
𝟔𝑪𝟑 + 𝟒𝑪𝟑 = 𝟐𝟎 + 𝟒 = 𝟐𝟒

2.
a)
comb_with_replacement
<- function(n, r){
return( factorial(n + r - 1) / (factorial(r) *
factorial(n - 1)) )
}
#have 3 elements, choosing 3
comb_with_replacement(3,3)
#[1] 10

comb_with_replacement(100,3)

ballsample(1:3, size = 100, replace = TRUE, ordered = FALSE)

b)
comb_with_replacement
<- function(n, r){
return( factorial(n + r - 1) / (factorial(r) *
factorial(n - 1)) )
}
#have 3 elements, choosing 3
comb_with_replacement(3,3)
#[1] 10

comb_with_replacement(100 t0 40000,3)

ballsample(1:3, size = 100 t0 40000, replace = TRUE, ordered = FALSE)

c)

1. Compute Pr[1/5 < X < 3/5] using Monte Carlo as per the R code of session 1

5. Let fX(x) = 3x2 for 0 < x < 1.


1. Compute Pr[1/5 < X < 3/5] using Monte Carlo as per the R code of session 1
2. Compare your answer to the theoretical answer, and argue in terms of the number ofMonte
Carlo draws

Answer:
3/5 3 1 3
a] ∫1/5 3𝑥 2 ={5}3 − {5} = 0.208

b]all answers follow the theoretical values of answers.

6. Consider the pdf f(x,y) = kxy where 0 < x < 2 and 0 < y < 2. Use the Monte Carlo approach
described in the R Code of session 1

1. Find Pr[A] = Pr[X > 1]


2. Find Pr[B] = Pr[Y < 1]
3. Find Pr[A ∩ B] = Pr[X > 1 ∩ Y < 1]
4. Find Pr[A|B] = Pr[X > 1|Y < 1]
5. Compare (d) to (a) and Comment use = 10000, 100000, 1000000
6. Compare your results to their theoretical counterparts
6. Consider the pdf f(x,y) = kxy where 0 < x < 2 and 0 < y < 2. Use the Monte Carlo approach
described in the R Code of session 1

1. Find Pr[A] = Pr[X > 1]


2. Find Pr[B] = Pr[Y < 1]
3. Find Pr[A ∩ B] = Pr[X > 1 ∩ Y < 1]
4. Find Pr[A|B] = Pr[X > 1|Y < 1]
5. Compare (d) to (a) and Comment use = 10000, 100000, 1000000
6. Compare your results to their theoretical counterparts

Answer:

2
A] Pr[𝐴] = Pr[𝑋 > 1] = ∫1 𝑘𝑥𝑦 dx = 3ky/2
1
B] Pr[𝐵] = Pr[𝑌 < 1] = ∫0 𝑘𝑥𝑦 𝑑𝑦 = -kx/2

C] Pr[A ∩ B] = Pr[X > 1 ∩ Y < 1]= -3k𝑥𝑦/4

−3k𝑥𝑦/4
D] Pr[A|B] = Pr[X > 1|Y < 1]= = 3ky/2
−kx/2
F] all results satisfies the theoretical result.

Exercise

1. Show that if P(A) = 0 or P(A) = 1, then A is independent of every other event.

Answer:

Suppose P (A) = 1. Then, 0 ≤ P (B \ A) ≤ P (𝐴𝐶 ) = 0 and hence P (A ∩ B) = P (B) − P (B \ A) = P (B) = P


(B) P (A)=0.

Suppose P (A) = 0. Then, 0 ≤ P (A ∩ B) ≤ P (A) = 0 and hence P (A ∩ B) = 0 = P (A) P (B)

2. Show that if A is independent of itself, then P(A) is either 0 or 1.


Answer:

If A is independent of itself, then P (A) = P (A ∩ A) = P (A) P (A)

which implies P (A) is 0 or 1.

For example: The solutions of x = 𝑥 2 are x = 0 or 1.

3. Suppose that A and B are independent events. Show that Ac and Bc are independent events.

Answer;

It is known that P(A) + P(𝐴𝐶 ) = 1 ……………………………………………..Identity 1

It is also known that P(A ∩ 𝐵𝐶 ) + P(𝐴𝐶 ∩ 𝐵𝐶 ) = P(𝐵𝐶 ) …………………………..Identity 2

Therefore, we have P(A)*P(𝐵𝐶 ) = [1−P(𝐴𝐶 )]P(𝐵𝐶 ) = P(𝐵𝐶 )−P(𝐴𝐶 )*P(𝐵𝐶 ) and by Identity 1
and we know

P(A∩𝐵𝐶 ) = P(𝐵𝐶 )−P(𝐴𝐶 ∩𝐵𝐶 ).

Substituting into the equation P(A∩𝐵𝐶 ) = P(A)*P(𝐵𝐶 ),

we obtain P(𝐵𝐶 ) − P(𝐴𝐶 ∩ 𝐵𝐶 ) = P(𝐵𝐶 ) − P(𝐴𝐶 ) * P(𝐵𝐶 ).

Subtracting P(𝐵𝐶 ) from both sides and dividing by (−1)

we obtain P(𝐴𝐶 ∩ 𝐵𝐶 ) = P(𝐴𝐶 ) * P(𝐵𝐶 ).

It shows that , 𝐴𝐶 and 𝐵𝐶 are independent.

Exercise
Consider a collection M1,M2,··· ,Mj,··· ,Mn of n independent messengers given the task to relay an
important message from one end to the other. Assume that the message is binary. It is known that
all the messengers considered are unfortunately plagued with ugly sin of lying. More specifically,
each messenger Mj lies about the message received with a probability p, meaning that Mj will
transmit the message received with probability p. Assumed that the initial messenger M0
transmits the message intact with probability 1. We seek to compute the probability that the
message goes intact from M0 to the last messenger Mn.
1. Let Ck represent the probability that the message arrives goes from messenger Mk intact, and
the express Ck as a function of Ck−1. [Hint: Use the law of total probability, namely P(A) = P(A ∩ B)
+ P(A ∩ Bc)]

2. Simplify the formula using your knowledge of arithmetic and geometric sequences to expressCn
as a function of p and n.

3. Interpret and explain the meaning of p = 1/2.

Answer:

A]

The total probability that the message arrives goes from messenger Mk intact, is

Ck= P(successful sending ∩ successful receiving) = P(successful sending ) - P(successful sending ∩


𝑠𝑢𝑐𝑐𝑒𝑠𝑠𝑓𝑢𝑙 𝑟𝑒𝑐𝑒𝑖𝑣𝑖𝑛𝑔𝐶 )

= p-p*(1-p)

= 𝑝2
2
Ck-1 =𝑃𝑘−1

B]
2
Cn-Cn-1=𝑝2 − 𝑃𝑛−1
2
Cn= = 𝑝2 − 𝑃𝑛−1 + 𝐶𝑛 − 1

C]

at p=1/2

Cn= (1/2)2 =1/4

You might also like