You are on page 1of 14

July 2011

Master of Computer Application (MCA) - Semester 3


Mc0074 5totistico/ ond Numerico/ methods usinq c++ 4 credits
4ssiqnment 5et 1

1. Discuss and define the CorreIation coefficient with the suitabIe exampIe.
Ans:
Correlation coefficient
Correlation is one oI the most widely used statistical techniques. Whenever two variable are so
related that a change in one variable result in a direct or inverse change in the other and also
greater the magnitude oI change in one variable corresponds to greater the magnitude oI change
in the other, then the variable are said to be correlated or the relationship between the variables is
known as correlation.
We have been concerned with associating parameters such as E(x) and V(X) with the distribution
oI one-dimensional random variable. II we have a two-dimensional random variable (X,Y), an
analogous problem is encountered.
efinition
Let (X, Y) be a two-dimensional random variable. We deIine p
xy
, the correlation coeIIicient,
between X and Y, as Iollows:
p
xy

The numerator oI p, is called the covariance oI X and Y.

Example
Suppose that the two-dimensional random variable (X, Y) is uniIormly distributed over the
triangular region
R (x, y) , 0 x y 1}
The pdI is given as
I(x, y) 2, (x, y) R,
0, elsewhere.
Thus the marginal pdI`s oI X and oI Y are
g(x)
2 (1 x), 0 x 1
h(y)
2y, 0 y 1
ThereIore
E(X) , E(Y)
E(X
2
) , E(Y
2
)
V(X) E(X
2
) (E(X))
2
V(Y) E(Y
2
) (E(Y))
2

E(XY)
Hence
p
xy








. If x is normaIIy distributed with zero mean and unit variance, find the expectation and
variance of
2
9 .
Ans
$olution
The equation oI the normal curve is

II mean is zero and variance is unit, then putting m0 and ,the above equation reduced to

Expectation oI x
2
i.e.

(i)

Integrating by parts taking x as Iirst Iunction and remembering that


Putting



Hence
1 (ii)



Integrating by parts taking x
3
as Iirst Iunction


3
3(1) with the help oI (ii)

Variance oI x
2

3-(1)
2

2










. The saIes in a particuIar department store for the Iast five years is given in the
foIIowing tabIe
Years 197 1976 1978 1980 1982
SaIes (in
Iakhs)
0 8 52 57

Estimate the saIes for the year 1979.


Ans:

ewton`s backward diIIerence table is

We have
p
y
n
5,
2
y
n
1,
3
y
n
2,
4
y
n
5
ewton`s interpolati0on Iormula gives
y
1979
57 (-1.5) 5
57 7.5 0.375 0.125 0.1172
y
1979
50.1172


5. Find out the geometric mean of the foIIowing series
CIass 0-10 10-20 20-0 0-0 0-50
Frequency 17 10 11 15 8
Ans
Here we have
Class Frequency(I) Mid value(x) Log x I.(Logx)
0-10 17 5 .6990 11.883
10-20 10 15 1.1761 11.761
20-30 11 25 1.3979 15.3769
30-40 15 35 1.5441 23.1615
40-50 8 45 1.6532 13.2256
61 Sum75.408

II F be the required geometric mean, then
Log G
1/61(75.408)
1.236197
G antilog 1.23
16.28
6. Find the equation of regression Iine of x on y from the foIIowing data
x 0 1 2
y 10 12 27 10 0
Ans

sum(X) 01234 10
sum(X) 01234 30
sum(Y) 1012271030 89
sum(Y) 1012271030 1973
sum(XY) 0.10 1.12 2.27 3.10 4.30 10.89
n 5
Xbar sumX / n 10 / 5 2
Ybar sumY / n 89 / 5 17.8
gradient m | n sumXY - sumX sumY | / | n sumX - (sumX) |
(5.10.89 - 10.89) / (5.30 - 10)
(54.45 - 890) / (150 - 100)
-835.55 / 50
-16.711
Equation is y mx c
Ybar m.Xbar c
17.8 -16.711(2) c
c 17.8 33.422 51.222
ThereIore the equation oI the regressed line is y (-16.711)x 51.222







July 2011
Master of Computer Application (MCA) - Semester 3
Mc0074 5totistico/ ond Numerico/ methods usinq c++ 4 credits
4ssiqnment 5et 2

1. If
3
2
is approximated by 0.667, find the absoIute and reIative errors?
ns : Abso|ute re|at|ve and percentage errors
n error is usually quantiIied in two diIIerent but related ways. One is known as absolute error
and the other is called relative error.
Let us suppose that true value oI a data item is denoted by x
t
and its approximate value is
denoted by x
a
. Then, they are related as Iollows:
True value x
t
pproximate value x
a
Error
The error is then given by:
Error x
t
- x
a

The error may be negative or positive depending on the values oI x
t
and x
a
. In error analysis,
what is important is the magnitude oI the error and not the sign and, thereIore, we normally
consider what is known as absolute error which is denoted by
e
a
, x
t
x
a
,
In general absolute error is the numerical diIIerence between the true value oI a quantity and its
approximate value.
In many cases, absolute error may not reIlect its inIluence correctly as it does not take into
account the order oI magnitude oI the value. In view oI this, the concept oI relative error is
introduced which is nothing but the normalized absolute error. The relative error is deIined as
e
r



absolute error oI 2/3 0.001666666...
relative error oI 2/3 0.0024999 approx
. If , ], denote forward, backward and centraI difference operator, E and are
respectiveIy the shift and average operators, in the anaIysis of data with equaI spacing h,
show that
(1) 1 +
2

2
=

'
+

'

o
+
(2) E
1/2
=
'
+

'
o
+


()

'
+

'

o
+ o +
o
=



ns:
From the deIinition oI operators, we have


ThereIore
1
(1)
lso

(2)
From equation (1) and (2)
1 o
2

2

(2) ow




(3) We have



E 1
Thus we get



. Find a reaI root of the equation x

- x - 9 = 0 using the bisection method
ns -
First Let x0 be 1 and x1 be 3
F(x0) x3 4x -9
1 4 9
-12 0
F(x1) 27 12 9
6 ~ 0
ThereIore, the root lies between 1 and 3
ow we try with x2 2
F(x2) 8 8 9
-9 0
ThereIore, the root lies between 2 and 3
X3
(x1x2)/2
(32)/2
2.5
F(x3) 15.625 10 9
- 3.375 0
ThereIore, the root lies between 2.5 and 3
X4
(x1x3)/2
2.75




5. ind Newton`s difference interpolation polynomial for the following data:
x 0.1 0.2 0. 0. 0.5
f(x) 1.0 1.56 1.76 2.00 2.28
ns:
Forward diIIerence table

Here
p


We have ewton`s Iorward interpolation Iormula as
y
(1)
From the table substitute all the values in equation (1)
y 1.40 (10x 1) (0.16)
y 2x
2
x 1.28
6. EvaIuate

+
1
0
2
1
/
using TrapezoidaI ruIe with h = 0.2. Hence determine the vaIue of n.
ns:
,
which is known as the trape:oi/al rule.

1he Lrapezoldal rule uses Lrapezolds Lo approxlmaLe Lhe curve on a sublnLerval 1he area of a Lrapezold
ls Lhe wldLh Llmes Lhe average helghL glven by Lhe sum of Lhe funcLlon values aL Lhe endpolnLs dlvlded
by Lwo
1herefore

02( f(0) + 2f(02) + 2f(04) + 2f(06) + 2f(08) + f(1) ) / 2
02( 1 + 2*(096134) + 2(086207) + 2(073329) + 2(060976) + 03) / 2
078373

1he lnLegrand ls Lhe derlvaLlve of Lhe lnverse LangenL funcLlon ln parLlcular lf we lnLegraLe from 0 Lo 1
Lhe answer ls pl/4 ConsequenLly we can use Lhls lnLegral Lo approxlmaLe pl
MulLlplylng by four we geL an approxlmaLlon for pl
31349

You might also like