Sie sind auf Seite 1von 14

August 2011 Master of Computer Application (MCA) Semester 3 MC0074 Statistical and Numerical methods using C++

(Book ID: B0812) Assignment Set 1 Set 2

Submitted by Ravish R Roll No.511122302 Course- MCA Centre Code- 2759

Assignment Set 1

1. A box contains 74 brass washers, 86 steel washers and 40 aluminum washers, Three washers are drawn at random from the box without replacement. Determine the probability that all three are steel washers. Total number of washers in the box=74+86+40=200 The number of elements in the sample space S=n(S)=the number of ways in which three washers are drawn together at random out of the these 200 washers 200 C3=200x199x198/3x2x1 Let E be the event of drawing one brass, one steel, one aluminum washer, then the number of element in E=n(E)=the number of ways in which 3 steel washer can be drawn out of 86 steel washers =86x85x84/3x2x1 The required probability= P(E)=n(E)/n(S)=86x85x84/200x199x198=0.07792

2. Discuss and define the Correlation coefficient with the suitable example.

Correlation is one of 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 of change in one variable corresponds to greater the magnitude of 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 of one-dimensional random variable. If we have a two-dimensional random variable (X,Y), an analogous problem is encountered. Definition Let (X, Y) be a two-dimensional random variable. We define between X and Y, as follows:
xy,

the correlation coefficient,

xy

The numerator of , is called the covariance of X and Y. Example Suppose that the two-dimensional random variable (X, Y) is uniformly distributed over the triangular region

R = {(x, y) | 0 < x < y < 1} The pdf is given as f(x, y) = 2, (x, y) R, = 0, elsewhere. Thus the marginal pdfs of X and of Y are

g(x) = 2 (1 x), 0 x 1

h(y) = = 2y, 0 y 1

Therefore

E(X) =

, E(Y) =

E(X2) =

, E(Y2) =

V(X) = E(X2) (E(X))2 =

V(Y) = E(Y2) (E(Y))2 =

E(XY) = Hence

xy

3. If x is normally distributed with zero mean and unit variance, find the expectation and variance of W 2 .

The equation of the normal curve is

If mean is zero and variance is unit, then putting m=0 and

,the above equation reduced to

Expectation of x2 i.e.

(i)

Integrating

by

parts

taking

as

first

function

and

remembering

that

Putting

Hence

=1

(ii)

Integrating by parts taking x3 as first function

=3

=3(1)

with the help of (ii)

Variance of x2 = = 3-(1)2 =2

4. The sales in a particular department store for the last five years is given in the following table Years Sales (in lakhs) Estimate the sales for the year 1979. Newtons backward difference table is 1974 40 1976 43 1978 48 1980 52 1982 57

We have

p= yn = 5, 2yn = 1, 3yn = 2, 4yn = 5 Newtons interpolati0on formula gives y1979 = 57 + (-1.5) 5 + = 57 7.5 + 0.375 + 0.125 + 0.1172 y1979 = 50.1172

5. Find out the geometric mean of the following series Class 0-10 10-20 20-30 Frequency 17 10 11

30-40 15

40-50 8

Here we have Class 0-10 10-20 20-30 30-40 40-50 Frequency(f) 17 10 11 15 8 N=61 Mid value(x) 5 15 25 35 45 Log x .6990 1.1761 1.3979 1.5441 1.6532 f.(Logx) 11.883 11.761 15.3769 23.1615 13.2256 Sum=75.408

If 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 line of x on y from the following data x y 0 10 1 12 2 27 3 10 4 30

sum(X) = 0+1+2+3+4 = 10 sum(X) = 0+1+2+3+4 = 30 sum(Y) = 10+12+27+10+30 = 89 sum(Y) = 10+12+27+10+30 = 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 Therefore the equation of the regressed line is y = (-16.711)x + 51.222

Assignment Set 2
1. Briefly explain the concept of Bernoullis process Consider a sequence of independent Bernoulli trials and let the discrete random variable Yi denote the result of the ith trial, so that the event [Yi =1] denotes a success on the ith trial and the event[Yi = 0] denotes a failure on the ith trial. Further assume that the probability of success on the ith trial, P[Yi = 1], is p, which is independent of the index i. then {Yi|i=1,2n} is a discrete state, discrete parameter, stochastic process, which is stationary in the strict sence. Since the Yis are mutually independent, the above process is an independent process known as the Bernoulli process. Since Yi is a Bernoulli random variable, we recall that E[Yi] = p E[Yi2] = p Var[Yi] = p(1-p) and GYi(z) = (1-p)+pz based on the Bernoulli process, we may form another stochastic process by considering the sequence of partial sums{Sn|n=1,2}, where Sn=Y1+Y2++Yn. by rewriting Sn=Sn1+Yn, it is not difficult to see that {Sn} is a discrete state, discrete parameter Markov process, since P(Sn =k|Sn-1 = K) = P(Yn=0) 1-p And P(Sn=K|Sn-1 = K-1) = P(Yn =1) =p Clearly P(Sn=K) = (n) pk(1-p)n-k = (k) E[Sn]=np Var[Sn]=np(1-p) and GSn(z) = (1-p+pz)n Define the discrete random variable T1, called the first order interarrival time, to be the number of trials up to and including the first success. T1 is geometrically distributed so that P(Ti=i) = p(1-p)i-1, i=1,2 E(T1)=1/p Var(T1) = 1-p/p2 and [GT1(z) = zp/1-z(1-p)] Similarly [GTr(z) =[ zp/1-z(1-p)]r]

2. If is approximated by 0.667, find the absolute and relative errors? 32 An error is usually quantified in two different but related ways. One is known as absolute error and the other is called relative error. Let us suppose that true value of a data item is denoted by xt and its approximate value is denoted by xa. Then, they are related as follows: True value xt = Approximate value xa + Error The error is then given by: Error = xt - xa The error may be negative or positive depending on the values of xt and xa. In error analysis, what is important is the magnitude of the error and not the sign and, therefore, we normally consider what is known as absolute error which is denoted by ea = | xt xa | In general absolute error is the numerical difference between the true value of a quantity and its approximate value. In many cases, absolute error may not reflect its influence correctly as it does not take into account the order of magnitude of the value. In view of this, the concept of relative error is introduced which is nothing but the normalized absolute error. The relative error is defined as er = = absolute error of 2/3= 0.001666666... relative error of 2/3 = 0.0024999 approx 3. If ( , , denote forward, backward and central difference operator, E and are respectively the shift and average operators, in the analysis of data with equal spacing h, show that (1) 1 +
2 2

H2 = 1  2

H (2) E1/2 = Q  2 H2 H2  H 1 4 2

(3) ( !

From the definition of operators, we have

= Therefore

1+

= Also

(1)

= From equation (1) and (2)

(2)

1+ (2)

Now

(3)

We have

= =E1 Thus we get

=
4. Find a real root of the equation x3 4x 9 = 0 using the bisection method 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 Therefore, the root lies between 1 and 3 Now we try with x2 =2 F(x2) = 8 8 9 = -9 < 0 Therefore, the root lies between 2 and 3 X3 = (x1+x2)/2 =(3+2)/2 = 2.5 F(x3) = 15.625 10 9 = - 3.375 < 0 Therefore, the root lies between 2.5 and 3 X4 = (x1+x3)/2 = 2.75

5. Find Newtons difference interpolation polynomial for the following data: x f(x) 0.1 1.40 0.2 1.56 0.3 1.76 0.4 2.00 0.5 2.28

Forward difference table

Here

p=

We have Newtons forward interpolation formula as

y=

(1) From the table substitute all the values in equation (1)

y = 1.40 + (10x 1) (0.16) + y = 2x2 + x + 1.28 This is the required Newtons interpolating polynomial.

6. Evaluate

1  x2
0

dx

using Trapezoidal rule with h = 0.2. Hence determine the value of .

,
which is known as the trapezoidal rule. The trapezoidal rule uses trapezoids to approximate the curve on a subinterval. The area of a trapezoid is the width times the average height, given by the sum of the function values at the endpoints, divided by two. Therefore: 0.2( f(0) + 2f(0.2) + 2f(0.4) + 2f(0.6) + 2f(0.8) + f(1) ) / 2 = 0.2( 1 + 2*(0.96154) + 2(0.86207) + 2(0.73529) + 2(0.60976) + 0.5) / 2 = 0.78373 The integrand is the derivative of the inverse tangent function. In particular, if we integrate from 0 to 1, the answer is pi/4 . Consequently we can use this integral to approximate pi. Multiplying by four, we get an approximation for pi: 3.1349

Das könnte Ihnen auch gefallen