Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Previous lectures: Basis and Dimension The Dimension Theorem Every basis of V has the same size. Theorem Suppose that V is a d–dimensional vector space a) Every linearly independent subset of V can be extended to a basis of V . b) Every spanning set in V contains a basis. Useful Fact Suppose V is a d–dimensional vector space and that y1 , y2 , . . . , yd are vectors in V . Then the following are equivalent. a) {y1 , y2 , . . . , yd } is a basis of V . b) {y1 , y2 , . . . , yd } are linearly independent. c) {y1 , y2 , . . . , yd } span V . 0-0 This lecture: Lagrange Polynomials There are ”natural” bases for Vector Spaces Rn and Pn . In general, the best choice for the basis of a vector space is often determined by the problem itself. Lagrange polynomials are an example of a special basis of Pn chosen to solve a specific problem, namely curve fitting. Lagrange polynomials are used to solve the problem of finding a polynomial of minimal degree that passes through a given set of points in the xy plane. Knowing this polynomial then allows predictions to be made about the y values corresponding to other values of x. This process is called interpolation if the x values lie in the range of x used to define the Lagrange polynomials. Suppose we consider the set of n+1 points (c0 , k0 ), (c1 , k1 ), (c2 , k2 ), ......, (cn , kn ) in the xy plane. We assume that all the x values c0 , c1 , ....., cn are different. We can display the points in tabulated form as: 0-1 x values y values c0 k0 c1 k1 c2 k2 ... ... cn kn Through two data points (c0 , k0 ) and (c1 , k1 ) we can fit a straight line. Through three data points (c0 , k0 ), (c1 , k1 ) and (c2 , k2 ) we can fit a parabola. With n+1 data points (c0 , k0 ), (c1 , k1 ), (c2 , k2 ),.....(cn , kn ), a polynomial of degree n is generally the one of minimum degree that fits the points exactly. To find such a polynomial, we construct a special basis of the vector space Pn making use of the x values from the data table. This basis consists of n + 1 polynomials of degree n, (p0 , p1 , p2 , ....., pn ) satisfying the conditions • pi (cj ) = 0 if i 6= j, and • pi (ci ) = 1 for all i = 0, 1, 2, ....., n. That is, pi (x) is zero at all x data values except ci and pi (x) is 1 when x = ci . 0-2 Theorem If (p0 , p1 , p2 , ....., pn ) are polynomials in Pn satisfying the conditions: • pi (cj ) = 0 if i 6= j, and • pi (ci ) = 1 for all i = 0, 1, 2, , ...., n, then (p0 , p1 , p2 , ....., pn ) is a basis of Pn . Proof First we prove linear independence. Suppose that a0 p0 (x) + a1 p1 (x) + a2 p2 (x) + ..... + an pn (x) = 0 for all values of x. Substituting x = c0 gives a0 × 1 + a1 × 0 + a2 × 0 + ..... + an × 0 = 0, that is a0 = 0 Substituting x = c1 gives a0 × 0 + a1 × 1 + a2 × 0 + ..... + an × 0 = 0, that is a1 = 0 Continuing in this way, it is clear that all scalars a0 , a1 , ....., an must be zero. 0-3 This proves the linear independence of (p0 , p1 , p2 , ...., pn ). Hence Span(p0 , p1 , p2 , ...., pn ) = Pn , Therefore (p0 , p1 , p2 , ...., pn ) is a basis of Pn . Example Suppose the data is given by the Table: x values y values 0 1 1 3 2 5 From the data given, the Lagrange basis is (p0 ,p1 ,p2 ), where p0 (x) = (x − 1)(x − 2)/((0 − 1)(0 − 2)) = (x − 1)(x − 2)/2 p1 (x) = x(x − 2)/(1(1 − 2)) = −x(x − 2) p2 (x) = x(x − 1)/(2(2 − 1)) = x(x − 1)/2 The polynomial that fits the data exactly is given by the linear combination of the Lagrange basis vectors with the y values as coefficients: p(x) = 1p0 (x) + 3p1 (x) + 5p2 (x) 0-4 = (x − 1)(x − 2)/2 − 3x(x − 2) + 5x(x − 1)/2 = 2x + 1 Observe the connection between Lagrange polynomials and partial fractions. Suppose we had to break down the expression 2x+1 x(x−1)(x−2) into partial fractions. The expression becomes (1/2)(1/x) − 3(1/(x − 1)) + (5/2)(1/(x − 2)) For a different set of y values, such as: x values y values 0 1 1 3 2 7 the Lagrange polynomial is: p(x) = 1p0 (x) + 3p1 (x) + 7p2 (x) = (x − 1)(x − 2)/2 − 3x(x − 2) + 7x(x − 1)/2 = x2 + x + 1 0-5