0% found this document useful (0 votes)
7 views

Computer Oriented Numerical Methods Assignment 2101

This document contains an internal assignment for Harshita Rani, a BCA student, focusing on Computer Oriented Numerical Methods. It includes various mathematical problems and solutions, such as Lagrange's interpolation polynomial, Newton's forward difference interpolation, and the best fitting straight line for a set of data points. Additionally, it discusses the conditions for unique, infinite, and no solutions in a system of equations, as well as applying Euler's method for solving a differential equation.

Uploaded by

shivangsaklani1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Computer Oriented Numerical Methods Assignment 2101

This document contains an internal assignment for Harshita Rani, a BCA student, focusing on Computer Oriented Numerical Methods. It includes various mathematical problems and solutions, such as Lagrange's interpolation polynomial, Newton's forward difference interpolation, and the best fitting straight line for a set of data points. Additionally, it discusses the conditions for unique, infinite, and no solutions in a system of equations, as well as applying Euler's method for solving a differential equation.

Uploaded by

shivangsaklani1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Directorate Of Online Education

INTERNAL ASSIGNMENT

NAME HARSHITA RANI

ROLL NUMBER 2314503249

SESSION MARCH 2024

PROGRAM BCA

SEMESTER III

COURSE NAME COMPUTER ORIENTED


NUMERICAL METHODS

COURSE CODE DCA2101


SET-I
Q1. Show that
𝟏
(a) 𝜹𝝁 = (∆ + 𝛁)
𝟐
1 1 1 1
1 1
Solu: δμ = (E 2 − E −2 ) ∗ 2 (E 2 + E −2 ) = 2 [E − E −1 ] [A]
1 1 1
(∆ + ∇) = [(𝐸 − 1) + (1 − 𝐸 −1 )] = [𝐸 − 𝐸 −1 ] [B]
2 2 2
1
Hence from equations A and B, we get, 𝜇𝛿 = 2 (∆ + ∇)

(b) ∆ − 𝛁 = ∆𝛁
Solu: ∆ − ∇ = (𝐸 − 1) − (1 − 𝐸 −1 )
= 𝐸 − 2 + 𝐸 −1 [A]
∆∇ = (𝐸 − 1)(1 − 𝐸 −1 )
= 𝐸 − 1 − 𝐸𝐸 −1 + 𝐸 −1
= 𝐸 + 𝐸 −1 − 2 [B]
From equations A and B, we get ∆ − ∇ = ∆∇

Q2. Find Lagrange’s interpolation polynomial fitting the points y(1) = -3, y(3) = 0, y(4)
= 30, y(6) = 132 Hence find y(5).
Solu: The given data can be arranged as follows:

x 1 3 4 6
y = f(x) -3 0 30 132

Using Lagrange’s interpolation formula, we have


y = f(x)
(𝑥−3)(𝑥−4)(𝑥−6) (𝑥−1)(𝑥−4)(𝑥−6) (𝑥−1)(𝑥−3)(𝑥−6)
= (−3) + (0) + (30) +
(1−3)(1−4)(1−6) (3−1)(3−4)(3−6) (4−1)(4−3)(4−6)
(𝑥−1)(𝑥−3)(𝑥−4)
(6−1)(6−3)(6−4)
(132)

𝑥 3 −13𝑥 2 +54𝑥−72 𝑥 3 − 11𝑥 2 +34𝑥−24 𝑥 3 − 10𝑥 2 +27𝑥−18


= (−3) + (0) + (30) +
−30 6 −6
𝑥 3 − 8𝑥 2 +19𝑥−12
(132)
30
1 22
= 10 (𝑥 3 − 13𝑥 2 + 54𝑥 − 72) + 0 − 5(𝑥 3 − 10𝑥 2 + 27𝑥 − 18) + (𝑥 3 − 8𝑥 2 +
5
19𝑥 − 12)
1 13 54 72 22 176
= (10 𝑥 3 − 10 𝑥 2 + 10 𝑥 − 10) − (−5𝑥 3 + 50𝑥 2 − 135𝑥 + 90) + ( 5 𝑥 3 − 𝑥2 +
5
418 264
𝑥− )
5 5
1 13 27 36 22 176
= (10 𝑥 3 − 10 𝑥 2 + 𝑥− ) − (−5𝑥 3 + 50𝑥 2 − 135𝑥 + 90) + ( 5 𝑥 3 − 𝑥2 +
5 5 5
418 264
𝑥− )
5 5
1
y(x) = 2 (−𝑥 3 + 27𝑥 2 − 92𝑥 + 60)
1
Now, 𝑦(5) = 2 (−53 − 27 ∗ 52 − 52 ∗ 5 + 60)
1
= 2 (−125 − 27 ∗ 25 − 52 ∗ 5 + 60)
1
= 2 (−125 − 675 − 460 + 60)
1
= 2 (150)

= 75

Q3. Evaluate 𝒇(𝟏𝟓), given the following table of values:


𝒙 10 20 30 40 50
𝒚 = 𝒇(𝒙) 46 66 81 93 101
Solu: The value 𝑥 = 15 is near the beginning of the table. We use Newton’s forward
difference interpolation formula.
𝒙 𝒚 ∆𝒚 ∆𝟐 𝒚 ∆𝟑 𝒚 ∆𝟒 𝒚
10 46
20 66 20
30 81 15 -5
40 93 12 -3 2
50 101 8 -4 -1 -3

Using Newton's forward difference formula


𝑝(𝑝−1) 𝑝(𝑝−1)(𝑝−2) 𝑝(𝑝−1)(𝑝−2)(𝑝−4)
𝑦(𝑥) = 𝑦0 + 𝑝∆𝑦0 + ∆2 𝑦0 + ∆3 𝑦0 + ∆4 𝑦0 𝑤ℎ𝑒𝑟𝑒 𝑥 =
2! 3! 4!
𝑥0 + 𝑝ℎ
Here ℎ = 10, 𝑥0 = 10, 𝑦0 = 46, ∆𝑦0 = 20, ∆2 𝑦0 = −5, ∆3 𝑦0 = 2, ∆4 𝑦0 = −3
𝑥−𝑥0 15−10
Therefore, 𝑝 = = = 0.5
ℎ 10
(0.5)(0.5−1) (0.5)(0.5−1)(0.5−2)
Therefore, 𝑓(15) = 46 + (0.5)(20) + 2
(−5) +
6
(2) +
(0.5)(0.5−1)(0.5−2)(0.5−3)
(−3)
24
(0.5)(−0.5) (0.5)(−0.5)(−1.5) (0.5)(−0.5)(−1.5)(−2.5)
= 46 + 10 + (−5) + (2) + (−3)
2 6 24
0.25 0.375 0.9375
= 46 + 10 + (−5) + (2) + (−3)
2 6 24

= 46 + 10 − 0.125(−5) + 0.0625(2) − 0.0390625(−3)


= 46 + 10 + 0.625 + 0.125 + 0.1171875
= 56.8672
SET-II

Q4. 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
Solu: Let Y = a + bX be the required best-fit straight line.
Its normal equations are given by
𝑌 = 𝑛𝑎 + 𝑏𝑋
𝑋𝑌 = 𝑎𝑋 + 𝑏𝑥 2
There are 8 tabulated data, therefore n = 8
X Y XY 𝑿𝟐
1 1 1 1
3 2 6 9
4 4 16 16
6 4 24 36
8 5 40 64
9 7 63 81
11 8 88 121
14 9 126 196
𝑿 = 𝟓𝟔 𝒀 = 𝟒𝟎 𝑿𝒀 = 𝟑𝟔𝟒 𝑿𝟐 = 𝟓𝟐𝟒
The normal equations become
40 = 8𝑎 + 56𝑏 (1)
364 = 56𝑎 + 524𝑏 (2)
(2)– (1) ∗ 7 , we get
132𝑏 = 84
𝑏 = 0.64
Substituting the value of b in (1) we get 𝑎 = 0.52
The equation 𝑌 = 𝑎 + 𝑏𝑋 becomes
𝑌 = 0.52 + 0.64𝑋
Q5. For what value of  &  the following system of equations:
𝒙+𝒚+𝒛=𝟔
𝒙 + 𝟐𝒚 + 𝟑𝒛 = 𝟏𝟎
𝒙 + 𝟐𝒚 + 𝒛 =  may have
(i) Unique solution
(ii) Infinite number of solutions
(iii) No solution
Solu: Analysing the system’s consistency and properties of the coefficient matrix
Given,
𝑥+𝑦+𝑧 =6
𝑥 + 2𝑦 + 3𝑧 = 10
𝑥 + 2𝑦 + 𝑧 = 
The coefficient matrix is:
1 1 1
A= [1 2 3]
1 2 
The augmented matrix is:
1 1 1 6
[A|B] = [1 2 3 10]
1 2  

(i) Unique Solution: The system will have a unique solution when the determinant of A is
non-zero
1 1 1
𝐷𝑒𝑡(𝐴) = |1 2 3|
1 2 
Expanding along the first row:
2 3 1 3 1 2
𝐷𝑒𝑡(𝐴) = 1. | | − 1. | | + 1. | |
2  1  1 2
Computing each minor:
2 3
| | = (2.  − 2.3) = 2  − 6
2 
1 3
| | = (1.  − 1.3) =  − 3
1 
1 2
| | = (1.2 − 1.2) = 0
1 2
So,
𝐷𝑒𝑡(𝐴) = 1. (2  − 6) − 1. (  − 3) + 1.0
𝐷𝑒𝑡(𝐴) = 2  − 6 −  + 3 =  − 3
Hence, for a unique solution, 𝐷𝑒𝑡(𝐴) ≠ 0, 𝑖. 𝑒.,  ≠ 3
(ii) Infinite Solutions: 𝐷𝑒𝑡(𝐴) = 0, 𝑖. 𝑒.,  = 3, and the system must be consistent.
Substituting  = 3 into the third equation: 𝑥 + 2𝑦 + 3𝑧 = 𝜇
The system becomes:
1. 𝑥 + 𝑦 + 𝑧 = 6
2. 𝑥 + 2𝑦 + 3𝑧 = 10
3. 𝑥 + 2𝑦 + 3𝑧 = 𝜇
For consistency, the third equation must not contradict the second. Hence, 𝜇 = 10
Hence, for infinite solutions,  = 3 and 𝜇 = 10

(iii) No solution: 𝐷𝑒𝑡(𝐴) = 0, 𝑖. 𝑒. ,  = 3, but the system is inconsistent.


Substituting  = 3, and if 𝜇 ≠ 10, the third equation contradicts the second. Thus, there is no
solution.
Hence, for no solution,  = 3 and 𝜇 ≠ 10

Q6. Find the solution for 𝒙 = 𝟎. 𝟐 taking interval length 0.1 using Euler’s method to
𝒅𝒚
solve: 𝒅𝒙 = 𝟏 − 𝒚 given 𝒚(𝟎) = 𝟎.
𝑑𝑦
Solu. The given differential equation is 𝑑𝑥 = 1 − 𝑦
Therefore 𝑓(𝑥, 𝑦) = 1 − 𝑦
Also, we have 𝑥0 = 0, 𝑦0 = 0, ℎ = 0.1
𝑥1 = 𝑥0 + ℎ = 0 + 0.1 = 0.1
Putting 𝑖 = 0 in Euler’s formula 𝑦𝑖+1 = 𝑦𝑖 + ℎ𝑓(𝑥𝑖 , 𝑦𝑖 )
We get
𝑦(𝑥1 ) = 𝑦1 = ℎ 𝑓 (𝑥0 , 𝑦0 )
𝑦(𝑥1 ) = 𝑦1 = 𝑦0 + ℎ(1 − 𝑦0 )
= 0 + 0.1(1 − 0) = 0.10
Therefore 𝑦(0.1) = 𝑦1 = 0.10
Put 𝑖 = 1 in equation (1), we get
𝑥2 = 𝑥1 + ℎ = 0.1 + 0.1 = 0.2
𝑦2 = 𝑦(𝑥2 ) = 𝑦1 + ℎ𝑓(𝑥1 , 𝑦1 ) = 𝑦1 + ℎ(1 − 𝑦1 ) = 0.1 + 0.1(1 − 0.1)
= 0.19
Hence 𝑦(0.1) = 0.10 and 𝑦(0.2) = 0.19

You might also like