Download as pdf or txt
Download as pdf or txt
You are on page 1of 53

18MAB204T - Probability and Queueing Theory

Unit - IV

Dr. E. Suresh,
Assistant Professor, Department of Mathematics,
SRM Institute of Science and Technology,
Kattankulathur - 603203.

June 16, 2022


Chi Square - Test

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Chi Square - Test

Type I: χ2 - Test for goodness of fit


Null hypothesis H0 : The differences between
observed and expected frequencies are significant.

If Oi is a set of observed frequencies and


Ei is the corresponding set of expected frequencies
then
n
X
2(Oi − Ei )2
Test statistic χ =
Ei
i=1
P P
with the condition Oi = Ei
degree of freedom v = n − 1
Dr. E.Suresh 18MAB204T - Probability and Queueing Theory
Chi Square - Test

Conclusion

Case (i): If χ2 < χ2α , H0 is accepted.


Case (ii): If χ2 > χ2α , H0 is rejected.

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


χ2 - Test for goodness of fit

Note

(i) For Binomial distribution:


Degrees of freedom v = n − 1.
(ii) For Poisson distribution:
Degrees of freedom v = n − 2.

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 1
The following figures show the distribution of digits in numbers
chosen at random from a telephone directory

Digits 0 1 2 3 4 5 6
Frequency 1026 1107 997 966 1075 933 1107
Digits 7 8 9
Frequency 972 964 853

Test whether the digits may be taken to occur equally frequently in


the directory.

Solution: Step(1): Null hypothesis H0 : The digits are occurs


equally frequently in the directory.
Step(2): Alternative hypothesis H1 : The digits are not occurs
equally frequently in the directory.
Step(3): Choose α = 5% level of significance.

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Step(4): Calculations:
Under the null hypothesis, the expected frequencies for each digit
10000
= = 1000.
10
The values of χ2 is calculated using the following table.
2
(Oi − Ei )
Digits Observed Frequency Oi Expected Frequency Ei
Ei
0 1026 1000
1 1107 1000
2 997 1000
3 966 1000
4 1075 1000
5 933 1000
6 1107 1000
7 972 1000
8 964 1000
9 853 1000
Total 10000 10000
Dr. E.Suresh 18MAB204T - Probability and Queueing Theory
Oi - Observed Frequency.
Ei - Expected Frequency.

(Oi − Ei )2
Digits Oi Ei
Ei
0 1026 1000 0.676
1 1107 1000 11.449
2 997 1000 0.009
3 966 1000 1.156
4 1075 1000 5.625
5 933 1000 4.489
6 1107 1000 11.449
7 972 1000 0.784
8 964 1000 1.296
9 853 1000 21.609
Total 10000 10000 58.542

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 1

n
2
X (Oi − Ei )2
Test statistic χ = = 58.542
Ei
i=1

The calculated value of χ2 = 58.542.


The table value of χ2 at 5% level of significance
with d.f v = n − 1 = 10 − 1 = 9,

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Chi Square - Test

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Chi Square - Test

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 1

χ2α = χ20.05 = 16.92.

Step (v): Conclusion:


Since χ2 > χ2α , H0 is rejected.

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 2

Problem No. 2
The following table gives the number of accidents that occurs
during the various days of the week. Find whether the accidents
are uniformly distributed over the week.

Days Sun Mon Tue Wed Thu Fri Sat


No.ofaccidents 14 16 8 12 11 9 14

Solution:
Step(1): Null hypothesis H0 : The accidents are uniformly dist over
the week
Step(2): Alternative hypothesis H1 : The accidents are not
uniformly dist over the week
Step(3): Choose α = 5% level of significance.
Dr. E.Suresh 18MAB204T - Probability and Queueing Theory
Problem No. 2
Step(4): Calculations:
Under the null hypothesis, the expected frequencies for each day =
84
= 12.
7
The values of χ2 is calculated using the following table.
(Oi − Ei )2
Days Obser Freq Oi Exp Freq Ei
Ei
Sun 14 12 0.333
Mon 16 12 1.333
Tue 8 12 1.333
Wed 12 12 0
Thu 11 12 0.083
Fri 9 12 0.75
Sat 14 12 0.333
Total 84 84 4.167

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 2

n
2
X (Oi − Ei )2
Test statistic χ = = 4.167.
Ei
i=1

The calculated value of χ2 = 4.167.


The table value of χ2 at 5% level of significance for two tailed test
with d.f v = n - 1 = 7 - 1 = 6, χ20.05 = 12.59.
Step (v): Conclusion:
Since χ2 < χ20.05 , H0 is accepted at 5% level of significance.

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 3

Problem No. 3
The theory predict the proportion of beans in the four groups A, B,
C and D should be 9 : 3 : 3 : 1. In an experiment among 1600
beans, the numbers in the four groups were 882, 313, 287 and 118.
Does the experimental results support the theory?.

Solution:
Step(1):
Null hypothesis H0 : The experimental results is support the theory.
Step(2):
Alternative hypothesis H1 : The experimental results is not support
the theory.
Step(3): Choose α = 5% level of significance.

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 3
Step(4): Calculations:
The total number of beans = 1600. Under the null hypothesis,
they are to be divided in the ratio 9 : 3 : 3 : 1. The expected
frequencies are calculated as follows
9
E (A) = × 1600 = 900,
16

3
E (B) = × 1600 = 300,
16

3
E (C ) = × 1600 = 300,
16

1
E (D) = × 1600 = 100.
16

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 3

The values of χ2 is calculated using the following table.

2
(Oi − Ei )
Type Observed Frequency Oi Expected Frequency Ei
Ei
A 882 900 0.36
B 313 300 0.5633
C 287 300 0.5633
D 118 100 3.24
Total 1600 1600 4.7266

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 3

n
2
X (Oi − Ei )2
Test statistic χ = = 4.72664.
Ei
i=1

The calculated value of χ2 = 4.7266.


The table value of χ2 at 5% level of significance for two tailed test
with d.f v = n - 1 = 4 - 1 = 3, χ20.05 = 7.815.
Step (v): Conclusion:
Since χ2 < χ20.05 , H0 is accepted at 5% level of significance.

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 4

Problem No. 4
4 coins were tossed 160 times and the following results were
obtained

No. of heads : 0 1 2 3 4
Observed frequencies : 17 52 54 31 6

Under the assumption that the coins are balanced and test the
goodness of fit. (or) fit a binomial distribution and test the
goodness of fit.

Solution:
Step(1): Null hypothesis H0 : The coins are balanced
Step(2): Alternative hypothesis H1 : The coins are not balanced
Step(3): Choose α = 5% level of significance.

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 4
Step(4): Calculations:
Under the null hypothesis, To find the expected frequency by using
binomial distribution.
The binomial distribution is given by

p (x) = n Cx p x q n−x , x = 0, 1, ...n


1
Where the number of coins n = 4, Prob. of getting head p =
2
1 1
and q = 1 − p = 1 − = .
2 2
N = total frequency = 160 and Expected frequency

E = N × p (x) = N × nCx p x q n−x , x = 0, 1, 2, 3, 4.

 x  4−x  4
1 1 4 1
E = 160 × 4Cx = 160 × cx , x = 0, 1, 2, 3, 4.
2 2 2

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 4

 4
1
When x = 0, E0 = Np (x = 0) = 160×4C0 = 160×0.0625 = 10
2
 4
1
When x = 1, E1 = Np (x = 1) = 160×4C1 = 160×0.25 = 40
2
 4
1
When x = 2, E2 = Np (x = 2) = 160×4C2 = 160×0.375 = 60
2
 4
1
When x = 3, E3 = Np (x = 3) = 160×4C3 = 160×0.25 = 40
2
 4
1
When x = 4, E4 = Np (x = 4) = 160×4C4 = 160×0.0625 = 10
2

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 4

The values of χ2 is calculated using the following table.


(Oi − Ei )2
No. of heads Obser Freq Oi Exp Freq Ei Ei
0 17 10 4.9
1 52 40 3.6
2 54 60 0.6
3 31 40 2.025
4 6 10 1.6
Total 160 160 12.725

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 4

n
2
X (Oi − Ei )2
Test statistic χ = = 12.725.
Ei
i=1

The calculated value of χ2 = 12.725.


The table value of χ2 at 5% level of significance for two tailed test
with d.f v = n - 1 = 5 - 1 = 4, χ20.05 = 9.488.
Step (v): Conclusion:
Since χ2 > χ20.05 , H0 is rejected at 5% level of significance.

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Type II:

Type II: χ2 - Test for Independence of attribute (or) for


contingency table

Null hypothesis H0 : The attributes are independent


If Oi is a set of observed frequencies and Ei is the corresponding
set of expected frequencies then
n
X
2(Oi − Ei )2
Test statistic χ =
Ei
i=1
P P
with the condition Oi = Ei and degree of freedom
v = (c − 1) (r − 1) where r is th number of rows and c is the
number of columns.

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Conclusion
Case (i): If calculated value of χ2 < χ2α , H0 is accepted at a
particular level of significance
Case (ii): If calculated value of χ2 > χ2α , H0 is rejected at a
particular level of significance.

Note:
The expected frequency for each cell is
RT × CT
E=
N
where

RT is row total
CT is column total
N is total of frequency
Dr. E.Suresh 18MAB204T - Probability and Queueing Theory
Problem No. 1

Problem No. 1
Two researchers adopted different sampling techniques while
investigating same group of students to find the number of
students falling in different intelligence levels. The results as
follows : No. of students

Researchers Below Average Average Above Average Genius


X 86 60 44 10
Y 40 33 25 2

Would you say that the sampling techniques adopted by the two
researchers are significantly different?

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 1
Solution:
Step(1): Null hypothesis H0 : The two attributes are independent
Step(2): Alternative hypothesis H1 : The two attributes are not
independent
Step(3): Choose α = 5% level of significance.
Step(4): Calculations:

Researchers Below Ave Average Above Ave Genius Total


X 86 (1,1) 60(1,2) 44(1,3) 10(1,4) 200
Y 40(2,1) 33(2,2) 25(2,3) 2(2,4) 100
Total 126 93 69 12 300
N = total frequency = 300
To find the expected frequency for each cell by using the following
formula
RT × CT
E=
N
Dr. E.Suresh 18MAB204T - Probability and Queueing Theory
Problem No. 1

Researchers Below Ave Average Above Ave Genius Total


X 86 (1,1) 60(1,2) 44(1,3) 10(1,4) 200
Y 40(2,1) 33(2,2) 25(2,3) 2(2,4) 100
Total 126 93 69 12 300

CT × RT 126 × 200 CT × RT 93 × 200


E11 = = = 84, E12 = = = 62
N 300 N 300
CT × RT 69 × 200 CT × RT 12 × 200
E12 = = = 46, E14 = = =8
N 300 N 300
CT × RT 126 × 100 CT × RT 93 × 100
E21 = = = 42, E22 = = = 31
N 300 N 300
CT × RT 69 × 100 CT × RT 12 × 100
E23 = = = 23, E24 = = =4
N 300 N 300
Dr. E.Suresh 18MAB204T - Probability and Queueing Theory
Problem No. 1

The values of χ2 is calculated using the following table.


(Oi − Ei )2
Cell Obser Freq Oi Exp Freq Ei Ei
(1,1) 86 84 0.0476
(1,2) 60 62 0.0645
(1,3) 44 46 0.0869
(1,4) 10 8 0.5
(2,1) 40 42 0.0952
(2,2) 33 31 0. 129
(2,3) 25 23 0.1739
(2,4) 2 4 1
Total 300 300 2.0971

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 1

n
X (Oi − Ei )2
Test statistic χ2 = = 2.0971.
Ei
i=1

The calculated value of χ2 = 2.0971.


2
The table value of χ at 5% level of significance for two tailed test
with d.f v = (c − 1) (r − 1) = (4 − 1)(2 − 1) = 3 ,
χ20.05 =.
Step (v): Conclusion:
Since χ2 < χ20.05 , H0 is accepted at 5% level of significance.

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 2
A large organization is checking whether a relationship exists
between the commuting time of its employees and the level of
stress related problems. A survey of 116 assembly line operators
revealed the following

Levels of stress
Cummuting time High Moderate Low Total
Under 15 min 9 5 18 32
15 − 45 min 17 8 28 53
over 45 min 18 6 7 31
Total 44 19 53 116

Use chi-square test, check whether a relation exists between the


factors at 0.01 level of significance.

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 2
Solution: Step(1): Null hypothesis H0 : The two attributes are
independent
Step(2): Alternative hypothesis H1 : The two attributes are not
independent
Step(3): Choose α = 5% level of significance.
Step(4): Calculations:
Cumm time High Moderate Low Total
Under 15 min 9 (1,1) 5(1,2) 18(1,3) 32
15 - 45 min 17(2,1) 8(2,2) 28(2,3) 53
Over 45 min 18(3,1) 6(3,2) 7(3,3) 31
Total 44 19 53 116
N = total frequency = 116
To find the expected frequency for each cell by using the following
formula
RT × CT
E=
N
Dr. E.Suresh 18MAB204T - Probability and Queueing Theory
Problem No. 2

CT × RT 44 × 32
E11 = = = 12.138
N 116
CT × RT 19 × 32
E12 = = = 5.241
N 116
CT × RT 53 × 32
E13 = = = 14.621,
N 116
CT × RT 44 × 53
E21 = = = 20.103
N 116

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 2

CT × RT 19 × 53
E22 = = = 8.681
N 116
CT × RT 53 × 53
E23 = = = 24.216
N 116
CT × RT 44 × 31
E31 = = = 11.756
N 116
CT × RT 19 × 31
E32 = = = 5.078
N 116
CT × RT 53 × 31
E33 = = = 14.164
N 116

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 2

The values of χ2 is calculated using the following table.


(Oi − Ei )2
Cell Obser Freq Oi Exp Freq Ei Ei
(1,1) 9 12.138 0.811
(1,2) 5 5.241 0.011
(1,3) 18 14.621 0.781
(2,1) 17 20.103 0.479
(2,2) 8 8.681 0.053
(2,3) 28 24.216 0.591
(3,1) 18 11.759 3.312
(3,2) 6 5.078 0.167
(3,3) 7 14.164 3.623
Total 116 116 9.828

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 2

n
X (Oi − Ei )2
Test statistic χ2 = = 9.828.
Ei
i=1

The calculated value of χ2 = 9.828.


2
The table value of χ at 1% level of significance for two tailed test
with d.f v = (c − 1) (r − 1) = (3 − 1)(3 − 1) = 4 ,
χ20.01 = 13.277.
Step (v): Conclusion:
Since χ2 < χ20.05 , H0 is accepted at 5% level of significance.

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 3

Problem No. 3
In an investigation in to health and nutrition of two groups of
children of different social status, the following results are got.

Social of status
Health Poor Rich Total
Below normal 130 20 150
Above 24 96 120
Normal 102 108 210
Total 256 224 480

Discuss the relation between the health and their social status use
chi-square test.

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 3
Solution: Step(1): Null hypothesis H0 : The two attributes are
independent
Step(2): Alternative hypothesis H1 : The two attributes are not
independent
Step(3): Choose α = 5% level of significance. Step(4):
Calculations:
Health Poor Rich Total
Below normal 130 (1,1) 20(1,2) 150
Above normal 24(2,1) 96(2,2) 120
Normal 102(3,1) 108(3,2) 210
Total 256 224 480
N = total frequency = 116
To find the expected frequency for each cell by using the following
formula
RT × CT
E=
N
Dr. E.Suresh 18MAB204T - Probability and Queueing Theory
Problem No. 3

CT × RT 100 × 150
E11 = = = 80
N 480
CT × RT 224 × 150
E12 = = = 70
N 480
CT × RT 256 × 120
E21 = = = 64
N 480
CT × RT 224 × 120
E22 = = = 56
N 480
CT × RT 256 × 210
E31 = = = 112
N 480
CT × RT 224 × 210
E32 = = = 98
N 480

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 3

The values of χ2 is calculated using the following table.


(Oi − Ei )2
Cell Obser Freq Oi Exp Freq Ei Ei
(1,1) 130 80 31.25
(1,2) 20 70 35.71
(2,1) 24 64 25
(2,2) 96 56 28.357
(3,1) 102 112 0.89
(3,2) 108 98 1.02
Total 480 480 122.44

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 3

n
X (Oi − Ei )2
Test statistic χ2 = = 122.44.
Ei
i=1

The calculated value of χ2 = 122.44.


2
The table value of χ at 5% level of significance for two tailed test
with d.f v = (c − 1) (r − 1) = (3 − 1)(2 − 1) = 2 ,
χ20.01 = 5.991.
Step (v): Conclusion:
Since χ2 > χ20.05 , H0 is rejected at 5% level of significance.

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 4
Problem No. 4
A brand Manager is concerned about its share across the country.
Results of survey are as follows

North South East West Total


who purchase the brand 40 55 45 50 190
who do not purchase the brand 60 45 55 50 210
Total 100 100 100 100 400

(i) Develop a table of observed and expected frequencies for this


problem
(ii) State the null and alternative hypothesis
(iii) Calculate the χ2 value
(iv) At 5% level, test whether brand share is the same across the
four regions.
Dr. E.Suresh 18MAB204T - Probability and Queueing Theory
Problem No. 4
Solution: Step(1): Null hypothesis H0 : The two attributes are
independent
Step(2): Alternative hypothesis H1 : The two attributes are not
independent
Step(3): Choose α = 5% level of significance.
Step(4): Calculations:
North South Est West Total
Purchase 40 (1,1) 55(1,2) 45(1,3) 50(1,4) 190
Not purchase 60(2,1) 45(2,2) 55(2,3) 50(2,4) 210
Total 100 100 100 100 400

N = total frequency = 400


To find the expected frequency for each cell by using the following
formula
RT × CT
E=
N

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 4

CT × RT 100 × 190 100 × 190


E11 = = = 47.5, E12 = = 47.5
N 400 400

CT × RT 100 × 190 100 × 190


E13 = = = 47.5, E14 = = 47.5
N 400 400
CT × RT 100 × 210 100 × 210
E21 = = = 52.5, E22 = = 52.5
N 400 400
CT × RT 100 × 210 100 × 210
E23 = = = 52.5, E24 = = 52.5
N 400 400

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 4

The values of χ2 is calculated using the following table.


(Oi − Ei )2
Cell Obser Freq Oi Exp Freq Ei Ei
(1,1) 40 47.5 1.1842
(1,2) 55 47.5 1.1842
(1,3) 45 47.5 0.1315
(1,4) 50 47.5 0.1315
(2,1) 60 52.5 1.0714
(2,2) 45 52.5 1.0714
(2,3) 55 52.5 0.1190
(2,4) 50 52.5 0.1190
Total 400 400 5.0122

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 4

n
X (Oi − Ei )2
Test statistic χ2 = = 5.0122.
Ei
i=1

The calculated value of χ2 = 5.0122.


2
The table value of χ at 5% level of significance for two tailed test
with d.f v = (c − 1) (r − 1) = (4 − 1)(2 − 1) = 3 ,
χ20.05 = 7.815.
Step (v): Conclusion:
Since χ2 < χ20.05 , H0 is accepted at 5% level of significance.

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 5
From a poll of 800 television viewers, the following data have been
accumulated as to their levels of education and their preference of
television stations. We are interested in determining if the selection
of a T . V station is independent of levels of education.
Educational level
High school Bachelor Graduate Total
Public Broadcasting 50 150 80 280
Commercial stations 150 250 120 520
Total 200 400 200 800

(i) State the null hypothesis and alternative hypothesis


(ii) Show the contingency table of a expected frequency
(iii) Compute test statistic
(iv) The null hypothesis is tested at 95% confidence. Determine
the critical value for this test.
Dr. E.Suresh 18MAB204T - Probability and Queueing Theory
Problem No. 5
Solution:
Step(1): Null hypothesis H0 : The two attributes are independent
Step(2): Alternative hypothesis H1 : The two attributes are not
independent
Step(3): Choose α = 5% level of significance.
Step(4): Calculations:
High School Bachelor Graduate Total
Public 50 (1,1) 150(1,2) 80(1,3) 280
Commerircial 120(2,1) 250(2,2) 120(2,3) 520
Total 200 400 100 800

N = total frequency = 800


To find the expected frequency for each cell by using the following
formula
RT × CT
E=
N

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 5

CT × RT 200 × 280 400 × 280


E11 = = = 70, E12 = = 140
N 800 800

CT × RT 200 × 200 200 × 520


E13 = = = 70, E21 = = 130
N 800 800
CT × RT 400 × 520 250 × 520
E22 = = = 260, E23 = = 130
N 800 800

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 5

The values of χ2 is calculated using the following table.


(Oi − Ei )2
Cell Obser Freq Oi Exp Freq Ei (Oi − Ei )2 Ei
(1,1) 50 70 400 2.71
(1,2) 150 140 100 0.71
(1,3) 80 70 100 1.43
(2,1) 150 130 400 3.08
(2,2) 250 260 100 0.39
(2,3) 120 130 100 0.77
Total 800 800 12.09

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Problem No. 5

n
X (Oi − Ei )2
Test statistic χ2 = = 12.09.
Ei
i=1

The calculated value of χ2 = 12.09.


2
The table value of χ at 5% level of significance for two tailed test
with d.f v = (c − 1) (r − 1) = (3 − 1)(2 − 1) = 2 ,
χ20.05 = 5.991.
Step (v): Conclusion:
Since χ2 > χ20.05 , H0 is rejected at 5% level of significance.

Dr. E.Suresh 18MAB204T - Probability and Queueing Theory


Dr. E.Suresh 18MAB204T - Probability and Queueing Theory

You might also like