Computer Oriented Numerical Methods with Python (S2320C1) · Continuous Evaluation Test 1 · 22 August 2025 · 30 marks · 10:30 am – 12:00 pm ITM (SLS) Baroda University · B.Tech all branches, odd semester 2025-26 · Semester 3. Non-programmable calculator allowed. Questions transcribed from the original paper. Solutions are written by CampusLoop and every number was checked by computer; check the method against your class notes.
Q1 (A). Select the correct option [3]
1. The convergence of which of the following methods is prone to the starting value? (a) Regula-Falsi · (b) Newton-Raphson · (c) Bisection · (d) all Answer: (b) Newton-Raphson. Bisection and Regula-Falsi always converge once a sign-change interval is chosen; Newton-Raphson may diverge from a poor x₀ or where f′(x) ≈ 0.
2. If a number is correct to n significant digits, then the relative error is: (a) ½·10ⁿ · (b) ½·10ⁿ⁻¹ · (c) ≤ ½·10⁻ⁿ · (d) < ½·10⁻ⁿ⁺¹ Answer: (d) relative error < ½ × 10⁻ⁿ⁺¹ (i.e. 1/(2·10ⁿ⁻¹)).
3. In the successive approximation method, for rapid convergence the value of φ′(x) should be: (a) larger than 1 · (b) smaller than 1 · (c) zero · (d) can have any value Answer: (b) |φ′(x)| < 1 is required for convergence, and the smaller it is, the faster the convergence.
Q1 (B). Do as directed [3]
1. If the permissible error is ε, the approximate number of iterations n needed for the bisection method? After n halvings the interval length is (b − a)/2ⁿ. We need (b − a)/2ⁿ ≤ ε, so n ≥ [log(b − a) − log ε] / log 2.
2. Rate of convergence of (a) Newton-Raphson (b) Secant method. (a) Newton-Raphson: quadratic (order 2). (b) Secant: superlinear, order ≈ 1.618 (the golden ratio).
3. Which method is also known as the method of tangents? State its iterative formula. Newton-Raphson method: xₙ₊₁ = xₙ − f(xₙ)/f′(xₙ), n = 0, 1, 2, …
Q2. Attempt any three [9]
Q2(a) Derive the iterative formula for the Newton-Raphson method.
Let x₀ be an approximation to a root of f(x) = 0 and let x₁ = x₀ + h be the exact root, so f(x₀ + h) = 0. Expand by Taylor's series:
f(x₀ + h) = f(x₀) + h f′(x₀) + (h²/2!) f″(x₀) + … = 0
Since h is small, neglect h² and higher powers: f(x₀) + h f′(x₀) = 0, so h = −f(x₀)/f′(x₀) (f′(x₀) ≠ 0).
Hence x₁ = x₀ − f(x₀)/f′(x₀), and in general
xₙ₊₁ = xₙ − f(xₙ)/f′(xₙ), n = 0, 1, 2, …
Geometrically, xₙ₊₁ is where the tangent to y = f(x) at (xₙ, f(xₙ)) cuts the x-axis, hence "method of tangents".
Q2(b) List the rules for estimating errors.
- Absolute error: Eₐ = |X − X₁| (true value X, approximate value X₁).
- Relative error: Eᵣ = |X − X₁| / |X|; percentage error Eₚ = 100 · Eᵣ.
- If a number is rounded to n decimal places, the absolute error ≤ ½ × 10⁻ⁿ.
- If a number is correct to n significant digits, the relative error < ½ × 10⁻ⁿ⁺¹.
- Addition/subtraction: the absolute error of a sum or difference ≤ the sum of the absolute errors: δ(X ± Y) ≤ δX + δY.
- Multiplication/division: the relative error of a product or quotient ≤ the sum of the relative errors: δ(XY)/(XY) ≤ δX/X + δY/Y.
- General formula: for u = f(x₁, …, xₙ), δu ≈ Σ |∂f/∂xᵢ| δxᵢ; for u = xᵐ, δu/u = m·δx/x.
Q2(c) Find a real root of x³ − x − 1 = 0 correct to three decimal places by successive approximations.
f(1) = −1 < 0 and f(2) = 5 > 0, so a root lies in (1, 2). Write x = φ(x) = (1 + x)^(1/3). φ′(x) = (1/3)(1 + x)^(−2/3) < 1 on (1, 2), so the iteration converges. Take x₀ = 1.5:
| n | xₙ | xₙ₊₁ = (1 + xₙ)^(1/3) |
|---|---|---|
| 0 | 1.50000 | 1.35721 |
| 1 | 1.35721 | 1.33086 |
| 2 | 1.33086 | 1.32588 |
| 3 | 1.32588 | 1.32494 |
| 4 | 1.32494 | 1.32476 |
The last two values agree to three decimals: x ≈ 1.325 (exact root 1.32472).
Q2(d) Percentage error (i) 625.483 approximated to three significant figures (ii) 75462 rounded off to four significant digits.
(i) 625.483 → 625. Error = 0.483. Percentage error = 0.483/625.483 × 100 = 0.0772 %. (ii) 75462 → 75460. Error = 2. Percentage error = 2/75462 × 100 = 0.00265 %.
Q3. Attempt any three [15]
Q3(a) Find the fourth root of 32 correct to four significant digits by the secant method.
Solve f(x) = x⁴ − 32 = 0; f(2) = −16, f(3) = 49. Take x₀ = 2, x₁ = 3 and xₙ₊₁ = xₙ − f(xₙ)(xₙ − xₙ₋₁)/(f(xₙ) − f(xₙ₋₁)):
| n | xₙ₋₁ | xₙ | xₙ₊₁ | f(xₙ₊₁) |
|---|---|---|---|---|
| 1 | 2.00000 | 3.00000 | 2.24615 | −6.54589 |
| 2 | 3.00000 | 2.24615 | 2.33499 | −2.27365 |
| 3 | 2.24615 | 2.33499 | 2.38227 | +0.20806 |
| 4 | 2.33499 | 2.38227 | 2.37831 | −0.00576 |
| 5 | 2.38227 | 2.37831 | 2.37841 | −0.00001 |
⁴√32 ≈ 2.378 (to four significant digits; exact 2.37841).
Q3(b) Using the false position method, find a positive root of 4e⁻ˣ sin x − 1 = 0 correct to three decimal places.
f(0) = −1, f(0.5) = 4e⁻⁰·⁵ sin 0.5 − 1 = 0.16253 > 0, so the smallest positive root lies in (0, 0.5). Formula x = [a f(b) − b f(a)]/[f(b) − f(a)]:
| n | a | b | x | f(x) |
|---|---|---|---|---|
| 1 | 0.00000 | 0.50000 | 0.42987 | +0.08455 |
| 2 | 0.00000 | 0.42987 | 0.39636 | +0.03892 |
| 3 | 0.00000 | 0.39636 | 0.38151 | +0.01693 |
| 4 | 0.00000 | 0.38151 | 0.37516 | +0.00719 |
| 5 | 0.00000 | 0.37516 | 0.37248 | +0.00302 |
| 6 | 0.00000 | 0.37248 | 0.37136 | +0.00126 |
| 7 | 0.00000 | 0.37136 | 0.37089 | +0.00053 |
Successive values now agree to three decimals: x ≈ 0.371 (exact 0.37056). (The equation has another positive root near 1.365 in (1, 1.5); either is accepted if worked correctly.)
Q3(c) Obtain a positive root of x³ − x = 11 by the bisection method correct to four significant digits.
f(x) = x³ − x − 11; f(2) = −5, f(3) = 13, so the root is in (2, 3).
| n | a | b | m | f(m) |
|---|---|---|---|---|
| 1 | 2.00000 | 3.00000 | 2.50000 | +2.12500 |
| 2 | 2.00000 | 2.50000 | 2.25000 | −1.85938 |
| 3 | 2.25000 | 2.50000 | 2.37500 | +0.02148 |
| 4 | 2.25000 | 2.37500 | 2.31250 | −0.94604 |
| 5 | 2.31250 | 2.37500 | 2.34375 | −0.46915 |
| 6 | 2.34375 | 2.37500 | 2.35938 | −0.22556 |
| 7 | 2.35938 | 2.37500 | 2.36719 | −0.10247 |
| 8 | 2.36719 | 2.37500 | 2.37109 | −0.04060 |
| 9 | 2.37109 | 2.37500 | 2.37305 | −0.00959 |
| 10 | 2.37305 | 2.37500 | 2.37402 | +0.00594 |
| 11 | 2.37305 | 2.37402 | 2.37354 | −0.00182 |
| 12 | 2.37354 | 2.37402 | 2.37378 | +0.00206 |
| 13 | 2.37354 | 2.37378 | 2.37366 | +0.00012 |
| 14 | 2.37354 | 2.37366 | 2.37360 | −0.00085 |
The interval is now (2.3736, 2.3737): x ≈ 2.374 to four significant digits (exact 2.37363).
Q3(d) Find a real root of x log₁₀ x = 1.2 to a tolerance of 0.01 % using Newton-Raphson.
f(x) = x log₁₀ x − 1.2; f′(x) = log₁₀ x + log₁₀ e = log₁₀ x + 0.434294. f(2) = −0.598, f(3) = 0.231, so the root is in (2, 3); take x₀ = 2.5.
| n | xₙ | f(xₙ) | f′(xₙ) | xₙ₊₁ | relative change |
|---|---|---|---|---|---|
| 0 | 2.500000 | −0.205150 | 0.832234 | 2.746505 | 8.975 % |
| 1 | 2.746505 | +0.005113 | 0.873075 | 2.740649 | 0.214 % |
| 2 | 2.740649 | +0.000003 | 0.872148 | 2.740646 | 0.0001 % |
The relative change is now below 0.01 %: x ≈ 2.7406.