Math4501 Lecture 2
Solving non-linear equations
Let we want to solve . ( equations, variables)
In case if is linear, we can solve it by Gaussian elimination.
Closely related to the problem: eigenvalue problem.
related to root finding problem for polynomial.
Polynomial approximations
Let be a continuous function.
Find polynomial of degree such that for .
Then, some key questions are involved:
- How to compute ?
- If is continuously differentiable, does approximate ?
- If is integrable, does approximate ?
Deeper questions:
Is the approximation efficient?
Scalar problem
Problem 1: Let be a continuous function. Find such that .
Problem 2: Let be a continuous function. Find such that .
P1, P2 are equivalent. is a continuous function.
Some advantage in solving P1 as P2
When does a solution exists
Trivial case: for some .
Without loss of generality, assume , Then there exists such that .
Bisection algorithm:
def bisection(f, a, b, tol=1e-6, max_iter=100):
# first we setup two sequences $a_n$ and $b_n$
# require:
# |a_n - b_n| \leq 2^{-n} (b-a)
for i in range(max_iter):
c = (a + b) / 2
if c < tol or f(c) == 0:
return c
elif f(a) * f(c) < 0:
b = c
else:
a = c
return NoneLet for all and for all .
and .
If limit exists, then .
Such limit exists by the sequence and is Cauchy and we are in real number field.
This can be used to solve P2:
Recall that if we define , then if and only if . That is .