16BCE0766
DIGITAL ASSIGNMENT - I NAME: ROHIT VEMPARALA REGISTRATION NUMBER: 16BCE0766 SLOT: E1+TE1 FACULTY: EASWARAMOORTHY
16BCE0766 QUESTIONS
1. Compute the mean, median and mode for the following frequency distribution.
Solution CLASS INTERVAL 20-25 25-30 30-35 35-40 40-45 45-50 50-55 55-60 60-65
FREQUENCY 30 160 210 180 145 105 70 60 40
Xi 22.5 27.5 32.5 37.5 42.5 47.5 52.5 57.5 62.5
Di -4 -3 -2 -1 0 1 2 3 4
A (Assumed mean) = 42.5 ∑ f = N = 1000 ∑ fi di = -615
CF 30 190 400 580 725 830 900 960 1000
Fidi -120 -480 -420 -180 0 105 140 180 160
C (class width) = 5 di = (xi - A )/c
Mean
Mean = A + ((∑ fi di)/N)* c = 42.5 + (-615/1000) = 39.45 Median
N = 1000 Here N is even N/2, (N+1)/2 = 500,500.5 Median class = 35*40 l = 35
f = 180
Average of N/2 and (N+1)/2 = 500.25
m = 400
Median = l + ((N/2 - m)/N)*c = 35=50/18 = 37.7 Mode
F1 = 210
f0 = 160
f2 = 180
l=30
mode = l + ((f1 – f0)/(2*f1+(f0+f2))) * c = 30 + (210-160)/(420-340)*5 = 33.125
c=5
16BCE0766 2. Calculate the mean, variance and standard deviation for the following frequency Distribution, and hence obtain the value of co-efficient of variation.
Solution Size (x) 0 1 2 3 4 5 6 7 8
∑ f = N = 256
Frequency (f) 1 8 28 56 70 56 28 8 1
∑ fixi = 1024
Mean = (∑fixi)/N = 1024/256 = 4 Standard Deviation =
∑(∑) ∑) = 1.4142 ^
Variance = 2 Coefficient of variation =
∗ 100 = 35.3553 35.3553
3. Find the first four f our moments about the mean and Pearson’s co-efficient β1 and β 2 for the following frequency distribution, and also comment the nature of skewness and kurtosis of the distribution based on the Pearson’s Pea rson’s co-efficient β1 and β2
Solution Class 170-180 180-190 190-200 200-210 210-220 220-230 230-240 240-250 Total
f 52 68 85 92 100 95 70 28 590
x 175 185 195 205 215 225 235 245
d -4 -3 -2 -1 0 1 2 3
fd -208 -204 -170 -92 0 95 140 84 -355
832 612 340 92 0 95 280 252 2503
-3378 -1836 -680 -92 0 95 560 756 -4525
13312 5508 1360 92 0 95 420 2268 2375
16BCE0766
355 ∗10 = −6.0169 μ1 = ∑ ∗ = − 2503 590 ∑ μ2 = ∗ = 590 ∗100 = 424.2372 ∑ μ3 = ∗ = −4525 ∗1000 = −7669.4912 590 ∑ μ4 = ∗ = 23755 590 ∗10000 = 402627.1186 µ1 = 0 µ2 = µ3 = µ4 =
μ2 − (μ1) = 388.0341 μ3 − 3(μ2μ1) μ1) +2 + 2(μ1) = −229. 5431 μ4 − 4(μ3 μ1 ) +6μ2 (μ1 ) − 3(μ1) = 214108.882 882
Pearson’s Coefficients β1 and β2
() ) = . = 0.4611 . = . = 1.4219 β2 = () ) . β1 =
Nature of kurtosis is platykurtic Coefficient of skewness
β1( β1(β2+3) β2+3) = √ 1.4219+3 = 3.0026 = −0.3223 = 2(5 (β2) = 04611∗ 0 4611∗ √ β2) −6β1−9) −6β1−9) 2(7.1095− 2.7666) 2.7666) − 9 −9.3142 Nature of skewness is negatively skewed
4. Find the value of a, P(X < 3), cumulative distribution function, mean, variance and standard deviation of the discrete random variable (X) with the following probability distribution.
∑ P(X=xi) = 1 => a+3a+5a+7a+9a+11a+1 a+3a+5a+7a+9a+11a+13a+15a=17a 3a+15a=17a = 1
81a = 1 a = 1/81
P(X < 3) = P(X=0) + P(X=1) + P(X=2) = a+3a+5a = 9a = 1/9 Cumulative distribution distribution function CDF (F(x)) = P (X<=x) = ∑P(x) F(0) = 0
F(1) = P(X = 0) = 1/81
Similarly F (2) = 4/81 F (8) = 64/81
F (3) = 1/9 F(9) = 1
F(4) = 16/81
F(5) = 25/81
F(6) = 36/81
F(7) = 49/81
16BCE0766 Mean = ∑x*P(x) = 0 + 1(3/81) + 2*(5/81) +3*(7/81) +4*(9/81) + 5*(11/81) + 6*(13/81) + 7*(15/81) + 8*(17/81) = 444/81 = 5.481 Variance = ∑(x-mean)^2 * P(x) or = ( 5.48)^2*1/81 + …
Variance = 4.47277 Standard Deviation SD =
∑ − () 34.51855 − (5.4814) 814) ∑ ) = 34.518
√ = 2.1148
5. Find the value of k, cumulative distribution function, mean, variance and standard deviation of the continuous c ontinuous random variable (X) with the following probability density function.
Solution
∫ ()= 1 +0 =1 ∫ (2−) ∗ ∫ 2 − = 1
k=¾ Cumulative distribution function
∫ ()= 1 F (x < 0) = 0 F (0 < x < 2) = F (x > 2) = 0
F(x) =
∫ () for a value of x
∫ () = 1
() = ∫ (2 − ) = ∗ = 1 ∫ ( − )(2 − ) = ∗ = Variance = ∫( − )) () = ∫( − 1) ∗ ()(2 Standard deviation = √ = 1/√ 1/√ 2 Mean =
6. Three balls are drawn at random without replacement from a box containing 2 white, 3 red and 4 black balls. If X denotes the number of white balls drawn and Y denotes the number of red balls drawn, find the j oint probability distribution of (X; Y ). Solution: 2 White balls, 3 Red b alls, 4 black balls and 3 balls are drawn at random from the given balls X takes the values 0, 1, 2 Y takes the values 0, 1,2 3
16BCE0766 The different cases are as follows P(X=0 Y=0) = 4C3/9C3 = 1/21 P(X=0 Y=1) = (3C1 X 4C2)/9C3 = 3/14 P(X=1 Y=0) = 1/7 P(X=1 Y=1) = 2/7 P(X=2 Y=0) = 1/14 P(X=2 Y=1) = 1/28 P(X=2 Y=3) = 0
P(X=0 Y=2) = (3C2 X 4C1)/9C3 = 1/7 P(X=0 Y=3) = 1/84 P(X=1 Y=2) = 1/14 P(X=1 Y=3) = 0 P(X=2 Y=2) = 0 P(X=2 Y=2) = 0
Joint distribution Table X
Y
0 1/21 1/7 1/21
0 1 2
1 3/14 2/7 1/28
2 1/7 1/14 0
3 1/84 0 0
7. The joint probability density function of two-dimensional continuous random variable (X; Y ) is given by
Solution
= 1
Substitution method Taking => 2xdx=dt => xdx = ½ dt a nd K(0-1)(0-1) = 4 K=4
=
= => 2ydy=dk => ydy = ½ dk
f(x,y) = 4xy
Marginal Functions
f (y) = ∫ 4 = −2 ∫ 4 = −2 f(x) . f(y) = −2 . .−2 −2 = 4 = (, , ) f (x) =
Hence x and y are independent from the property Hence proved
8. A line of length a units is divided into two parts. If the first part is of length X, then find E(X), Var(X), and E [X(a X)]. Solution: X is uniformly distributed in (0,0)
16BCE0766 f(x) = 1/a
∫ ∗() = ∗ ∫ = () = ( () = 3 − = Variance (x) = ( ) − ( ) = (( − ) = ( () − () = 3 − 4 = 12 E(x) =
9. Compute the coefficient of correlation between the following two set of measures X and Y and hence comment the nature of correlation between X and Y.
Solution Changing the origin Minimum value among the values of X is 65 Maximum value among the values of X is 71 New origin of X = = 68
Minimum value among the values of Y is 64 Maximum value among the values of Y is 72 New origin of Y = = 68
(65+ (65 + 71)/2 71)/2
X=xi 65 67 66 71 67 70 68 69
Y=yi 67 68 68 70 64 67 72 70 Total
Ui-xi-68 3 1 2 3 1 2 0 1 -1
rXY = rUV = (n ∑UV - ∑U. ∑V) /(
(64+72)/2
Vi=yi-68 -1 0 0 2 -4 -1 4 2 2
Ui^2 9 1 4 9 1 4 0 1 29
Vi^2 1 0 0 4 16 1 16 4 39
Uivi 3 0 0 6 4 -2 0 2 13
∑U − (∑U) ∑U) ∗ ∗ ∑V ∑V − (∑V ∑V)) ) )
= 0.3974
10. Write and execute a program in C, C++ Languages or in MATLAB for any problem in Statistical or Probabilistic Measures. (Include the problem statement and the programming code with output for the problem). Solution: Problem Statement Write the R programming code for computing the mean, median, mode, variance, standard deviation, co-efficient of variation, first four moments about the mean and Pearson’s co-efficients B1 & B2 for the following frequency distribution, distribution, and also comment on the nature of skewness and kurtosis of the distribution based on the Pearson’s co-efficient β1 & β2
16BCE0766
R-PROGRAMMING PART R – Code #Mean
> h=10 > x=seq(175,245,h) > f=c(52,68,85,92,100,95,70,28) f=c(52,68,85,92,100,95,70,28) > M=(sum(x*f))/sum(f) >M [1] 208.9831 > #Median
> h=10 > x=seq(175,245,h) > f=c(52,68,85,92,100,95,70,28) f=c(52,68,85,92,100,95,70,28) > fd=data.frame(x,f) > cf=cumsum(f) > n=sum(f) > mc=min(which(cf>=n/2 mc=min(which(cf>=n/2)) )) > mcf=f[mc] > c=cf[mc-1] > l=x[mc]-h/2 > Md=l+(((n/2)-c)/mcf)*h
16BCE0766 > Md [1] 209.7826 > #Mode
> h=10 > x=seq(175,245,h) > f=c(52,68,85,92,100,95,70,28) f=c(52,68,85,92,100,95,70,28) > fd=data.frame(x,f) > mc=which(f==max(f)) > mcf=f[mc] > f1=f[mc-1] > f2=f[mc+1] > l=x[mc]-h/2 > Mo=l+((mcf-f1)/(2*mcfMo=l+((mcf-f1)/(2*mcf-f1-f2))*h f1-f2))*h > Mo [1] 216.1538 #Variance, Standard Deviation and Pearson's coefficients
> h=10 > x=seq(175,245,h) > f=c(52,68,85,92,100,95,70,28) f=c(52,68,85,92,100,95,70,28) > N=sum(f) > M=(sum(x*f))/sum(f) >M [1] 208.9831 > Var=((1/N)*(sum(x^2*f)))-((1/N)*(sum(x*f)))^2 > Var
16BCE0766 [1] 388.0336 > SD=sqrt(Var) > SD [1] 19.69857 > CV=100*(SD/M) > CV [1] 9.425917 > #Moments and Pearson's Coefficients
> h=10 > x=seq(175,245,h) > f=c(52,68,85,92,100,95,70,28) f=c(52,68,85,92,100,95,70,28) > N=sum(f) > M=(sum(x*f))/sum(f) > M1=sum(((x-M)^1)*f)/N > M2=sum(((x-M)^2)*f)/N > M3=sum(((x-M)^3)*f)/N > M4=sum(((x-M)^4)*f)/N > B1=(M3^2)/(M2^3) > B2=(M4)/(M2^2) > B1 [1] 0.003424753 > B2 [1] 2.034009