CS 700 Midterm
CS 700 Midterm
1a)
V1 vs V2 = (40/50 + 50/60 + 60/35)/3 = 1.1159
V1 vs V3 = (40/60 + 50/38 + 60/50)/3 = 1.0608
1b)
Harmonic mean would be used as the values are rate based metrics.
Vendor V1 has the highest performance and therefore is better than the
other two.
2) For this question, I have calculated A-B (and not B-A).
2b) ⍺ = 0.05
n=9
t[1-alpha/2; n-1] = 2.30600
2c) No we cannot say which one is better at the 95% significant level because
the confidence interval contains 0.
Calculation:
𝑠
𝑥̅ + 𝑡[1−⍺/2;𝑛−1] <0
√𝑛
⍺ = 0.07
2d) Using trial and error, we may find out what value of B is required to ensure
that B is better than A. I calculate the mean, sample standard deviation
at different values of B using the previous value of t-statistic (2.306)
We can see that the at B = 417, the confidence interval does not contain
0 and therefore, 417 is the minimum QoS value needed by B to be better
than A.
3a) 𝑝𝑎 = 0.7
n = 100
⍺ = 0.05
𝑝𝑎 (1−𝑝𝑎 )
𝑝𝑎 ± 𝑧1−⍺/2 √ 𝑛
𝑧1−⍺/2 = 1.96 𝑓𝑜𝑟 ⍺ = 0.05
3b) To ensure that B is better than A, the lower bound of B's confidence
interval must be greater than the upper bound of A's confidence
interval.
Calculation:
𝑝𝑏 (1−𝑝𝑏 )
𝑝𝑏 ± 𝑧1−⍺/2 √ > 0.7898
𝑛
Plugging in values for n, and z-statistic and manipulating the equation
we get the quadratic equation:
Then using the quadratic formula we can solve for pb. The values of pb
we get are:
𝑝𝑏 = 0.858203 𝑜𝑟 𝑝𝑏 = 0.699955
𝒑𝒃 = 𝟎. 𝟖𝟓𝟖𝟐
3c) To ensure that A is better than C, the lower bound of A's confidence
interval must be greater than the upper bound of C's confidence
interval.
Calculation:
𝑝𝑐 (1−𝑝𝑐 )
𝑝𝑐 ± 𝑧1−⍺/2 √ < 0.6102
𝑛
Plugging in values for n, and z-statistic and manipulating the equation
we get the quadratic equation:
Then using the quadratic formula we can solve for pb. The values of pb
we get are:
𝑝𝑐 = 0.512004 𝑜𝑟 𝑝𝑐 = 0.700243
𝒑𝒄 = 𝟎. 𝟓𝟏𝟐𝟎
4a) Null Hypothesis: mean response time (µ) ≥ 6.4
Alternate Hypothesis: mean response time (µ) < 6.4
⍺ = 0.1
n=64
To find the critical mean response time (Rc) threshold, we use the region
of rejection and make a formula for Rc:
Formula:
𝑅𝑐−µ
< −1.2815516
𝜎/√𝑛
Rc < 6.2077
Therefore, Rc = 6.208
4b) F1, F4 will be accepted for deployment as F1's value (6.1) and F's value
(6.2) are less than Rc (6.208). The other two - F2 (6.3) and F3 (6.25) -
have values greater than Rc and so are not deployed.
Formula:
𝑥̅ − µ
𝑍=
𝜎/√𝑛
Here 𝑥̅ is referring to F3's value. ie 𝑥̅ = 6.25. The rest is the same and
so:
Z = -1
Since p-value > ⍺, the null hypothesis is accepted for F3, and therefore
F3 is not deployed.
4d) To ensure all servers are accepted we can use similar formulation as in
4a.
𝑅𝑐−µ
< 𝑛𝑜𝑟𝑚𝑖𝑛𝑣(𝛼, 0,1)
𝜎/√𝑛
We set Rc to be the highest value of the server's ie, 6.3 (of F2) and the r
est is the same. We get:
ie. ⍺ = 0.26
5a)
Error (E) vs Rate (Khz) y = -1.8776x + 3.6766
R² = 0.5112
7
6
5
4
Error (E)
3
2
1
0
0 0.5 1 1.5 2 2.5 3
-1
-2
Rate (Khz)
Clearly the trend is not linear. Plotting the linear trend line and
calculating the R2 value (0.5112) further proves that the trend is not
linear.
5b)
H (1/E) vs Rate (Khz) y = 1.4397x - 0.2493
R² = 0.9922
4
3.5
3
2.5
H (1/E)
2
1.5
1
0.5
0
0 0.5 1 1.5 2 2.5 3
Rate (Khz)
The trend is very close to linear. Plotting the linear trend line and
calculating the R2 value (0.9922) further proves that the trend is linear.
5c)
To calculate the values of k0 and k1, the below values are calculated:
x = Rate
(Khz) y = H (1/E)
∑x 14.3 ∑y 17.59621
∑(x^2) 21.87 ∑(y^2) 35.89133
x_bar 1.19167 y_bar 1.46635
∑xy 27.92150 n 12
∑(𝑥𝑦)−𝑛𝑥̅ 𝑦̅
𝑘1 = ̅̅̅̅
∑(𝑥 2 )−𝑛𝑥 2 𝑘0 = 𝑦̅ − 𝑘1 𝑥̅
5d)
To calculate coefficient of determination (R2) we calculate SSE and SST in
advance:
SST 10.0891
SSE 0.0791
SST = ∑ 𝑦 2 − 𝑛𝑦̅ 2
𝑆𝑆𝐸
𝑅 2 = 1 − 𝑆𝑆𝑇
Then:
R2 = 0.9922
To calculate the confidence intervals for k0 and k1 the values below are
calculated:
se^2 0.00791 se 0.08896
sb0 0.05465 sb1 0.04048
alpha 0.05 t[1-alpha/2; n-2] 2.22814
𝑘0 ± 𝑡[1−𝛼/2;𝑛−2] 𝑠𝑏0
𝑘1 ± 𝑡[1−𝛼/2;𝑛−2] 𝑠𝑏1
5e)
SST and SSE are given above. SSR is calculated as follows:
SSR = 10.01
symp 0.03653
yp 0.5425
We calculate our yp using the given x (0.55) and our previous values of k0
and k1.
The formulae for calculating symp and the confidence intervals around
yp are: