2077

CSC212 · TU past paper

Numerical Method 2077 question paper

The complete TU 2077 exam paper for Numerical Method (CSC212), all 12 questions with solved model answers written to the mark scheme.

Tap a question to open its answer.

  1. 110 marksNumericalNewton's method and ConvergenceAnswer

    Derive the formula for Newton Raphson Method. Solve the equation using Newton Raphson method. Assume error precision is 0.01. Discuss drawbacks of the Newton Raphson method. $x^2 + 4x - 9 = 0$ [10]

    • Equation: $f(x) = x^2 + 4x - 9 = 0$ - Error precision: $E = 0.01$ - Initial guess: not specified in the problem, so I take $x0 = 4$ The exact positive root is $x = -2 + \sqrt{13} = 1.60555...$ --- Expand $f(x)$ by Taylor series about
  2. 210 marksRegression vs InterpolationAnswer

    How interpolation differs from regression? Write down algorithm and program for Lagrange interpolation.[10]

    Basis Interpolation Regression --------- Definition Estimating the value of a function at a point within the range of known data points Finding the best-fit curve that approximates the relationship between variables Data Fit The curve pa...

  3. 310 marksNumericalpivotingAnswer

    Why partial pivoting is used with Naive Gauss Elimination method? Solve the following system of equations using Gauss Elimination method with partial pivoting? How Gauss Jordan method differs from Gauss elimination method? $2x + 2y - z = 6$, $4x + 2y + 3z = 4$, $x + y + z = 0$ [10]

    System of equations: $$2x + 2y - z = 6 \quad \cdots (1)$$ $$4x + 2y + 3z = 4 \quad \cdots (2)$$ $$x + y + z = 0 \quad \cdots (3)$$ All data present. Sub-questions: (a) why partial pivoting, (b) solve by Gauss elimination with partial piv...

  4. 45 marksNumericalHorner's methodAnswer

    Define the terms true error and relative error? Use Horner' method to evaluate polynomial at x = 3 and write down its algorithm. $2x^3 - 3x^2 + 5x - 2$ [5]

    True Error and Relative Error + Horner's Method

    Given Data

    • Polynomial: $P(x) = 2x^3 - 3x^2 + 5x - 2$
    • Evaluation point: $x = 3$
    • Coefficients: $a_3 = 2,\ a_2 = -3,\ a_1 = 5,\ a_0 = -2$

    Part 1: Definitions

    True Error

    True error is the difference between the exact (true) value of a quantity and its approximate (computed) value.

    $$E_t = \text{True Value} - \text{Approximate Value}$$

    It measures the actual (absolute) magnitude of the discrepancy in a numerical computation.

    Relative Error

    Relative error is the ratio of the true error to the true value, giving the error relative to the size of the exact quantity.

    $$E_r = \frac{E_t}{\text{True Value}} = \frac{\text{True Value} - \text{Approximate Value}}{\text{True Value}}$$

    Often expressed as a percentage:

    $$E_r% = \left|\frac{\text{True Value} - \text{Approximate Value}}{\text{True Value}}\right| \times 100%$$


    Part 2: Horner's Method

    Concept

    Horner's method reduces the number of multiplications by nesting coefficients:

    $$P(x) = a_nx^n + \cdots + a_1x + a_0 = \big(\cdots((a_n x + a_{n-1})x + a_{n-2})\cdots\big)x + a_0$$

    For our polynomial:

    $$P(x) = ((2x - 3)x + 5)x - 2$$

    Step-by-Step Evaluation at $x = 3$

    StepOperationResult
    Start$b_3 = a_3$$2$
    1$b_2 = b_3 \cdot 3 + a_2 = 2(3) - 3$$3$
    2$b_1 = b_2 \cdot 3 + a_1 = 3(3) + 5$$14$
    3$b_0 = b_1 \cdot 3 + a_0 = 14(3) - 2$$40$

    $$\boxed{P(3) = 40}$$

    Verification (Direct Substitution)

    $$P(3) = 2(27) - 3(9) + 5(3) - 2 = 54 - 27 + 15 - 2 = 40 \checkmark$$


    Algorithm for Horner's Method

    Algorithm: Horner's Method for Polynomial Evaluation
    
    Input  : Degree n, coefficients a[n], a[n-1], ..., a[0], value x
    Output : P(x)
    
    Step 1: Start
    Step 2: Read n, coefficients a[n] down to a[0], and value x
    Step 3: Set result = a[n]              // leading coefficient
    Step 4: For i = n-1 down to 0 do
                result = result * x + a[i]
            End For
    Step 5: Print result as P(x)
    Step 6: Stop
    

    Therefore, $P(3) = 40$.

  5. 55 marksNumericalNewton's Interpolation using divided diffeAnswer

    Newton's Forward Difference Table

    Construct Newton's forward difference table for the given data points and approximate the value of $f(x)$ at $x = 15$.

    $$\begin{array}{c|ccccc} x & 10 & 20 & 30 & 40 & 50 \ \hline F(x) & 0.173 & 0.342 & 0.5 & 0.643 & 0.766 \end{array}$$

    [5]

    x F(x) --------- 10 0.173 20 0.342 30 0.500 40 0.643 50 0.766 Spacing $h = 10$, $x0 = 10$. Required: $f(15)$. --- First differences ($\Delta$): - $0.342 - 0.173 = 0.169$ - $0.500 - 0.342 = 0.158$ - $0.643 - 0.500 = 0.143$ -

  6. 65 marksNumericalNon-linear Regression by fitting ExponentiAnswer

    Fit the curve $y = ae^{bx}$ through the following data points.

    x1234
    y1.652.704.507.35

    [5]

    $x$ 1 2 3 4 ------------------------- $y$ 1.65 2.70 4.50 7.35 $n = 4$ Taking natural logarithm: $$\ln y = \ln a + bx$$ Let $Y = \ln y$, $A = \ln a$, $B = b$: $$Y = A + Bx$$ $x$ $y$ $Y=\ln y$ $x^2$ $xY$ -------------------------- 1 1.65 0...

  7. 75 marksMatrix factorization and Solving System ofAnswer

    Discuss the Doolittle LU decomposition method for matrix factorization. [5]

    The coefficient matrix A of a system of linear equations can be decomposed (factorized) into two triangular matrices L (lower triangular) and U (upper triangular) such that: $$A = L \cdot U$$ $$L = \begin{bmatrix} 1 & 0 & 0 \ l{21} & 1 ...

  8. 85 marksDifferentiating Continuous FunctionsAnswer

    Write down algorithm and program for the differentiating continuous function using three point formula. [5]

    Differentiating continuous functions is the process of approximating the derivative f'(x) of a function f(x) when the function itself is available. The Three-Point (Central Difference) Formula is: $$f'(xp) = \frac{f(xp + h) - f(xp - h)}{...

  9. 95 marksSimpson's 1/3 ruleAnswer

    How Simpson's 1/3 rule differs from Trapezoidal rule? Drive the formula for Simpson's 1/3 rule. [5]

    Aspect Trapezoidal Rule Simpson's 1/3 Rule --------- Approximation Approximates the integrand using straight lines (linear polynomials) between points Approximates the integrand using parabolas (quadratic polynomials) through three point...

  10. 105 marksNumericalEuler's method and its accuracyAnswer

    Approximate the solution of $y' = 2x + y$, $y(0) = 1$ using Euler's method with step size 0.1. Approximate the value of $y(0.4)$. [5]

    • ODE: $y' = f(x,y) = 2x + y$ - Initial condition: $y(0) = 1$, so $x0 = 0$, $y0 = 1$ - Step size: $h = 0.1$ - Target: $y(0.4)$ (requires 4 steps) $$y{n+1} = yn + h \cdot f(xn, yn), \qquad f(xn,yn) = 2xn + yn$$ Step 1: $x0 = 0,\ y0 = 1$
  11. 115 marksNumericalLaplacian equation and Poisson's equationAnswer

    A plate of dimension 18cm x 18cm is subjected to temperatures as follows: left side at $100^\circ C$, right side at $200^\circ C$. Upper part at $50^\circ C$, and lower at $150^\circ C$. If square grid length of 6cm x 6cm is assumed, what will be the temperature at the interior nodes? [5]

    • Plate dimension: $18 \text{ cm} \times 18 \text{ cm}$ - Grid length: $6 \text{ cm} \times 6 \text{ cm}$ - Left boundary: $100^\circ C$ - Right boundary: $200^\circ C$ - Upper (top) boundary: $50^\circ C$ - Lower (bottom) boundary:
  12. 125 marksShooting method and its algorithmAnswer

    How boundary value problems differs from initial value problems? Discuss shooting method for solving boundary value problem. [5]

    Aspect Initial Value Problem (IVP) Boundary Value Problem (BVP) --------- Conditions All conditions are specified at a single point (initial point) Conditions are specified at two or more different points (boundaries) Solution approach C...