You are on page 1of 8

Student Information

Answer 1
a)
Since the time taken to process and send the response, TA and TB , are uniformly distributed be-
tween [0, 100] milliseconds, they have constant density. On the interval [ 0,100 ], their density
equals:

1 1
f (tA ) = = , 0 ≤ tA ≤ 100
100 − 0 100
1 1
f (tB ) = = , 0 ≤ tB ≤ 100
100 − 0 100
Since TA and TB , are independent, their joint density function can be obtained by multiplying
the marginal densities. So,

f(tA , tB ) = f (tA ) ∗ f (tB )


1 1
= 100 ∗ 100
1
= 10000
In order to obtain joint cumulative distribution function, integrate joint density over corre-
sponding set of vector values (tA , tB ) ∈ A. So,

F(tA , tB ) = R {(T
P R A , TB ) ∈ A}
= f (tA , tB )dtA dtB
R tA(tRAt,tBB )∈A1
= dtB dtA
R0tA 0 10000 1 1
= (t ∗ − 0 ∗ 10000 )dtA
R0tA B 10000 1
= 0
tB ∗ 10000 dtA
1 1
= tA ∗ tB ∗ 10000 − 0 ∗ tB ∗ 10000
1
= tA ∗ tB ∗ 10000

b)
the probability that server A processes the packet and sends a response within the first 30 mil-
liseconds, while server B takes between 40 and 60 milliseconds to process the packet and send a
response can be computed by integrating the joint density over corresponding set of vector values
(tA , tB ) ∈ R2 . So,

1
RR
P {0 < TA < 30 ∩ 40 < TB < 60} = f (tA , tB )dtA dtB
R 30(tRA60
,tB )∈A
1
= dt dt
R030 4060 10000 40B A
= ( − 10000 )dtA
R030 10000
20
= 0 10000 A
dt
20 20
= 30 ∗ 10000 − 0 ∗ 10000
600
= 10000
6
= 100

c)
To find the probability that server A processes the packet and sends a response no later than 10
milliseconds after server B, we must calculate the probability that tA occurs ten milliseconds after
tB for any value of tb in the range of [0,90] milliseconds.

R 90 R t +10 1
= 0 0B dt dt
R 90 tB +10 100000 A B
= 0 ( 10000 − 10000 )dtB
R 90 B +10
= 0 t10000 dtB
t2
B +10tB 90
= 2
10000
8100
0
+900
= 2
10000
4950
= 10000
= 0.4950
In the [90,100] range, cdf of tA will be equal to 1, since tB + 10 will be more than 100 millisec-
onds. So we only need to calculate the cdf of tB in this range.

R 100 R 100 1
= 90 0 10000 dtA dtB
R 100 100 0
= 90 ( 10000 − 10000 )dtB
R 100 100
= 90 10000 dtB
R 100 1
= 90 100 dtB
100
tB
= 100
90
100 90
= 100
− 100
10
= 100
= 0.1
Since we need a union of probabilities from this range, let’s add up the two results we get:

0.495 + 0.1
= 0.595

2
d)
We should find the probability that their response times differ by less than 20 milliseconds. So
that response times do not differ by more than 20 milliseconds, server A should send a response
no early than 20 milliseconds after server B and no later than 20 milliseconds before server B

R 80 R t +20 1
= 20 tBB−20 10000 dt dt
R 80 tB +20 tB −20A B
= 20 ( 10000 − 10000 )dtB
R 80 40
= 20 10000 dt
R 80 40 B
= 20 10000 dtB
80
40∗tB
= 10000
20
3200 800
= 10000
− 10000
2400
= 10000
= 0.24
R 20 R t +20 1
= 0 0B dt dt
R 20 tB +20 100000 A B
= 0 ( 10000 − 10000 )dtB
R 20 B +20
= 0 t10000 dtB
t2
B +20∗tb 20
= 2
10000
0
200 400
= 10000
+ 10000
600
= 10000
= 0.06
R 100 R 100 1
= 80 tB −20 10000 dtA dtB
R 100 100 tb −20
= 80 ( 10000 − 10000 )dtB
R 100
= 80 120−t
10000
B
dtB
t2
120∗tb − 2B 100
= 10000
80
12000 5000
9600 3200
= 10000
− − 10000
10000
+ 10000
600
= 10000
= 0.06
Since we need a union of probabilities from all ranges, let’s add up the three results we get:

0.24 + 0.06 + 0.06 = 0.36

Answer 2
a)
We can use normal approximation to Binomial distribution.
The number X of frequent shoppers has Binomial Distribution with n = 150 and p = 0.6.

3
µ = np = 90
and
p √
σ= np(1 − p) = 150 ∗ 0.6 ∗ 0.4 = 6
In order to at least 65% of the customers in the random sample of 150 customers are frequent
shoppers, number of frequent shoppers should be more than or equal 97.5(150 ∗ 0.65). Since num-
ber of customers are discrete, number of frequent shoppers should be more than 97. Applying the
central limit theorem with the continuity correlation,

P{X > 97} = P{X > 97.5} = P { X−90


6
> 97.5−90
6
}
= 1 − Φ(1.25)
= 1 − 0, 8944
= 0, 1056

b)
The number X of rare shoppers has Binomial Distribution with n = 150 and p = 0.1.

µ = np = 15
and
p √
σ= np(1 − p) = 150 ∗ 0.1 ∗ 0.9 = 3.67
In order to no more than 15% of the customers in the random sample of 150 customers are rare
shoppers, number of rare shoppers should be less than or equal 22.5(150 ∗ 0.15). Since number of
customers are discrete, number of rare shoppers should be less than 23. Applying the central limit
theorem with the continuity correlation,

P{X < 23} = P{X < 22.5} = P { X−15


3.67
< 22.5−15
3.67
}
22.5−15
= Φ( 3.67 })
= Φ(2.0435)
= 0.9793

Answer 3
Standardize and use table A4. For a normal (µ = 175σ = 7) variable X,

4
X −µ
Z=
σ
X = µ + σZ
Now let’s substitute this formula we have obtained into the given inequality:

P {170 < X < 180} = P {170 < µ + σZ < 180}


= P {170 < 175 + 7 ∗ Z < 180}
= P {−5 < 7 ∗ Z < 5}
= P { −5
7
< Z < 57 }
≈ P {−0.71 < Z < 0.71}
= Φ(0.71) − Φ(−0.71)
= 0.7611 − 0.2389
= 0.5222

Answer 4
a)

heights = normrnd(175, 7, 1000, 1);

5
hist(heights, 15);
xlabel(’Height (cm)’);
ylabel(’Distribution’);
title(’Distribution of Heights’);

Based on the plot, it can be inferred that the height values are concentrated between 160-190
cm, which is not surprising considering the mean and standard deviation of the distribution. The
histogram has a symmetrical shape similar to a bell curve, which is a common characteristic of
a normal distribution. This suggests that the data is evenly distributed around the mean height,
with fewer individuals having extreme heights that deviate greatly from the mean.

b)

x = linspace(150, 200, 1000);

figure;
hold on;

six = normpdf(x, 175, 6);


seven = normpdf(x, 175, 7);
eight = normpdf(x, 175, 8);

plot(x, six, ’LineWidth’, 2);


plot(x, seven, ’LineWidth’, 2);
plot(x, eight, ’LineWidth’, 2);

6
legend(’sigma=6’, ’sigma=7’, ’sigma=8’);
xlabel(’Height ’);
ylabel(’probability density’);
title(’PDF of the normal distribution for different values of sigma’);

Based on the plots, it can be inferred that as the standard deviation increases, the distribution
becomes wider, indicating greater variability in the data. This implies that the likelihood of an
individual having a height that deviates significantly from the mean height of 175 cm increases
with a larger standard deviation. Conversely, when the standard deviation is smaller, the distri-
bution becomes narrower, and the data is more concentrated around the mean height, indicating
less variability in the data.

c)

n = 150;

count45 = 0;
count50 = 0;
count55 = 0;

for i = 1:1000
heights = normrnd(175, 7, n, 1);

rangeNum = sum(heights >= 170 & heights <= 180);

rangeProp = rangeNum / n;

if rangeProp >= 0.45


count45 = count45 + 1;
end
if rangeProp >= 0.50
count50 = count50 + 1;
end
if rangeProp >= 0.55
count55 = count55 + 1;
end
end

7
prob45 = count45 / 1000;
prob50 = count50 / 1000;
prob55 = count55 / 1000;

fprintf(’Probability of having at least 45%% of adults with heights between 170 cm and
180 cm = %0.4f\n’, prob45);
fprintf(’Probability of having at least 50%% of adults with heights between 170 cm and
180 cm = %0.4f\n’, prob50);
fprintf(’Probability of having at least 55%% of adults with heights between 170 cm and
180 cm = %0.4f\n’, prob55);

The probability estimates for the occurrence of having at least 45%, 50%, and 55% of adults
with heights between 170 cm and 180 cm in a randomly selected group of 150 individuals indicate
different likelihoods. The results suggest a high probability of finding at least 45% of adults with
heights in this range, with an estimated probability of 0.9710. However, the likelihood of having
at least 50% of adults with heights in this range decreases significantly to 0.7670. Moreover, the
probability of having at least 55% of adults with heights in this range is quite low at 0.2920. These
probability estimates are useful for understanding the characteristics of the population being sam-
pled.

I would also like to add that such a large difference between 50% and 55% indicates that the
probability calculated within 1000 repetitions is often in the range of 50% -55%. which is quite
significant considering the probability value of 52%, which we found in question 3.

You might also like