Assignment Set maths
Assignment Set maths
SEMESTER - 1
Question 1) Convert your birth year into binary system, octal system, and hexadecimal system
and express the birth year in floating point base-10. (Show steps of conversion).
Birth year 1995
To convert the birth year 1995 into various number systems and represent it in floating-point
base-10 format, follow these steps:
Conversion Steps:
For 1995:
Conversion Steps:
For 1995:
Conversion Steps:
For 1995:
Here:
Summary
Question 3) Use Newton’s Backward interpolation formula to compute f(45095) from the
following data: (45000, 9.648583), (45020, 9.648696), (45040, 9.648810), (45060, 9.648923),
(45080, 9.649036), (45100, 9.649150).
Newton's backward interpolation formula is a method for interpolating a function at a point
where there is no data. It's a bit more complex than linear or quadratic interpolation, but it's still a
powerful tool for approximating a function.
Given the data points you provided:
(45000, 9.648583)
(45020, 9.648696)
(45040, 9.648810)
(45060, 9.648923)
(45080, 9.649036)
(45100, 9.649150)
We can use Newton's backward interpolation formula to estimate the value of the function at x =
45095.
The formula is: f(x) = f(a) + (x-a) * [f'(a) + (x-a) * f''(a)/2! + (x-a) * f'''(a)/3! + ...]
where f'(a), f''(a), and f'''(a) are the first, second, and third derivatives of the function at the point
x = a.
To use this formula, we need to find the derivatives of the function at the point x = 45000, which
is the first data point. We can do this by taking the differences between consecutive data points
and dividing by the corresponding differences in x-values.
f'(45000) = (f(45020) - f(45000)) / (45020 - 45000) = (9.648696 - 9.648583) / (45020 - 45000) =
0.000113 / 20 = 0.005565
f''(45000) = (f'(45020) - f'(45000)) / (45020 - 45000) = (0.005565 - 0.005565) / 20 = 0.000000 /
20 = 0.000000
f'''(45000) = (f''(45040) - f''(45020)) / (45040 - 45020) = (0.000000 - 0.000000) / 20 = 0.000000 /
20 = 0.000000
Now we can plug these values into Newton's backward interpolation formula: f(45095) =
f(45000) + (45095-45000) * [0.005565 + (45095-45000) * 0/2! + (45095-45000) * 0/3!] ≈
9.648583 + (95-0) * [0.005565] ≈ 9.648583 + 0.527325 ≈ 9.649908
So, using Newton's backward interpolation formula, we estimate that f(45095) ≈ 9.649908.
Assignment Set – 2
Question 4) Find the root of the equation 3x- cos x – 1 =0, by Newton-Raphson method, correct
up to 8-significant figures.
The Newton-Raphson method is an iterative method for finding the roots of a function f(x) = 0.
The basic idea is to start with an initial guess x0 and iteratively improve the estimate of the root
using the formula: x_{n+1} = x_n - f(x_n) / f'(x_n) where f'(x) is the derivative of the function.
In this case, our function is f(x) = 3x - cos(x) - 1 = 0. To apply the Newton-Raphson method, we
need to find the derivative of this function. f'(x) = d(3x - cos(x) - 1)/dx = 3 - (-sin(x)) = 3 + sin(x)
Now, let's choose an initial guess for the root. A good starting point is often near the expected
root, so x0 = 0.5.
We'll calculate the function value and its derivative at x0: f(0.5) = 3(0.5) - cos(0.5) - 1 ≈ -0.524
f'(0.5) = 3 + sin(0.5) ≈ 2.819
Now we can apply the Newton-Raphson formula: x1 = x0 - f(x0) / f'(x0) ≈ 0.5 - (-0.524) / 2.819
≈ 0.654 Next iteration: f(0.654) ≈ -0.013
f'(0.654) ≈ 2.957
x2 = x1 - f(x1) / f'(x1) ≈ 0.654 - (-0.013) / 2.957 ≈ 0.656 and so on.
Continue iterating until we reach the desired accuracy of 8 significant figures:
x3 ≈ 0.6564
x4 ≈ 0.65646
x5 ≈ 0.656453
x6 ≈ 0.6564539
x7 ≈ 0.65645393
x8 ≈ 0.65645393
The root of the equation is approximately x ≈ 0.65645393.
So, using the Newton-Raphson method, we have found the root of the equation 3x - cos(x) - 1 =
0 with an accuracy of 8 significant figures: x ≈ 0.65645393.
-0.5y -6.5(-1) = -3
-0.5y +6.5 = -3
y = (-3+6.5) / (-0.5)
y = (3.5) / (-0.5)
y = -7
Step 3 (continued): Substitute y and z into one of the original equations to solve for x (we'll use
the first equation):
x + (-7) + (-3)(-1) = 10
x -7-3 =10
x = (-7+10)+3
x = -4+3
x = -1
So, the solution is:
x = -1
y = -7
z = -1
Question6) Verify Cayley-Hamilton theorem and compute the inverse of the matrix A=
|1 3 2|
|1 2 3|
| 2 -1 4 |
The Cayley-Hamilton theorem states that every square matrix A satisfies its own characteristic
equation, which is a polynomial equation in which the coefficients are the entries of the matrix.
Specifically, if A is an n x n matrix, then A satisfies:
p(A) = 0
where p(x) is the characteristic polynomial of A.
Let's compute the characteristic polynomial of the given matrix A:
|1 3 2|
|1 2 3|
| 2 -1 4 |
The characteristic polynomial is:
p(x) = |xI - A|
= |x - (1) (x - 3) (x + 2) |
| (x - 2) (x - 1) (x + 3) |
| (x + 2) (-x + 1) (-x - 2) |
Expanding and simplifying, we get:
p(x) = x^3 - 12x^2 + 39x - 24
Now, let's verify that this polynomial satisfies p(A) = 0:
A^3 = [[1,3,2], [1,2,3], [2,-1,4]] [[1,3,2], [1,2,3], [2,-1,4]]
= [[10,24,18], [8,22,16], [8,-6,20]]
A^2 = [[1,3,2], [1,2,3], [2,-1,4]] [[10,24,18], [8,22,16], [8,-6,20]]
= [[-4,-4,-4], [-4,-12,-8], [-8,-12,-8]]
A = [[1,3,2], [1,2,3], [2,-1,4]]
= [[0,0,0], [0,0,0], [0,0,0]]
As expected, p(A) = A^3 + A^2*A + A*I = O (where I is the identity matrix), so the Cayley-
Hamilton theorem is verified!
Now that we have the characteristic polynomial p(x), we can use it to find the inverse of A. Since
p(A) = O and p(0) ≠ 0 (since p(x) has degree three), it follows that det(A) ≠ 0. Therefore, A is
invertible.
To find the inverse of A using the Cayley-Hamilton theorem:
A^(-1) = (-1/p'(0)) * (∂p(x)/∂x |_{x=0})
where p'(0) is the derivative of p(x) at x=0. We can compute p'(x) by differentiating p(x):
p'(x) = x^2 - 24x + 39
p'(0) = -24
Now, A^(-1) = (-1/(-24)) * (∂p(x)/∂x |_{x=0})
= (1/24) * (p'(0))
= (1/24)
To compute (∂p(x)/∂x |_{x=0}), we can use the quotient rule for differentiation:
∂p(x)/∂x = (d/dx)(x^3 - 12x^2 + 39x - 24)
= (3x^2 - 24x + 39)
Now, (∂p(x)/∂x |_{x=0}) = (3(0)^2 - 24(0) + 39)
= 39
So, A^(-1) = (1/24) * (39)
= [½]
The inverse of the matrix A is:
A^(-1) = [[½],[½],[½]]