Answer: (A) PR (B
Answer: (A) PR (B
Answer: (A) PR (B
= Pr(B ∩ 𝐴𝑐 ) = 0
(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 .
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.
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.
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
= 0.261
Pr(B ∩ 𝐴𝑐 )⋱ Pr(𝐵)(0.667)
Pr(B|𝐴𝑐 ) = = = Pr(B) = ¼ =0.25
Pr(𝐴𝑐 ) 0.667
= 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).
Pr(A)= Pr(A|B)= ½
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
Answer:
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)
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
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
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.
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)
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)
c)
1. Compute Pr[1/5 < X < 3/5] using Monte Carlo as per the R code of session 1
Answer:
3/5 3 1 3
a] ∫1/5 3𝑥 2 ={5}3 − {5} = 0.208
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
Answer:
2
A] Pr[𝐴] = Pr[𝑋 > 1] = ∫1 𝑘𝑥𝑦 dx = 3ky/2
1
B] Pr[𝐵] = Pr[𝑌 < 1] = ∫0 𝑘𝑥𝑦 𝑑𝑦 = -kx/2
−3k𝑥𝑦/4
D] Pr[A|B] = Pr[X > 1|Y < 1]= = 3ky/2
−kx/2
F] all results satisfies the theoretical result.
Exercise
Answer:
3. Suppose that A and B are independent events. Show that Ac and Bc are independent events.
Answer;
Therefore, we have P(A)*P(𝐵𝐶 ) = [1−P(𝐴𝐶 )]P(𝐵𝐶 ) = P(𝐵𝐶 )−P(𝐴𝐶 )*P(𝐵𝐶 ) and by Identity 1
and we know
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.
Answer:
A]
The total probability that the message arrives goes from messenger Mk intact, is
= 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