Practical No.
OBJECT:
SUPPOSE A STUDY TEAM HAS COLLECTED RESPONSE TIME DATA (IN
MILLISECONDS) FOR A WEB SERVER OVER A PERIOD OF TIME. THE
DATA CONSISTS OF 20 INDIVIDUAL RESPONSE TIMES AS FOLLOWS:
23,19,21,24,18,20, 22,26,17,25,20,19,22,21,20,19,23,18,22,24
A) CALCULATE THE MEASURES OF CENTRAL TENDENCY (MEAN,
MEDIAN AND MODE) TO DETERMINE THE TYPICAL OR AVERAGE
RESPONSE TIME EXPERIENCED BY USERS.
B) DETERMINE THE MEASURES OF DISPERSION (RANGE, VARIANCE
AND STANDARD DEVIATION) TO ASSESS THE VARIABILITY IN
THE RESPONSE TIMES AND UNDERSTAND HOW MUCH THEY
DEVIATE FROM THE AVERAGE.
C) IDENTIFY ANY OUTLIERS OR UNUSUAL DATA POINTS IN THE
RESPONSE TIME DATA THAT SIGNIFICANTLY DEVIATE FROM THE
REST OF THE DATA.
WORKING EXPRESSION:
Let ‘X’ be the web server response time (in milliseconds) and ‘n’ be the number of
responses.
Then,
Measure of Central Tendencies are:
∑𝑋
Mean (𝑋̅) = 𝑛
(𝑛+1)𝑡ℎ
Median (Md) = position
2
Mode (Mo) = Highest repeated value
Range (R) = Maximum Value – Minimum Value
∑ 𝑋2
Standard Deviation (𝜎) = √
𝑛
Variance (V) = (Standard Deviation)2 = 𝜎 2
CALCULATION:
From Excel, we got the following information:
A) Measure of Central Tendency
Parameters Symbol Value Formula
Mean 𝑋̅ 21.15 AVERAGE (A2:A21)
Median Md 21 MEDIAN (A2:A21)
Mode Mo 19 MODE (A2:A21)
To calculate mean, we used the AVERAGE function given by the Excel.
To calculate median, we used the MEDIAN function given by the Excel.
To calculate mode, we used the MODE function given by the Excel.
B) Measure of Dispersion
Parameters Symbol Value Formula
Maximum Max 26 MAX (A2:A21)
Minimum Min 17 MIN (A2:A21)
Range R 9 H8-H9
Standard Deviation 𝜎 2.497894 STDEV (A2:A21)
Variance V 6.239474 H11^2
To calculate Range, we first calculated Maximum and Minimum value by using the
MAX and MIN function respectively. Then, we subtracted Minimum value from
Maximum value to calculate the range.
To calculate Standard Deviation, we used the STDEV function given by Excel.
To calculate Variance, we simply squared the value of standard deviation.
To find out if there were any outlier, we constructed Box and Whisker’s Plot in Excel
and observed no outliers in the given data distribution.
OBSERVATION:
a) Measure of Central Tendency:
• Mean (𝑋̅) = 21.15 milliseconds
• Median (Md) = 21 milliseconds
• Mode (Mo) = 19 milliseconds
b) Measure of Dispersion:
• Range (R) = 9 milliseconds
• Standard Deviation (𝜎) = 2.497894 milliseconds
• Variance (V) = 6.239474 milliseconds
c) From the obtained Box and Whisker’s Plot, we can observe that there are no
outliers or unusual data in the given distribution.
Practical No. 2
OBJECT:
YOU HAVE COLLECTED DATA ON THE NUMBER OF WEBSITES VISITORS AND
THEIR CORRESPONDING CONVERSION RATES FOR A PARTICULAR ONLINE
STORE OVER A PERIOD OF TIME. THE DATA SET CONSISTS OF 18
OBSERVATIONS AS FOLLOWS:
WEBSITE VISITORS: 120, 150, 110, 135, 125, 130, 140, 115, 155, 125, 145, 130,
150, 120, 135, 125, 140, 130
CONVERSION RATES (IN %): 2.5, 3.2, 2.1, 2.8, 2.6, 2.7, 2.9, 2.3, 3.5, 2.6, 3.0, 2.7,
3.2, 2.4, 2.8, 2.6, 2.9, 2.7
a. CALCULATE THE CORRELATION COEFFICIENT BETWEEN THE NUMBER
OF WEBSITE VISITORS AND CONVERSION RATES TO DETERMINE THE
STRENGTH AND DIRECTION OF THE RELATIONSHIP BETWEEN THE
TWO VARIABLES.
b. PERFORM A SIMPLE LINEAR REGRESSION ANALYSIS TO PREDICT
CONVERSION RATES BASED ON THE NUMBER OF WEBSITE VISITORS.
CALCULATE REGRESSION EQUATION, INTERPRET THE COEFFICIENTS,
AND ASSESS THE GOODNESS OF FIT OF THE REGRESSION MODEL.
c. INTERPRET THE RESULTS OF THE CORRELATION AND REGRESSION
ANALYSIS IN THE CONTEXT OF THE ONLINE STORE'S PERFORMANCE.
DISCUSS ANY INSIGHTS OR OBSERVATIONS YOU CAN DRAW FROM THE
ANALYSIS.
WORKING EXPRESSION:
Let ‘X’ be the number of website visitors on a particular online store and ‘Y’ be their
corresponding conversion rates.
Then,
𝑛 × ΣXY − ΣX × ΣY
Correlation Coefficient (r) =
√[𝑛×ΣX2 −(ΣX)2 ] × [𝑛×ΣY2 −(ΣY)2 ]
Regression line Y on X:
Y = a + bX
Where, a = y-intercept
b = slope / regression coefficient
Coefficient of Determination (R2) = r2 = (Correlation)2
CALCULATION:
From Excel, we got the following information:
a) Correlation Coefficient
Parameter Symbol Value Formula
Correlation Coefficient r 0.986456 CORREL (A2:A19, B2:B19)
To calculate correlation coefficient, we used CORREL function given by EXCEL.
b) Regression Analysis
Parameter Symbol Value Formula
Slope b 0.026557377 SLOPE (B2:B19, A2:A19)
INTERCEPT (B2:B19,
Intercept a -0.76147541
A2:A19)
Y= - 0.76148
Regression line Y= a + bX + 0.026557 X
Correlation
r 0.986455641 CORREL (A2:A19, B2:B19)
coefficient
Coefficient of
𝑅2 0.973094732 N7^2
Determination
To calculate regression line Y on X, we first calculated slope(b) and intercept(a) using
SLOPE and INTERCEPT function given by excel. Then, we found out the regression
line by placing the value of ‘a’ and ‘b’ in the equation Y = a + bX.
To calculate the coefficient of determination, we first calculated the correlation
coefficient using the CORREL function and then simply squared the value of
correlation coefficient.
OBSERVATION:
a) The correlation coefficient(r) between the number of website visitors and
conversion rates for a particular store is 0.986455641.
Here, the correlation coefficient is very close to 1. So, it indicates a strong
positive linear relationship and as the number of website visitors increases, the
conversion rate also increases, and vice versa.
b) A simple linear regression equation to predict the conversion rates based on
the number of website visitors is:
Y= - 0.76148 + 0.026557 X
Here, the slope is 0.026557 i.e. when the number of website visitor increases
by 1, the conversion rate increases by 0.026557 %.
Also, the intercept is -0.76148 i.e. when the number of website visitor is 0, the
conversion rate is -0.76148 %.
Similarly, the coefficient of determination is 0.973094732 which is very high.
So, the regression model is properly explaining the variation of conversion
rates on the basis of number of website visitors.
c) The correlation coefficient between the number of website visitor and their
corresponding conversion rate for a particular online store is strongly positive
and the coefficient of determination is also very high. So, the performance of
online store is very good. Similarly, the slope is positive so the conversion rate
is also increasing along with the increase in the number of website visitors.
Practical No. 3
OBJECT:
SOFTWARE DEFECTS STUDY TEAM HAS COLLECTED DATA ON
THE NUMBER OF SOFTWARE DEFECTS FOUND IN A SERIES OF
SOFTWARE RELEASES. THE DATA SET CONSISTS OF 18
OBSERVATIONS AS FOLLOWS:
NUMBER OF DEFECTS: 0, 1, 3, 2, 1, 0, 1, 2, 0, 3, 2, 1, 1, 0, 2, 1, 1, 2
FIT A BINOMIALDISTRIBUTION TO THE DATA AND ESTIMATE THE
PARAMETERS ( N AND P ) OF THE DISTRIBUTION. INTERPRET THE
ESTIMATED PARAMETERS IN THE CONTEXT OF SOFTWARE
DEFECTS.
WORKING EXPRESSION:
Let ‘X’ be a random variable that denotes the number of software defects
found in a series of software releases.
Let ‘X’ follows binomial distribution with parameters number of trials (n) and
probability of success (p).
Then,
∑ 𝑓𝑥
Mean (𝑋̅) =
𝑁
Mean = n × p
Probability [P(X=x)] = nCx px qn-x
Where, q = 1 – p
Expected frequency = N × P(X=x)
CALCULATION:
From the Excel, we get the following information:
Arranging the given data in frequency table:
x f fx
0 4 0
1 7 7
2 5 10
3 2 6
∑f (N)=18 ∑fx= 23
Parameter Value Formula
n 3 given
Mean (𝑋̅) 1.277777778 D7/C7
p 0.425925926 C11/C10
Here, the parameter ‘n’ is given by the question as 3.
To calculate mean, we divided the sum of ‘f’ and ‘x’ and divided by total
frequency.
To calculate the parameter ‘p’, we divided the mean by the parameter ‘n’.
Fitting Binomial Distribution
x Observed frequency P(X=x) Expected frequency
0 4 0.189192 3
1 7 0.421106 8
2 5 0.312433 6
3 2 0.077268 1
18 1 18
Formula when x=0
P(X=0) COMBIN($C$10,B17)*($C$12^B17)*((1-$C$12)^($C$10-B17))
Expected
frequency $C$21*D17
To calculate the probability P(X=x), we used the COMBIN function to calculate
combination and multiplied it with the probability of success raised to the power
of ‘x’ and probability of failure raised to the power of ‘n-x’.
To calculate the expected frequency, we simply multiplied the respected P(X =
x) with the total frequency( N ).
OBSERVATION:
The value of parameters of this binomial distribution are as follows:
No. of trials (n) = 3
Probability of success (p) = 0.425925926
Here, the value of ‘n’ signifies that the checking for the software defects is repeated
for three times.
Likewise, the value of ‘p’ represents the likelihood of finding the software defects in
each try of the software release.
When the number of trials is 0, the likelihood of finding the software defect is
0.189192.
When the number of trials is 1, the likelihood of finding the software defect is
0.421106.
When the number of trials is 2, the likelihood of finding the software defect is
0.312433.
When the number of trials is 3, the likelihood of finding the software defect is
0.077268.
PRACTICAL NO: 4
OBJECT:
THE NUMBER OF FAILURES OF A COMPUTER SYSTEM IN A WEEK OF
OPERATION HAS THE FOLLOWING PMF
NO. OF FAILURE 0 1 2 3 4 5 6
PROBABILITY 0.18 0.28 0.25 0.18 0.06 0.04 0.01
FIND E(X), E(X2), VAR(X), E(2X+3), VAR(2X+3)
WORKING EXPRESSION:
For Expected Value:
Let ‘X’ be a random variable having pmf P(x), then mathematical expectation or
simply expectation is the arithmetic mean of random variable X and is denoted by
E(x) and given as:
E(x) = ∑𝑛𝑖=0 𝑥 P(x)
Properties:
o E(ax+b) = a E(x) + b
o E(a) = a
o E(ax2) = a. E(x2)
For Variance:
Let X be a random variable, then the variance is the expected value of square of
deviation taken from its expected value and is given as:
V(x) = E(x2) - [E(x)]2
Properties:
o V(ax+b) = a2 V(x) + 0
o V(a) = 0
o V(ax+by) = a2 V(x) + b2 V(y) + 2ab COV (xy)
CALCULATION:
From Excel Output:
Expected Value and Variance
Parameter Value Symbol Formula
Expected Value(x) 1.82 E(x) SUM (D3:D9)
Expected Value(x2) 5.22 E(x^2) SUM (E3:E9)
Variance(x) 1.9076 V(x) E10-(D10) ^2
Expected Value(2x+3) 6.64 E(2x+3) 2*D10+3
Variance(2x+3) 7.28 V(2X+3) 2^2*D10
INTERPRETATION:
o Thus, after the calculation, the expected value of x i.e., E(x) is found
to be 1.82.
o The expected value of x2 is found to be 5.22
o The variance of x is found to be 1.9076
o The expected value of 2x+3 i.e., E(2x+3) is found to be 6.64
o The variance of 2x+3 i.e., V(2x+3) is found to be 7.28
Practical No. 5
OBJECT:
COMPUTE MEAN, MEDIAN, MODE, RANGE, COEFFECIENT OF
RANGE, QUARTILE DEVIATION, COEFFECIENT OF QD, MEAN
DEVIATION, STANDARD DEVIATION AND CV OF THE FOLLOWING
DATA:
43 37 50 51 58 105 52 45 45 10 43 43
WORKING EXPRESSION:
Let ‘X’ be the data and ‘n’ be the number of responses.
Then,
∑𝑋
Mean (𝑋̅) = 𝑛
(𝑛+1)𝑡ℎ
Median (Md) = position
2
Mode (Mo) = Highest repeated value
Range (R) = Maximum Value – Minimum Value
̅ )2
∑(𝑋−𝑋
Standard Deviation (𝜎) = √
𝑛
𝑅
Coefficient of Range= 𝑀𝑎𝑥𝑖𝑚𝑢𝑚 𝑉𝑎𝑙𝑢𝑒 +𝑀𝑖𝑛𝑖𝑚𝑢𝑚 𝑉𝑎𝑙𝑢𝑒
Quartile Deviation (QD)= Q3 – Q1
𝑄𝐷
Coefficient of Quartile Deviation= 𝑄3 + 𝑄1
̅̅̅)
∑(𝑋−𝑋
Mean Deviation (MD)= 𝑛
𝜎
CV = 𝑋̅ × 100%
CALCULATION:
From Excel, we got the following information:
VALUE FORMULA
Mean: 48.5 AVERAGE(A2:A13)
Median: 45 MEDIAN(A2:A13)
Mode: 43 MODE(A2:A13)
Range: 95 A2-A13
Coefficient of Range: 0.826087 G6/(A2+A13)
Quartile Deviation: 8.25 QUARTILE(A2:A13,3)-QUARTILE(A2:A13,1)
Coefficient of QD: 0.087533 G8/(QUARTILE(A2:A13,3)+QUARTILE(A2:A13,1))
Mean Deviation: 12.25 AVERAGE(C2:C13)
Standard Deviation: 20.47966 SQRT(AVERAGE(D2:D13))
CV: 42.22611 (G11/G3)*100
In order to calculate mean, we used average function in Excel.
In order to calculate median, we used median function.
In order to calculate mode, we used mode function.
In order to calculate range, first data was sorted in largest to smallest order then we
subtracted the first element with last element.
To calculate Coefficient of range, we divided range with (maximum + minimum)
data.
To calculate QD, Q1 was subtracted from Q3.
To calculate Coefficient of QD, QD was divided by (Q1+Q3)
To calculate mean deviation, we found average of (X- 𝑋̅)
Likewise to calculate Standard Deviation, we found √𝑎𝑣𝑒𝑟𝑎𝑔𝑒 𝑜𝑓 (𝑋 − 𝑋̅)
𝑆𝑡𝑎𝑛𝑑𝑎𝑟𝑑 𝐷𝑒𝑣𝑖𝑎𝑡𝑖𝑜𝑛
And finally, coefficient of Variation (CV) was found using × 100%
𝑀𝑒𝑎𝑛
Below is the table used while calculating above data:
OBSERVATION:
o Thus, after the calculation, the mean was found to be 48.5
o Median was found to be 45
o Mode was found to be 43
o Range was found to be 95
o Coefficient of range was found to be 0.826087
o Quartile deviation was found to be 8.25
o Coefficient of quartile deviation was found to be 0.08753
o Mean Deviation was found to be 12.25
o Standard deviation was found to be 20.4797
o And Finally, CV was found to be 42.2261
Practical No. 6
OBJECT:
FIT THE BINOMIAL OF THE FOLLOWING DATA:
X 0 1 2 3 4
f 28 62 46 10 4
WORKING EXPRESSION:
Let ‘f’ be the given frequencies and ‘X’ be the provided data.
When a Binomial distribution is to be fitted to an observed data the following
procedure is adopted:
∑ 𝑓𝑋
i) Find mean (𝑋̅) = ∑𝑓
ii) Then equate the found mean with Binomial Mean i.e., Binomial Mean = np
𝑋̅
iii) Find p = 𝑛 where, n= number of observations
iv) Find q= 1- p
v) Write probability mass function: P(x) = nCx px qn-x where x= 0,1, 2, …, n
vi) Find the expected frequency using P(x) × N where N= ∑ 𝑓
vii) Calculate the sum of expected frequencies. It should be equal to the original N.
CALCULATION:
From Excel, we got the following information:
Symbol Value Formula
N or ∑ 𝑓 150 SUM(B2:B6)
200 SUM(C2:C6)
∑ 𝑓𝑋
𝑋̅ 1.3333333 C7/B7
p 0.3333333 B9/B10
Now, to calculate probability mass function in Excel, following steps were carried
out:
Step 1:
- Went in Formulas section and clicked on Insert Function.
- Following dialogue box appears. Pickup Statistical from the dropdown menu.
- Now select function “[Link]” and click “OK”
- The following dialogue box appears. Now for Number put the value of X. For
trials put the value of ‘n’. Next put the value of p in Probability and Set the
value of Cumulative to “False” for calculation of pmf.
For Calculation of Expected frequencies, multiply the obtained pmf with N.
Following data were obtained from Calculation.
OBSERVATION:
The expected frequencies were found to be: 29.62963556, 59.25926222, 44.44444,
14.81481111, 1.851851111 respectively. Which on Summation gave the value of N =
150.
Hence, binomial distribution was fitted successfully.
Practical No. 7
OBJECT:
THE FIVE NUMBERS SHOWN HERE ARE THE FIRST DIGITS TAKEN
FROM THE FIRST ROW OF THE RAND’S RANDOM NUMBER TABLE
WHICH ARE: {1, 5, 7, 3, 0}. SUPPOSE THEY REPRESENT THE
NUMBER OF MOBILES IN FIVE RANDOMLY SELECTED RURAL
HOUSEHOLD. ASSUME THESE NUMBER REPRESENT A SMALL
POPULATION FROM WHICH WE ARE GENERATING THE SAMPLE
DISTRIBUTION. PERFORM THE FOLLOWING TASKS:
A) CALCULATE THE MEAN AND VARIANCE OF THE GIVEN
POPULATION OF MOBILES.
B) CONSTRUCT ALL POSSIBLE SAMPLES FROM THIS POPULATION
OF SIZE 2 USING SAMPLING WITH REPLACEMENT (WR)
C) CALCULATE FROM EACH POSSIBLE SAMPLES, SAMPLE MEAN
(𝑋̅) AND SAMPLE VARIANCE (S2)
D) CALCULATE THE VARIANCE OF SAMPLE MEANS, VAR (𝑋̅)
E) TEST IF THE SAMPLE MEAN IS UNBIASED ESTIMATE OF THE
POPULATION MEAN?
F) VERIFY IF THE DIRECT FORMULA TO CALCULATE THE
𝜎2
VARIANCE OF SAMPLE MEANS VIZ. VAR (𝑋̅)WR = 𝑛
GIVES THE
SAME VALUE AS CALCULATED FROM (D) ABOVE.
WORKING EXPRESSION:
Let ‘f’ be the given frequencies and ‘X’ be the provided data.
When a Binomial distribution is to be fitted to an observed data the following
procedure is adopted:
Practical No. 8
OBJECT:
A POPULATION OF SIZE 800 IS DIVIDED INTO 3 STRATA. THEIR SIZES
AND STANDARD DEVIATIONS ARE GIVEN BELOW:
STRATA I II III
SIZE 200 300 300
S.D. 6 8 12
A STRATIFIED RANDOM SAMPLE OF SIZE 120 IS TO BE DRAWN FROM THE POPULATION.
CALCULATE THE VARIANCE OF THE ESTIMATE OF THE POPULATION MEAN
I) UNDER PROPOTIONAL ALLOCATION
II) UNDER NEYMAN’S OPTIMUM ALLOCATION