Dca2101 Computer
Dca2101 Computer
SET-I
1. Show that
(a) δμ= 1/2(∆+∇)
(b) ∆-∇=∆∇
Ans 1.
a) To show that δμ=1/2(∆+∇), we can start with the definition of the Laplacian (δ) and the
gradient (∇):
δf = ∇²f = ∇•∇f
Now, let's consider the Laplacian of a function μ:
δμ = ∇²μ = ∇•∇μ
Next, we can use the identity that relates the Laplacian and the gradient:
∇•(∇μ) = ∇²μ
Now, we can rewrite the Laplacian of μ using the gradient:
δμ = 1/2(∇•∇μ + ∇•∇μ)
From the definition of the vector dot product, we know that ∇•∇μ = ∇μ•∇μ, so:
δμ = 1/2(∇μ•∇μ + ∇μ•∇μ)
Simplifying this, we get:
δμ = 1/2(2∇μ•∇μ)
And finally:
δμ = ∇μ•∇μ
b) To show that ∆-∇=∆∇, we can start with the definition of the Laplacian (∆) and the
gradient (∇):
∆f = ∇•∇f
∇f = ∇f
Now, let's consider the expression ∆-∇:
∆-∇ = ∇•∇ - ∇
We can factor out ∇ from the first term:
∇•∇ - ∇ = ∇(∇•∇ - 1)
Now, using the definition of the Laplacian, we can replace ∇•∇ with ∆:
∇(∇•∇ - 1) = ∇∆
So, we have shown that ∆-∇=∆∇.
2. Find Lagrange’s interpolation polynomial fitting the pointsy(1) = -3,y(3)= 0,y(4)= 30,
y(6) = 132 Hence find y(5).
Ans 2.
Step 1: Find the Lagrange basis polynomials
For each point, we need to create a Lagrange basis polynomial that has a value of 1 at that point
and a value of 0 at all other points. We'll use these polynomials to build the final interpolation
polynomial.
For example, for the point (1, -3), the Lagrange basis polynomial is:
The interpolation polynomial is a sum of the Lagrange basis polynomials multiplied by the
corresponding y-values. In our case, we have:
where L2(x), L3(x), and L4(x) are the Lagrange basis polynomials for points (3, y(3)), (4, y(4)),
and (6, y(6)), respectively.
Now that we have the interpolation polynomial P(x), we can evaluate it at x = 5 to find y(5):
y(5) = P(5)
= L1(5)(-3) + L2(5)0 + L3(5)30 + L4(5)132
= (-8/16)(-3) + (0) + (10/16)(30) + (15/16)(132)
= (-24)/16 + (300)/16 + (1980)/16
= (-24 + 300 + 1980)/16
= 2156/16
= 135
10 20 30 40 50
46 66 81 93 101
Ans 3.
To evaluate f(15) given the table of values, we need to interpolate the value of y corresponding
to x = 15.
Looking at the table, we can observe that the values of x are evenly spaced by 10 units. To
interpolate, we can use linear interpolation.
- x = 10 corresponds to y = 46
- x = 20 corresponds to y = 66
where:
- x₁ = 10
- x₂ = 20
- y₁ = 46
- y₂ = 66
- x = 15
SET-II
4. Find the equation of the best fitting straight line for the data:
X 1 3 4 6 8 9 11 14
Y 1 2 4 4 5 7 8 9
Ans 4.
Linear Regression is a method to model the relationship between two continuous variables, X
and Y. In this case, we have a set of data points (X, Y) and we want to find the best straight line
that fits these data points.
To find the equation of the best fitting straight line, follow these steps:
1. Plot the data: Start by plotting the data points (X, Y) on a graph. You should see a scatter plot
with a collection of points.
2. Calculate the means: Calculate the mean (average) of X and Y. You can do this by adding up
all the values and dividing by the number of data points.
3. Calculate the deviations: Calculate the deviation of each X value from the mean μX. These
deviations are called "x-values".
x1 = 1 - 7 = -6
x2 = 3 - 7 = -4
x3 = 4 - 7 = -3
x4 = 6 - 7 = -1
x5 = 8 - 7 = 1
x6 = 9 - 7 = 2
x7 = 11 - 7 = 4
x8 = 14 - 7 = 7
4. Calculate the slope (m): Calculate the slope (m) of the line using the following formula:
Where:
Σy = 1+2+4+4+5+7+8+9
=40
Σ(x^2) = (-6)^2+(-4)^2+(-3)^2+(-1)^2+(1)^2+(2)^2+(4)^2+(7)^2
=36+16+9+1+1+4+16+49=133
5. Calculate the intercept (b): Finally, calculate the intercept (b) using the formula:
b = μY - m * μX
b=5-m*7
= 5 - approximately m * 7
= approximately b ≈ 5 - approximately m * 7
= approximately b ≈ 5 - approximately (32.00 * 7)
= approximately b ≈ -15
The Equation of the Best Fitting Straight Line:
Now that we have calculated the slope and intercept, we can write the equation of the best fitting
straight line as:
Y≈m*X+b
Y ≈ approximately m * X ≈ approximately b
Y ≈ approximately m * X ≈ approximately b ≈ approximately -15
Y ≈ approximately -15.0x^64.0
This equation represents the best fitting straight line that passes through your data points.
Ans 5.
To determine the values of λ and μ that result in each type of solution, we can use the properties
of systems of equations.
(i) For a unique solution:
The rank of the coefficient matrix should be equal to the rank of the augmented matrix.
The determinant of the coefficient matrix must be non-zero.
(ii) For an infinite number of solutions:
The rank of the coefficient matrix should be less than the rank of the augmented matrix.
The determinant of the coefficient matrix should be zero.
(iii) For no solution:
The rank of the coefficient matrix should be less than the rank of the augmented matrix.
The determinant of the coefficient matrix should not be zero.
Now let's apply these properties to our system of equations:
x + y + z = 6 (Equation 1)
x + 2y + 3z = 10 (Equation 2)
x + 2y + λz = μ (Equation 3)
To find the ranks, we need to form the coefficient and augmented matrices:
Coefficient matrix:
111
123
12λ
Augmented matrix:
111|6
1 2 3 | 10
12λ|μ
Now, let's find the determinant of the coefficient matrix using the formula for a 3x3 matrix:
Determinant = (1 * 2 * λ) + (1 * 3) + (1 * 2) - (λ * 2 * 1) - (1 * 3) - (1 * 2)
Determinant = 2λ + 3 + 2 - 2λ - 3 – 2
Determinant = λ - 3
To determine the type of solution, we need to consider the determinant and rank:
(i) Unique solution:
The determinant is non-zero, and the ranks of the coefficient and augmented matrices are equal.
(ii) Infinite number of solutions:
The determinant is zero, and the rank of the coefficient matrix is less than the rank of the
augmented matrix.
(iii) No solution:
The determinant is not zero, and the rank of the coefficient matrix is less than the rank of the
augmented matrix.
So, with the given information, we can't determine specific values for λ and μ that result in each
type of solution without additional information. However, we know the conditions required for
each type of solution.
6. Find the solution for x=0.2 taking interval length 0.1 using Euler’s method to solve:
dy/dx=1-y given y(0)=0.
Ans 6.
dy/dx = 1 - y
y(0) = 0
We want to find the solution y(x) at x = 0.2 using Euler's method with an interval length of 0.1.
Step 2: Initialize
x = 0, y = 0 (given)
dy/dx = 1 - y
dy/dx = 1 - 0 = 1
We'll use Euler's method to calculate the first estimate of y at x = 0.1. We'll take a small step of
size 0.1:
We'll repeat the process until we reach x = 0.2. We'll take smaller steps of size 0.1 and update
our estimate of y accordingly.
Conclusion
Using Euler's method with an interval length of 0.1, we found that the solution to the differential
equation dy/dx = 1 - y with initial condition y(0) = 0 at x = 0.2 is approximately y ≈ 0.289.