0% found this document useful (0 votes)
701 views16 pages

Hint - Area Under The Must Be 1

This document contains solutions to probability and statistics problems involving continuous and normal random variables. 1) The first section solves problems about continuous random variables with given densities, including finding probabilities, CDFs, constants, and expectations. 2) The second section solves problems about exponential, gamma, and Poisson distributions related to waiting times and counts. 3) The third section solves additional problems involving series, parallel, and independent systems with failures modeled by continuous distributions. 4) The final section solves problems involving the standard normal and other normal distributions, finding probabilities and inverse CDF values.

Uploaded by

JASHWIN GAUTAM
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)
701 views16 pages

Hint - Area Under The Must Be 1

This document contains solutions to probability and statistics problems involving continuous and normal random variables. 1) The first section solves problems about continuous random variables with given densities, including finding probabilities, CDFs, constants, and expectations. 2) The second section solves problems about exponential, gamma, and Poisson distributions related to waiting times and counts. 3) The third section solves additional problems involving series, parallel, and independent systems with failures modeled by continuous distributions. 4) The final section solves problems involving the standard normal and other normal distributions, finding probabilities and inverse CDF values.

Uploaded by

JASHWIN GAUTAM
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
You are on page 1/ 16

Tutorial- 4 Submission

MA 201 Probability and Statistics (2021-22) (3-1-0-4)

B. Tech. II year CSE & IT

Name – Jashwin Gautam

Roll No - 202051090

Continuous Random Variable -

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.

Hint - Area under the must be 1.

syms K x y int(K/y^4,
y, 1, Inf)

ans =

Now the CDF is

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

vpa(1 - subs(F,'x', 2))

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.

Hint - Area under the must be 1.

syms C x y
int(C*(10-y)^2, y, 0, 10)

ans =

Now the CDF is

F = int(3/1000*(10-y)^2, y, 0, x)
F =

Now, probability that it takes between 1 and 2 minutes to reboot is

subs(F, 'x',2) - subs(F, 'x',1)


ans =

which can be written in decimal form as

2
vpa(subs(F, 'x',2) - subs(F, 'x',1))

ans =

Qus1(c) - Lifetime of a certain hardware is a continuous random variable with density

(a) Find K.

(b) What is the probability of a failure within the first 5 years?

(c) What is the expectation of the lifetime?

Hint - Area under the must be 1.

syms K x y int(K -
y/50, y, 0, 10)

ans =

Now the CDF is

F = int(1/5 - y/50, y, 0, x)
F =

Now, probability that it takes between 1 and 2 minutes to reboot is

subs(F, 'x',5)
ans =

which can be written in decimal form as

vpa(subs(F, 'x',5))

ans =

Now Expected value of X is

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 ,

(a) Compute the constant C.

(b) Find the marginal densities of X and Y. Are these two variables independent?

(c) Compute probabilities and

syms C x y
C = 1/integral2(@(x,y) (x.^2+y), -1,1,0,1)
C = 0.6000

fXx = int(3/5*(x^2+y), y, 0,1)


fXx =

fYy = int(3/5*(x^2+y), x, -1,1)


fYy =

expand(fXx*fYy) % (b) not independent


ans =

int(fYy,y,0,0.6) %(c)

ans =

vpa(integral2(@(x,y) 3/5*(x.^2+y), -1,0.5,0,0.6) / int(fYy,y,0,0.6)) %(c)

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?

Hint- T is a Gamma Random Varaible , $\frac{1}{\lambda} = 12 seconds$

Probability that the job will not be ready within 60 seconds.

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

the first 6 months.

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

5 tasks is processed in less than 8 minutes.

,
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

take more than 70 seconds to download 3 independent files?

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

min and Std(X) = 10 min.

(a) Compute parameters of this distribution.

(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

probability that it will not be required within the next 4 months?

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

of time with parameter .

A certain order was submitted 30 minutes ago, and it is still not ready. What is the probability

that the first specialist is working on it?

Hint: ,

, .

(1+0.4/0.6*expcdf(1/2, 1/2, 'upper')/expcdf(1/2, 1/3, 'upper'))^-1


ans = 0.4764

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,

with parameters α and λ given in the table,

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

failed due to the failure of component B (but not component A)?

Hint: The failure time for series components can be modelled as

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

Normal Random Variable -

Qus - 5a) Let Z be a Standard Normal random variable. Compute

(a) P(Z < 1.25) (b) P(Z ≤ 1.25) (c) P(Z > 1.25) (d) P(|Z| ≤ 1.25)

z1 = 1.25; mu =0;sigma =1;


[1/2*(1+erf(z1/sqrt(2))) normcdf(z1,mu,sigma)] % (a) (b)

ans = 1×2
0.8944 0.8944

[1/2*(1-erf(z1/sqrt(2))) normcdf(z1,mu,sigma,'upper')] % (c)


ans = 1×2
0.1056 0.1056

[1/2*(1+erf(z1/sqrt(2))) - 1/2*(1+erf(-z1/sqrt(2))) normcdf(z1,mu,sigma) - normcdf(-z1,mu,sigm


ans = 1×2
0.7887 0.7887

(e) P(Z < 6.0) (f) P(Z > 6.0)

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

[1/2*(1-erf(z1/sqrt(2))) normcdf(z1,mu,sigma,'upper')] % (f)


ans = 1×2 10-
9 ×
0.9866 0.9866

(g) With probability 0.8, variable Z does not exceed what value?

y =0.8; mu=0; sigma = 1; [sqrt(2)*erfinv(2*(y -


0.5)) norminv(y,mu,sigma)]

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

(a) P(X ≤ 2.39) (b) P(X ≥ −2.39) (c) P(|X| ≥ 2.39)

(d) P(|X + 3| ≤ 2.39) (e) P(X < 5) (f) P(|X| < 5)

(g) With probability 0.33, variable X exceeds what value?

x = 2.39; mu=-3; sigma = sqrt(4);


z1 = (x-mu)/sigma;
[1/2*(1+erf(z1/sqrt(2))) normcdf(x,mu,sigma)] % (a) (b)

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

x = 5; mu=-3; sigma = sqrt(4);

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

y =0.33; [mu+ sigma*sqrt(2)*erfinv(2*(y - 0.5))


norminv(y,mu,sigma)]

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,

if the distribution of measurements is

(a) Normal(μ, σ)?

(b) Uniform(a, b)?

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

the mean, if the distribution of measurements is (a) Normal(μ, σ)?

1- (normcdf(1.5,0,1) - normcdf(-1.5,0,1))

ans = 0.1336

2*normcdf(1.5,0,1,'upper')

ans = 0.1336

(b) Uniform(a, b)?

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?
,

mu = 79; sigma = 3.89;


normcdf(7*12,mu,sigma,'upper')

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?

y =0.03; [mu+ sigma*sqrt(2)*erfinv(2*(y - 0.5))


norminv(y,mu,sigma)]

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?

y =0.05; [mu+ sigma*sqrt(2)*erfinv(2*(y - 0.5))


norminv(y,mu,sigma)]
ans = 1×2
571.0293 571.0293

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

of 400 components is less than 5012 hours?

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

software is installed in less than 20 minutes?

Let with

After applying CLT, we get the probability

mu = 82*15; sigma = sqrt(16*82); normcdf((20*60-


mu)/sigma,0,1)

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

sample of 400 chips is selected for inspection.

(a) What is the probability that this sample contains between 20 and 25 defective chips

(including 20 and 25)?

p = 0.06; n = 400;

mu = 400 * 0.6; sigma =


400 * 0.6 * 0.4;
p = normcdf(25.5,mu,sigma) - normcdf(19.5,mu,sigma)
p = 0.0019

(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] =

80 \times 0.6 \times 0.4$ hence the probability that

mu = 80 * 0.6; sigma = sqrt(80 * 0.6 * 0.4);


normcdf(50,mu,sigma) - normcdf(47,mu,sigma)
ans = 0.2662

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).

mu = 2400 * 0.35; sigma = sqrt(2400 * 0.35 * 0.65);


normcdf(850.5,mu,sigma) - normcdf(799.5,mu,sigma)
ans = 0.6319

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.

Use the Central Limit Theorem.

alpha = 70; lambda = 5;


mu = alpha/lambda; sigma = sqrt(alpha/lambda^2);
normcdf(12,mu,sigma) %central limit theorem

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

is the probability that it was printed by Printer I? Priors

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

one file, with a variance of 11 .

(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

this information, compute N.

mu = 68*15; sigma = sqrt(11*68); normcdf((12*60-


mu)/sigma,0,1)

15
ans = 2.6907e-28

normcdf(12*60,mu,sigma) %(a)

ans = 2.6907e-28

Assume . Since , After solving , we get files.


y = 0.95; z =
norminv(y,0,1);
syms N
vpa(solve((600 - 15*N)/sqrt(11*N) ==z, N))

ans =

16

You might also like