Numerical Methods and Scientific ComputingIntroductionData science depends on numerical computation. Although many models are written in exact mathematical form, computers represent numbers with finite precision, solve equations approximately, and execute algorithms whose costs may become substantial for large datasets. A statistically or mathematically correct model can therefore produce unreliable results if numerical error, ill-conditioning, unstable algorithms, slow convergence, or excessive computational complexity is ignored. Numerical methods provide systematic procedures for approximating solutions to problems such as linear systems, integration, differentiation, root finding, and optimization. Scientific computing combines these methods with appropriate data structures, hardware, software libraries, diagnostics, and reproducible workflows. This chapter develops the principles needed to select and implement numerical methods responsibly in data science. The central distinction is between the problem being solved and the algorithm used to solve it. A problem may be intrinsically sensitive, or an otherwise well-conditioned problem may be handled by an unstable algorithm. Learning ObjectivesBy the end of this chapter, students should be able to: - Explain floating-point representation and distinguish rounding, truncation, and propagation errors.
- Measure absolute and relative error and interpret conditioning.
- Analyze algorithmic stability, convergence, stopping criteria, and computational complexity.
- Select and implement reliable methods for linear systems, numerical integration, differentiation, and optimization.
- Explain how sparsity, iterative methods, parallelism, and preconditioning support large-scale data problems.
- Diagnose numerical failure and communicate uncertainty, assumptions, and reproducibility requirements.
1. Numerical Error and Floating-Point Arithmetic1.1 Exact numbers and machine numbersReal numbers are continuous, but a computer stores only a finite set of representable numbers. In a normalized floating-point system, a nonzero number is represented conceptually as x = (−1)s × m × βe where s is the sign bit, m is the significand, β is the base, and e is an integer exponent. In the common IEEE 754 binary64 format, a number uses 64 bits: 1 sign bit, 11 exponent bits, and 52 explicitly stored fraction bits. The hidden leading bit gives approximately 53 binary significant bits, or about 15–16 decimal significant digits. Not every decimal number has an exact binary representation. For example, 0.1 is stored as a nearby binary number. Arithmetic is usually rounded after each operation. If fl(x) denotes the stored result, a standard model for a normal, non-underflowing operation is fl(x) = x(1 + δ), |δ| ≤ u where u is the unit roundoff. For binary precision p, u is approximately ½β^(1−p) under round-to-nearest. In binary64, u is approximately 1.11 × 10^−16. The model is an approximation and does not cover overflow, underflow, NaN values, or exceptional hardware behavior. 1.2 Types of numerical errorThe absolute error in an approximation x̂ to an exact value x is eabs = |x̂ − x| The relative error, when x ≠ 0, is erel = |x̂ − x| / |x| Absolute error is appropriate when an additive tolerance matters; relative error is more informative for quantities whose scale varies. For example, an error of 0.001 is negligible if x = 10,000 but substantial if x = 0.0005. Round-off error results from finite precision. Truncation error results from replacing an infinite process, derivative, or series with a finite approximation. Discretization error arises when a continuous domain is represented by a finite grid. Model error arises when the mathematical model does not accurately represent the underlying phenomenon. These sources should not be confused: increasing precision may reduce round-off error but cannot correct a misspecified model. 1.3 Cancellation and overflowSubtractive cancellation occurs when nearly equal quantities are subtracted. In the expression x − y, if x and y are close, significant digits common to both may disappear, leaving a result dominated by rounding error. Algebraically equivalent formulas can therefore have very different numerical behavior. For example, the expression √(x² + 1) − x is poorly evaluated for large positive x because the two terms are nearly equal. Multiplying by the conjugate gives the equivalent expression 1 / (√(x² + 1) + x) which avoids subtracting nearly equal numbers. Overflow occurs when a magnitude exceeds the representable range; underflow occurs when it becomes too small. Stable implementations often rescale variables, use logarithmic computations, or apply specialized functions such as log-sum-exp. In probabilistic machine learning, for example, computing log(∑ᵢ exp(zᵢ)) directly can overflow. A stable form is log(∑ᵢ exp(zᵢ)) = a + log(∑ᵢ exp(zᵢ − a)), a = maxᵢ zᵢ provided the sum is evaluated in a compatible floating-point format. 2. Conditioning, Stability, and Convergence2.1 Conditioning of a problemConditioning describes how sensitive the exact answer is to perturbations in the input. It is a property of the mathematical problem, not primarily of the implementation. For a scalar function y = f(x), a local relative condition number is κf(x) = |x f′(x) / f(x)| when x, f(x), and f′(x) are defined and nonzero. If κ_f is large, small relative input errors may produce large relative output errors. A problem with a large condition number is called ill-conditioned. For a nonsingular matrix A in a linear system Ax = b, the normwise condition number is κ(A) = ||A|| ||A^−1|| where ||·|| is a compatible matrix norm. Since κ(A) ≥ 1, values near one indicate good conditioning in that norm; a large value indicates sensitivity. In the 2-norm, κ₂(A) = σ_max(A)/σ_min(A), where σ_max and σ_min are the largest and smallest singular values. A useful perturbation result is that, approximately, relative solution error ≤ κ(A) × relative data error for sufficiently small perturbations and appropriate norm assumptions. This is a bound or estimate, not a guarantee of equality. 2.2 Algorithmic stabilityAn algorithm is forward stable if its computed answer is close to the exact answer for the original problem. It is backward stable if the computed answer is the exact answer to a nearby problem. Backward stability is often desirable because it separates the algorithm's error from the problem's conditioning. A backward-stable algorithm applied to an ill-conditioned problem may still produce a forward-inaccurate answer: a tiny perturbation in the input can legitimately cause a large change in the output. Thus, accuracy depends on both conditioning and stability. Gaussian elimination with partial pivoting is a standard example of a practically reliable direct method for dense linear systems. Pivoting reduces the risk of dividing by a small pivot. Without pivoting, even a nonsingular matrix can lead to severe numerical growth. 2.3 ConvergenceAn iterative sequence x₀, x₁, … converges to x* if limk→∞ xk = x* The error is e_k = x_k − x*. Linear convergence means approximately |e_{k+1}| ≤ C|e_k| for a constant C < 1. Quadratic convergence means |e_{k+1}| ≤ C|e_k|² near the solution. Quadratic convergence is much faster near a sufficiently good solution but may require stronger assumptions and a better initial estimate. A numerical method should be assessed through: - Consistency: whether the discrete approximation represents the original problem as resolution increases.
- Stability: whether perturbations remain controlled.
- Convergence: whether the computed approximation approaches the desired solution.
- Termination: whether the stopping rule reflects the required accuracy rather than merely a fixed iteration count.
A practical stopping rule may combine residual and step tests. For Ax = b, define the residual r_k = b − Ax_k. One may stop when ||rk|| / ||b|| ≤ τr and ||xk − xk−1|| / max(1, ||xk||) ≤ τx where τ_r and τ_x are user-selected tolerances. A small step does not always imply a small error, particularly for ill-conditioned problems, so residual and conditioning should be considered together. 3. Computational Complexity and ReproducibilityComputational complexity describes how time or memory grows with input size. Big-O notation suppresses constants and lower-order terms. For a dense n × n linear system, Gaussian elimination requires approximately O(n³) arithmetic operations and O(n²) storage. Once a factorization is available, solving for a new right-hand side costs approximately O(n²). A dense matrix with n = 100,000 cannot ordinarily be stored as a full n × n array: it would require approximately 10¹⁰ entries. If each entry uses 8 bytes, storage alone would be approximately 80 GB, excluding overhead. Sparse representation can make the problem feasible when most entries are zero. Complexity should be analyzed together with: - memory traffic and cache behavior;
- communication cost in distributed systems;
- parallel scalability;
- numerical precision;
- initialization and preprocessing;
- number of repeated solves;
- data sparsity and structure.
Scientific computing also requires reproducibility. Record software versions, hardware, precision, random seeds where relevant, data preprocessing, tolerances, convergence diagnostics, and failure handling. Reproducibility is not identical to bit-for-bit equality: parallel reductions and hardware may produce slightly different rounding, while still yielding scientifically equivalent results. 4. Reliable Solutions of Linear Systems4.1 Direct methodsA linear system has the form Ax = b where A ∈ ℝ^{n×n}, x ∈ ℝⁿ is the unknown vector, and b ∈ ℝⁿ is the right-hand side. If A is nonsingular, the exact solution is unique. Explicitly computing A^−1 is usually unnecessary and less efficient than solving through a factorization. Gaussian elimination transforms A into an upper triangular matrix U. With partial pivoting, one obtains PA = LU where P is a permutation matrix, L is lower triangular with unit diagonal, and U is upper triangular. The solution is obtained by forward substitution Ly = Pb followed by back substitution Ux = y. For symmetric positive-definite matrices, the Cholesky factorization is preferable: A = LLᵀ It uses approximately half the factorization work of a general dense LU factorization and is generally more stable for this matrix class. A matrix A is positive definite if xᵀAx > 0 for every nonzero x. 4.2 Worked example: elimination with pivotingConsider 2x + y = 5 4x + 3y = 11 The augmented matrix is [[2, 1 | 5], [4, 3 | 11]]. Eliminate the second-row first entry using row₂ ← row₂ − 2row₁: [2 1 | 5] [0 1 | 1] Back substitution gives y = 1 and then 2x + 1 = 5, so x = 2. Substitution verifies both equations: 2(2) + 1 = 5 and 4(2) + 3(1) = 11. In software, the residual r = b − Ax should be computed after solving; a small residual is necessary but, for an ill-conditioned A, may not imply a small relative solution error. 4.3 Iterative methods for large systemsFor large sparse systems, direct factorization may create fill-in, where zeros become nonzero during factorization. Iterative methods avoid forming a full factorization. For Ax = b, the Jacobi method uses xi(k+1) = (bi − ∑j≠i aijxj(k)) / aii assuming a_{ii} ≠ 0. Gauss–Seidel uses newly updated values immediately. Convergence is not guaranteed for every matrix; sufficient conditions include strict diagonal dominance for common forms of these methods. For symmetric positive-definite A, the conjugate-gradient method is especially important. In exact arithmetic, it reaches the solution in at most n iterations, but in floating-point arithmetic and large applications, convergence depends on eigenvalue distribution and is usually measured by residual reduction. The method is commonly accelerated by preconditioning. A preconditioner M approximates A while allowing M^−1v to be computed cheaply; the transformed problem has improved spectral properties when M is well chosen. For general nonsymmetric systems, Krylov methods such as GMRES and BiCGSTAB may be used. GMRES minimizes the residual over an expanding Krylov subspace but may require increasing storage; restarted GMRES limits memory at the cost of potentially slower convergence. 4.4 Numerical best practices for linear algebraUse a library implementation that performs pivoting and reports warnings. Check matrix dimensions, rank indicators, symmetry, definiteness, scaling, and residuals. Avoid normal equations for least squares when conditioning is a concern. Although minimizing ||Ax − b||₂² leads to the normal equations AᵀAx = Aᵀb, the condition number is approximately squared: κ(AᵀA) ≈ κ(A)². QR factorization or singular value decomposition is generally more reliable. 5. Numerical Differentiation and Integration5.1 DifferentiationFor a sufficiently smooth function f, the forward-difference approximation is f′(x) ≈ [f(x+h) − f(x)] / h with truncation error O(h). The central-difference approximation is f′(x) ≈ [f(x+h) − f(x−h)] / (2h) with truncation error O(h²). The central formula is usually more accurate for the same h, but both suffer from round-off when h is extremely small. Decreasing h reduces truncation error but increases cancellation and evaluation error. Consequently, there is an intermediate near-optimal step size rather than a universally best h. Second derivatives can be approximated by f″(x) ≈ [f(x+h) − 2f(x) + f(x−h)] / h² with O(h²) truncation error for a smooth f. Because division by h² amplifies function-evaluation errors, second differentiation is particularly sensitive to noise. In data science, differentiating noisy observations often requires smoothing, regularization, splines, or automatic differentiation rather than raw finite differences. Automatic differentiation applies the chain rule to computer operations and typically gives derivatives accurate to floating-point effects without symbolic expression expansion. It is distinct from numerical differentiation: it does not approximate derivatives by subtracting nearby function values. 5.2 QuadratureThe objective of numerical integration is to approximate I = ∫ab f(x) dx when an analytic antiderivative is unavailable or function evaluations are expensive. The composite trapezoidal rule with n equal subintervals and step h = (b − a)/n is Tn = h[½f(a) + ∑i=1n−1 f(a + ih) + ½f(b)] For a twice continuously differentiable function, its global error is O(h²). The composite Simpson rule, requiring even n, is Sn = (h/3)[f(a) + f(b) + 4∑i odd f(a + ih) + 2∑i even, 2≤i≤n−2 f(a + ih)] and has global error O(h⁴) when f has four continuous derivatives. The alternating coefficients must be applied exactly; Simpson's rule is not defined in this composite form for odd n. Adaptive quadrature estimates local error and refines intervals where f changes rapidly or has difficult behavior. It is often more efficient than using a uniformly fine grid. Singularities, discontinuities, oscillations, and high-dimensional domains require specialized methods or transformations. 5.3 Worked example: trapezoidal integrationApproximate ∫₀¹ x² dx using the composite trapezoidal rule with n = 2. Here h = 0.5, f(0) = 0, f(0.5) = 0.25, and f(1) = 1. Therefore, T2 = 0.5[½(0) + 0.25 + ½(1)] = 0.5(0.75) = 0.375 The exact integral is 1/3 ≈ 0.333333, so the absolute error is approximately 0.041667. The error is positive because x² is convex and the trapezoidal chords lie above the curve. Simpson's rule with n = 2 gives S2 = (0.5/3)[0 + 4(0.25) + 1] = 1/3 which is exact here because Simpson's rule integrates every polynomial of degree at most three exactly. 6. Root Finding and Numerical Optimization6.1 Root findingA root of f is a value x satisfying f(x) = 0. The bisection method begins with an interval [a,b] such that f(a)f(b) < 0 and assumes continuity. The interval is repeatedly halved, preserving a sign change. After k iterations, the interval width is (b − a)/2^k, giving a guaranteed bracket-based error bound. Newton's method is xk+1 = xk − f(xk)/f′(xk) Near a simple root, and with a sufficiently good initial value, it is quadratically convergent. It can fail when f′ is zero or small, when the initial value is poor, or when the iteration leaves the desired domain. Hybrid methods combine a reliable bracket with Newton or secant steps. 6.2 OptimizationFor a differentiable objective F(w), gradient descent updates wk+1 = wk − ηk ∇F(wk) where w is the parameter vector and η_k > 0 is the learning rate. For a quadratic objective F(w) = ½wᵀHw − gᵀw, with symmetric positive-definite H, the minimizer satisfies Hw = g. The convergence rate depends on the condition number of H; poorly scaled curvature causes slow progress. Feature scaling, preconditioning, momentum, adaptive step rules, or second-order methods can improve behavior, but each introduces assumptions and computational costs. Newton optimization uses wk+1 = wk − [∇²F(wk)]^−1∇F(wk) when the Hessian exists and is nonsingular. In large machine-learning problems, storing or factoring the Hessian may be impractical, so quasi-Newton methods, Hessian-vector products, and stochastic optimization are common. Stochastic gradient methods use an unbiased or approximately unbiased minibatch gradient estimate. Their iterates need not decrease the objective at every step, and convergence depends on learning-rate schedules, noise, smoothness, and sometimes convexity. A small gradient norm is evidence of approximate stationarity, not necessarily global optimality for a nonconvex problem. 7. Large-Scale Scientific ComputingLarge-scale data problems require exploiting structure rather than applying dense algorithms blindly. Sparsity allows storage proportional to the number of nonzero entries, often written nnz(A), rather than n². Sparse matrix-vector multiplication typically costs O(nnz(A)). Low-rank structure permits approximations such as A ≈ UVᵀ, reducing storage and computation when singular values decay rapidly. Randomized numerical linear algebra uses random projections to estimate low-rank subspaces, leverage scores, or least-squares solutions with lower cost, while requiring probabilistic error analysis. Streaming algorithms process data in one or a few passes with limited memory. Examples include online least squares, incremental singular-value approximations, and sketching. They trade exactness for memory and speed and must quantify approximation error. Parallel computing divides arithmetic across processors or accelerators. The ideal speedup on p processors is p, but synchronization, communication, serial work, and load imbalance limit actual speedup. Amdahl's law expresses this limitation: if s is the fraction of work that is inherently serial, the maximum speedup is S(p) = 1 / [s + (1−s)/p] This is an idealized model and does not include communication overhead. Mixed precision can accelerate computation by using lower precision for inexpensive operations and higher precision for sensitive steps. Reliable mixed-precision algorithms commonly use scaling, iterative refinement, and residual checks. Precision should be selected based on conditioning and required accuracy, not merely hardware availability. 8. Illustrative Case: Stable Demand Forecasting for a Retail NetworkBackgroundA retailer wants to forecast daily demand for 50,000 products across 2,000 stores. A regularized linear model uses historical sales, prices, promotions, holidays, and weather variables. The resulting design matrix is large and sparse because many products and stores do not appear in every observation. ProblemAn initial implementation forms a dense normal-equation matrix XᵀX and solves (XᵀX + λI)β = Xᵀy where X is the feature matrix, y is demand, β is the coefficient vector, λ > 0 is a regularization parameter, and I is the identity matrix. The team observes unstable coefficients, memory failures, and different answers across hardware. AnalysisThe matrix XᵀX may be much more ill-conditioned than X because κ(XᵀX) is approximately κ(X)². Dense storage also ignores sparsity. Differences across hardware may result from parallel summation order and floating-point non-associativity: (a + b) + c need not equal a + (b + c) in finite precision. Approach and solutionThe team first standardizes continuous predictors using training-set statistics and encodes categorical variables in a sparse format. Rather than forming XᵀX, it uses a sparse QR-based solver for moderate instances and a preconditioned iterative least-squares method for larger instances. Regularization is selected using validation data, while λ is not treated as a numerical tolerance. Each solve reports the relative residual, coefficient norm, iteration count, and convergence status. The implementation uses deterministic data ordering for audit runs, compensated or pairwise reductions where useful, fixed software environments, and a higher-precision validation run on a sample. Predictions are compared against a stable reference implementation. OutcomeMemory usage becomes feasible, coefficient variation decreases, and the residual diagnostics identify cases requiring additional iterations. Forecast accuracy improves modestly, but operational reliability improves substantially because failed or suspicious solves are detected rather than silently accepted. Learning points- A mathematically equivalent formulation can have very different numerical behavior.
- Conditioning, sparsity, and solver choice must be evaluated together.
- Residuals, convergence flags, and reproducibility metadata are part of a production numerical system.
- Regularization can improve statistical generalization and numerical conditioning, but it does not excuse poor scaling or inadequate diagnostics.
9. Limitations, Governance, and Best PracticesNumerical output is not automatically scientific truth. A solver may converge to the wrong model, a local optimum, or a solution whose apparent precision exceeds the quality of the input data. Measurement uncertainty, missing data, bias, and distribution shift can dominate floating-point error. In regulated or high-consequence applications, preserve input data versions, parameter choices, solver logs, residuals, exceptions, and human approvals. Numerical approximations should be communicated with appropriate significant digits; reporting twelve decimal places does not create twelve reliable digits. For safety-critical decisions, independent implementations, interval or probabilistic uncertainty analysis, stress testing, and conservative failure modes may be required. A practical workflow is: - Formulate the mathematical problem and identify assumptions.
- Estimate conditioning and scale variables.
- Exploit structure such as symmetry, sparsity, separability, or low rank.
- Select a stable algorithm with a justified tolerance.
- Use reliable library routines rather than unverified custom code.
- Monitor residuals, objective values, step sizes, and iteration limits.
- Test on analytically solvable and adversarial cases.
- Compare precision or algorithms when results are sensitive.
- Record reproducibility metadata and report limitations.
Contemporary DevelopmentsModern scientific computing increasingly combines numerical analysis with machine learning. Differentiable programming permits numerical solvers to be embedded in optimization pipelines, but gradients through iterative algorithms may be inaccurate if the solver is stopped too early. Neural operators and physics-informed models use numerical discretizations alongside learned components, making stability and conservation constraints important. GPU and tensor accelerators favor batched operations and mixed precision, while emerging hardware raises questions about fault tolerance and reproducibility. Randomized algorithms provide scalable approximations, but confidence bounds and failure probabilities must be included in their interpretation. Chapter SummaryFloating-point arithmetic represents real numbers approximately and introduces rounding, overflow, underflow, and cancellation. Absolute and relative error quantify discrepancy, while truncation and discretization error arise from approximation of mathematical operations or continuous domains. Conditioning measures sensitivity of a problem; stability measures the behavior of an algorithm. An ill-conditioned problem can remain inaccurate even when solved by a stable method. Direct linear solvers such as pivoted LU and Cholesky are effective for structured dense systems, whereas sparse and large systems often require iterative Krylov methods and preconditioning. Finite differences illustrate the trade-off between truncation and round-off error, while adaptive quadrature improves integration efficiency. Bisection provides robust root bracketing, Newton's method offers rapid local convergence, and optimization methods must account for curvature, scaling, stochasticity, and nonconvexity. Complexity, memory, sparsity, parallelism, mixed precision, and reproducibility determine whether a method is practical at data-science scale. Reliable scientific computing therefore requires mathematical analysis, stable implementation, diagnostic residuals, validated stopping criteria, documented assumptions, and governance appropriate to the consequences of error. Key TermsFloating-point arithmetic: Finite-precision representation and computation of real-number approximations. Unit roundoff: A bound characterizing relative rounding error under a specified floating-point format and rounding rule. Absolute error: The magnitude |x̂ − x| between an approximation and an exact value. Relative error: Absolute error divided by the magnitude of the exact value, when nonzero. Round-off error: Error caused by finite-precision representation and arithmetic. Truncation error: Error caused by replacing an exact infinite or continuous operation with a finite approximation. Cancellation: Loss of significant digits caused by subtracting nearly equal quantities. Conditioning: Sensitivity of a mathematical problem to perturbations in its input. Condition number: A quantitative measure of sensitivity, such as κ(A) = ||A||||A^−1||. Backward stability: Property that a computed result is exact for a nearby input problem. Convergence: Approach of numerical iterates to a target solution as iteration proceeds. Residual: The discrepancy b − Ax when x is proposed as a solution of Ax = b. Pivoting: Row or column rearrangement used to improve numerical reliability in elimination. Preconditioning: Transformation of a system to improve iterative convergence. Conditioning: Sensitivity of an output to input perturbations. Quadrature: Numerical approximation of a definite integral. Automatic differentiation: Exact chain-rule differentiation of a computational program up to floating-point effects. Sparsity: Presence of many zero entries in a vector or matrix. Mixed precision: Use of more than one numerical precision in a computation. Computational complexity: Growth of time, memory, or communication requirements with problem size. Review QuestionsShort Answer Questions- Distinguish round-off error from truncation error.
- Why can a small residual fail to imply a small solution error?
- State one advantage of Cholesky factorization and its matrix requirement.
- Why is numerical differentiation sensitive to the choice of step size?
- What purpose does a preconditioner serve in an iterative linear solver?
Long Answer Questions- Explain the relationship among conditioning, stability, and accuracy, using a linear-system example.
- Compare Gaussian elimination, conjugate gradient, and GMRES in terms of assumptions, storage, and use cases.
- Derive and discuss the composite trapezoidal and Simpson rules, including their smoothness assumptions and error orders.
- Explain why forming normal equations can be numerically inferior to QR or singular value decomposition for least squares.
- Discuss how sparsity, parallelism, mixed precision, and reproducibility affect the design of a scientific-computing pipeline.
Analytical / Application Questions- A data scientist observes that decreasing the finite-difference step h initially improves a derivative estimate but eventually makes it worse. Explain the competing errors and propose a practical diagnostic.
- A sparse, symmetric positive-definite system has millions of unknowns but only a few nonzero entries per row. Select a suitable solver strategy and justify the roles of conjugate gradient, preconditioning, residual monitoring, and storage format.
- A forecasting model produces nearly identical residuals on two machines but noticeably different coefficients. Analyze possible numerical and statistical causes and design a validation procedure.
Multiple Choice Questions with AnswersQuestion 1Which quantity measures sensitivity of a linear system to perturbations in its data? A. Condition number B. Iteration count C. Matrix dimension only D. Residual sign Correct Answer: A. Condition number Question 2For binary64 arithmetic, the unit roundoff is approximately: A. 1.11 × 10^−16 B. 1.11 × 10^−8 C. 2.22 × 10^−3 D. 53 Correct Answer: A. 1.11 × 10^−16 Question 3Which factorization is specifically suited to symmetric positive-definite matrices? A. Cholesky factorization B. Unpivoted QR only C. Fourier factorization D. Bisection factorization Correct Answer: A. Cholesky factorization Question 4The composite trapezoidal rule has global error of what order for a twice continuously differentiable function? A. O(h) B. O(h²) C. O(h³) D. O(h⁴) Correct Answer: B. O(h²) Question 5Why can making h extremely small worsen a finite-difference derivative? A. It increases cancellation and round-off effects B. It eliminates all truncation error exactly C. It changes differentiation into integration D. It guarantees overflow Correct Answer: A. It increases cancellation and round-off effects Question 6Which method guarantees interval contraction when f is continuous and f(a)f(b) < 0? A. Bisection B. Newton's method without safeguards C. Gradient descent D. Jacobi iteration for any matrix Correct Answer: A. Bisection Question 7For least squares, forming AᵀA can be problematic because: A. It approximately squares the condition number B. It always makes the matrix nonsymmetric C. It requires no matrix multiplication D. It prevents regularization Correct Answer: A. It approximately squares the condition number Question 8What is the main purpose of preconditioning? A. Improve convergence of an iterative method B. Increase the number of unknowns C. Remove the right-hand side D. Guarantee exact arithmetic Correct Answer: A. Improve convergence of an iterative method Question 9For the integral ∫₀¹ x² dx, the exact value is: A. 0.25 B. 0.333333… C. 0.5 D. 1 Correct Answer: B. 0.333333… Question 10In the expression log(∑ᵢ exp(zᵢ)), subtracting the maximum zᵢ before exponentiation primarily helps prevent: A. Overflow B. Sparsity C. Symmetry D. Quadratic convergence Correct Answer: A. Overflow
|