Hint - Area Under The Must Be 1
Hint - Area Under The Must Be 1
Roll No - 202051090
Qus1(a) - The lifetime, in years, of some electronic component is a continuous random variable with the
density
Find k, the cumulative distribution function, and the probability for the lifetime to exceed 2 years.
syms K x y int(K/y^4,
y, 1, Inf)
ans =
F = int(3/y^4, y, 1, x)
F =
Therefore
1 - subs(F,'x', 2)
ans =
1
which can be written in decimal form as
ans =
Qus1(b) - The time, in minutes, it takes to reboot a certain system is a continuous variable with the
density
(a) Compute C.
(b) Compute the probability that it takes between 1 and 2 minutes to reboot.
syms C x y
int(C*(10-y)^2, y, 0, 10)
ans =
F = int(3/1000*(10-y)^2, y, 0, x)
F =
2
vpa(subs(F, 'x',2) - subs(F, 'x',1))
ans =
(a) Find K.
syms K x y int(K -
y/50, y, 0, 10)
ans =
F = int(1/5 - y/50, y, 0, x)
F =
subs(F, 'x',5)
ans =
vpa(subs(F, 'x',5))
ans =
3
E = int(y*(1/5 - y/50), y, 0, 10)
E =
Qus1(d) - Two continuous random variables X and Y have the joint density
for ,
(b) Find the marginal densities of X and Y. Are these two variables independent?
syms C x y
C = 1/integral2(@(x,y) (x.^2+y), -1,1,0,1)
C = 0.6000
int(fYy,y,0,0.6) %(c)
ans =
ans =
4
Qus2(a) - The time it takes a printer to print a job is an Exponential random variable with the
expectation of 12 seconds. You send a job to the printer at 10:00 am, and it appears to be
third in line. What is the probability that your job will be ready before 10:01 am?
poisscdf(2,60/12,'upper')
ans = 0.8753
gamcdf(60,3,12)
ans = 0.8753
Qus2(b) - For some electronic component, the time until failure has Gamma distribution with param-
eters and . Compute the probability that the component fails within
poisscdf(1,2/2,'upper')
ans = 0.2642
gamcdf(1/2, 2,1/2)
ans = 0.2642
Qus2(c) - A computer processes tasks in the order they are received. Each task takes an Exponential
amount of time with the average of 2 minutes. Compute the probability that a package of
,
Hint - Gamma Random Variable
gamcdf(8,5,2)
ans = 0.3712
poisscdf(4,8/2,'upper')
ans = 0.3712
5
On the average, it takes 25 seconds to download a file from the internet. If it takes an
Exponential amount of time to download one file, then what is the probability that it will
gamcdf(70,3,25,'upper')
ans = 0.4695
poisscdf(2,70/25)
ans = 0.4695
The time X it takes to reboot a certain system has Gamma distribution with E(X) = 20
(b) What is the probability that it takes less than 15 minutes to reboot this system?
gamcdf(15,4,5)
ans = 0.3528
poisscdf(3,15/5,'upper')
ans = 0.3528
Qus3(a) - On the average, a computer experiences breakdowns every 5 months. The time until the
first breakdown and the times between any two consecutive breakdowns are independent
Exponential random variables. After the third breakdown, a computer requires a special
maintenance.
(a) Compute the probability that a special maintenance is required within the next 9
months.
(b) Given that a special maintenance was not required during the first 12 months, whatis the
gamcdf(9,3,5)
ans = 0.2694
poisscdf(2,9/5,'upper')
6
ans = 0.2694
gamcdf(16,3,5,'upper')/gamcdf(12,3,5,'upper')
ans = 0.6668
poisscdf(2,16/5)/poisscdf(2,12/5)
ans = 0.6668
Qus3(b) -Two computer specialists are completing work orders. The first specialist receives 60%
of all orders. Each order takes her Exponential amount of time with parameter . The
second specialist receives the remaining 40% of orders. Each order takes him Exponential amount
A certain order was submitted 30 minutes ago, and it is still not ready. What is the probability
Hint: ,
, .
Qus4 - A certain system is based on two independent modules, A and B. A failure of any module
causes a failure of the whole system. The lifetime of each module has a Gamma distribution,
Component α λ (years−1)
A 3 1
7
B 2 2
(a) What is the probability that the system works at least 2 years without a failure?
(b) Given that the system failed during the first 2 years, what is the probability that it
The probability that the system will function after t years can be given as:
$\Pr\{T> t\} = \Pr\{\min(T_A,T_B)> t\} = \Pr\{T_A > t\} \times \Pr\{T_B > t\}$
gamcdf(2,3,1,'upper')*gamcdf(2,2,1/2,'upper')
ans = 0.0620
Failure can happens in three ways: either A (but not B) fails or B (but not A) fails or both fail. After writing the
proportion probability of B (but not A) fails, we get:
(gamcdf(2,3,1,'upper')*gamcdf(2,2,1/2))/(1-gamcdf(2,3,1,'upper')*gamcdf(2,2,1/2,'upper'))
ans = 0.6553
(a) P(Z < 1.25) (b) P(Z ≤ 1.25) (c) P(Z > 1.25) (d) P(|Z| ≤ 1.25)
ans = 1×2
0.8944 0.8944
8
z1 = 6.0; mu=0; sigma = 1;
[1/2*(1+erf(z1/sqrt(2))) normcdf(z1,mu,sigma)] % (e)
ans = 1×2
1.0000 1.0000
(g) With probability 0.8, variable Z does not exceed what value?
ans = 1×2
0.8416 0.8416
z1 = norminv(0.8,mu,sigma);
[1/2*(1+erf(z1/sqrt(2))) normcdf(z1,mu,sigma)] % verify it.
ans = 1×2
0.8000 0.8000
Qus -5b) For a Normal random variable X with E(X) = −3 and Var(X) = 4, compute
ans = 1×2
0.9965 0.9965
[1/2*(1-erf(z1/sqrt(2))) normcdf(x,mu,sigma,'upper')] % (c)
ans = 1×2
0.0035 0.0035
P(|X + 3| ≥ 2.39) = P(X ≥ 2.39 -3) + P(-X ≥ 3+ 2.39) = P(X ≥ - 0.61) + P(X ≤ -5.39)
c = 3;
%z2 = (x+mu)/sigma;
%[1/2*(1+erf(z1/sqrt(2))) - 1/2*(1+erf(-z2/sqrt(2))) normcdf(x,mu,sigma) - normcdf(-x,mu,sigma
9
z1 = (x-c-mu)/sigma;
[1/2*(1+erf(z1/sqrt(2))) normcdf(x,mu,sigma)] % (e)
ans = 1×2
0.9938 1.0000
z2 = (x+c+mu)/sigma;
[1/2*(1-erf(z1/sqrt(2))) + 1/2*(1+erf(-z2/sqrt(2))) normcdf(x-c,mu,sigma,'upper') + normcdf(-x
ans = 1×2
0.0124 0.0124
ans = 1×2
-3.8798 -3.8798
z1 = norminv(0.8,mu,sigma);
[1/2*(1+erf(z1/sqrt(2))) normcdf(z1,mu,sigma)] % verify it.
ans = 1×2
0.0940 0.8000
Qus-6 According to one of the Western Electric rules for quality control, a produced item is
considered conforming if its measurement falls within three standard deviations from the
target value. Suppose that the process is in control so that the expected value of each
measurement equals the target value. What percent of items will be considered conforming,
Hint - If its measurement falls within three standard deviations from the target value.
In case of a normal random variable, the values lies between . Hence the interval is .
normcdf(3,0,1) - normcdf(-3,0,1)
ans = 0.9973
), ,
In case of Uniform(
10
Hence the target value lies in between . Therefore it is 100% for the interval .
4.20. Refer to Exercise 4.19. What percent of items falls beyond 1.5 standard deviations from
1- (normcdf(1.5,0,1) - normcdf(-1.5,0,1))
ans = 0.1336
2*normcdf(1.5,0,1,'upper')
ans = 0.1336
It is
1 - (unifcdf(1/2+1.5/2/sqrt(3),0,1) - unifcdf(1/2-1.5/2/sqrt(3),0,1))
ans = 0.1340
Qus - 7 The average height of professional basketball players is around 6 feet 7 inches, and the
standard deviation is 3.89 inches. Assuming Normal distribution of heights within this group,
(a) What percent of professional basketball players are taller than 7 feet?
(b) If your favorite player is within the tallest 20% of all players, what can his height be?
,
ans = 0.0993
y = (1 - 0.2);
[mu+ sigma*sqrt(2)*erfinv(2*(y - 0.5)) norminv(y,mu,sigma)]/12 %feet
ans = 1×2
6.8562 6.8562
z1 = norminv(0.8,mu,sigma);
[1/2*(1+erf(z1/sqrt(2))) normcdf(z1,mu,sigma)] % verify it.
ans = 1×2
1.0000 0.8000
Qus -8 Suppose that the average household income in some country is 900 coins, and the standard
deviation is 200 coins.
(a) Assuming the Normal distribution of incomes, compute the proportion of “the middle class,” whose
income is between 600 and 1200 coins.
11
mu =900; sigma = 200;
normcdf(1200,mu,sigma)-normcdf(600,mu,sigma)
ans = 0.8664
(b) The government of the country decides to issue food stamps to the poorest 3% of households.
Below what income will families receive food stamps?
ans = 1×2
523.8413 523.8413
(c) A recent economic reform made households with the income below 640 coins qualify for a free
bottle of milk at every breakfast. What portion of the population qualifies for a free bottle of milk?
normcdf(640,mu,sigma)
ans = 0.0968
(d) Moreover, households with an income within the lowest 5% of the population are entitled to a free
sandwich. What income qualifies a household to receive free sandwiches?
Qus - 9 The lifetime of a certain electronic component is a random variable with the expectation of
5000 hours and a standard deviation of 100 hours. What is the probability that the average lifetime
with
Hint - Suppose and $\sigma = \sqrt{Var[X_i]} = 100$
Since is large with all with same mean and expectation, we apply CLT.
normcdf((5012-5000)/(100/sqrt(400)),0,1)
ans = 0.9918
normcdf(5012,5000,100/sqrt(400))
ans = 0.9918
12
Qus - 10 Installation of some software package requires downloading 82 files. On the average, it
takes 15 sec to download one file, with a variance of 16 . What is the probability that the
Let with
ans = 0.2038
normcdf(1200,mu,sigma)
ans = 0.2038
Qus -11 Among all the computer chips produced by a certain factory, 6 percent are defective. A
(a) What is the probability that this sample contains between 20 and 25 defective chips
p = 0.06; n = 400;
(b) Suppose that each of 40 inspectors collects a sample of 400 chips. What is the prob-
ability that at least 8 inspectors will find between 20 and 25 defective chips in their
samples?
binocdf(7,40,p,"upper")
ans = 1.3240e-14
Qus - 12 An average scanned image occupies 0.6 megabytes of memory with a standard deviation
of 0.4 megabytes. If you plan to publish 80 images on your web site, what is the probability that
13
their total size is between 47 megabytes and 50 megabytes? $E[S_n] = 80 \times 0.6$, $Var[S_n] =
Qus - 13 A certain computer virus can damage any file with probability 35%, independently of other
files. Suppose this virus enters a folder containing 2400 files. Compute the probability that between
800 and 850 files get damaged (including 800 and 850).
Qus - 14 Seventy independent messages are sent from an electronic transmission center. Messages are
processed sequentially, one after another. Transmission time of each message is Exponential with
parameter λ = 5 . Find the probability that all 70 messages are transmitted in less than 12 minutes.
ans = 0.1160
gamcdf(12,alpha,1/lambda) %exact
ans = 0.1118
Qus - 15 A computer lab has two printers. Printer I handles 40% of all the jobs. Its printing time is
Exponential with the mean of 2 minutes. Printer II handles the remaining 60% of jobs. Its printing
time is Uniform between 0 minutes and 5 minutes. A job was printed in less than 1 minute. What
14
, likelihood
likelihood
Posterior $\Pr(Printer = I | T<1) = \frac{\Pr( T<1 | Printer = I) \Pr\{Printer = I\}}{\Pr( T<1 | Printer = I) \Pr\{Printer = I\}
+ \Pr( T<1 | Printer = II) \Pr\{Printer = II\}}$
(1 + 0.6/0.4/5/(1-exp(-0.5)))^-1
ans = 0.5674
Qus - 16 An internet service provider has two connection lines for its customers. Eighty percent of
customers are connected through Line I, and twenty percent are connected through Line II.
Line I has a Gamma connection time with parameters α = 3 and λ = 2 min−1 . Line II has a
Uniform(a, b) connection time with parameters a = 20 sec and b = 50 sec. Compute the
probability that it takes a randomly selected customer more than 30 seconds to connect to
the internet.
0.8*gamcdf(30,3,30,'upper') + 0.2*unifcdf(30,20,50,'upper')
ans = 0.8691
Qus - 17 Upgrading a certain software package requires installation of 68 new files. Files are installed
consecutively. The installation time is random, but on the average, it takes 15 sec to install
(a) What is the probability that the whole package is upgraded in less than 12 minutes?
(b) A new version of the package is released. It requires only N new files to be installed,
and it is promised that 95% of the time upgrading takes less than 10 minutes. Given
15
ans = 2.6907e-28
normcdf(12*60,mu,sigma) %(a)
ans = 2.6907e-28
ans =
16