1 Calculating Polynomials We will use a generic polynomial form of: where the coefficient values are known constants The value of x will be the input and.

Slides:



Advertisements
Similar presentations
Chapter 2 Simultaneous Linear Equations
Advertisements

Linear Algebra Applications in Matlab ME 303. Special Characters and Matlab Functions.
SOLUTION OF STATE EQUATION
Divide and Conquer Strategy
Dividing Polynomials.
Chapter 2 Polynomial and Rational Functions Copyright © 2014, 2010, 2007 Pearson Education, Inc Dividing Polynomials: Remainder and Factor Theorems.
Dividing Polynomials Objectives
5-4 Dividing Polynomials Long Division Today’s Objective: I can divide polynomials.
Simultaneous Linear Equations
Lecture 9: Introduction to Matrix Inversion Gaussian Elimination Sections 2.4, 2.5, 2.6 Sections 2.2.3, 2.3.
Chapter 2 Matrices Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
Slide Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
Solving Linear Equations Rule 7 ‑ 1: We can perform any mathematical operation on one side of an equation, provided we perform the same operation on the.
Goldstein/Schnieder/Lay: Finite Math & Its Applications, 9e 1 of 86 Chapter 2 Matrices.
Finite Mathematics & Its Applications, 10/e by Goldstein/Schneider/SiegelCopyright © 2010 Pearson Education, Inc. 1 of 86 Chapter 2 Matrices.
Arithmetic Operations on Matrices. 1. Definition of Matrix 2. Column, Row and Square Matrix 3. Addition and Subtraction of Matrices 4. Multiplying Row.
College Algebra Fifth Edition James Stewart Lothar Redlin Saleem Watson.
Dividing Polynomials; Remainder and Factor Theorems.
Quiz 2 key.
Polynomial Division: Dividing one polynomial by another polynomial to find the zeros of the polynomial. Ex 1: Find the zeros of Solution:1 st way: At.
Section 8.1/8.2 Matrix Solutions to Linear Systems Inconsistent and Dependent Systems.
MATRICES AND DETERMINANTS
Barnett/Ziegler/Byleen Finite Mathematics 11e1 Review for Chapter 4 Important Terms, Symbols, Concepts 4.1. Systems of Linear Equations in Two Variables.
Sect 8.1 Systems of Linear Equations A system of linear equations is where all the equations in a system are linear ( variables raised to the first power).
MATH 250 Linear Equations and Matrices
MIT and James Orlin © –Developed by James Orlin, MIT Animation of the Gauss-Jordan Elimination Algorithm.
Analysis of Algorithms
LIAL HORNSBY SCHNEIDER
1. Inverse of A 2. Inverse of a 2x2 Matrix 3. Matrix With No Inverse 4. Solving a Matrix Equation 1.
Unit 3: Matrices.
1 © 2010 Pearson Education, Inc. All rights reserved © 2010 Pearson Education, Inc. All rights reserved Chapter 3 Polynomial and Rational Functions.
3.3: Dividing Polynomials: Remainder and Factor Theorems Long Division of Polynomials 1.Arrange the terms of both the dividend and the divisor in descending.
2.3 Synthetic Substitution OBJ:  To evaluate a polynomial for given values of its variables using synthetic substitution.
Copyright © Cengage Learning. All rights reserved. 4 Quadratic Functions.
Lesson 2.4, page 301 Dividing Polynomials Objective: To divide polynomials using long and synthetic division, and to use the remainder and factor theorems.
Multiply polynomials vertically and horizontally
Calculus 3.4 Manipulate real and complex numbers and solve equations AS
5.5: Apply Remainder and Factor Theorems (Dividing Polynomials) Learning Target: Learn to complete polynomial division using polynomial long division and.
Chapter 1 Polynomial and Rational Functions Copyright © 2014, 2010, 2007 Pearson Education, Inc Dividing Polynomials; Remainder and Factor Theorems.
Section 5.5 The Real Zeros of a Polynomial Function.
Date: 2.4 Real Zeros of Polynomial Functions
Copyright © 2006 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Real Zeros of Polynomial Functions ♦ Divide Polynomials ♦ Understand the.
Slide Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley A set of equations is called a system of equations. The solution.
College Algebra Sixth Edition James Stewart Lothar Redlin Saleem Watson.
Section 4.3 Polynomial Division; The Remainder and Factor Theorems Copyright ©2013, 2009, 2006, 2001 Pearson Education, Inc.
Multiply one equation, then add
Polynomial P(x) Linear Factors Solutions of P(x)=0 Zeros of P(x) P(x) = 0.
Unit 3: Matrices. Matrix: A rectangular arrangement of data into rows and columns, identified by capital letters. Matrix Dimensions: Number of rows, m,
Chapter 5: Matrices and Determinants Section 5.5: Augmented Matrix Solutions.
Elementary Row Operations Interchange two equations Multiply one equation by a nonzero constant Add a multple of one equation to another equation.
Real Zeros of Polynomial Functions
Key Vocabulary: Dividend Divisor Quotient Remainder.
10.4 Matrix Algebra. 1. Matrix Notation A matrix is an array of numbers. Definition Definition: The Dimension of a matrix is m x n “m by n” where m =
Numerical Methods. Introduction Prof. S. M. Lutful Kabir, BRAC University2  One of the most popular techniques for solving simultaneous linear equations.
Pitfalls of Gauss Elimination ● Division by zero (avoid by pivoting) ● Round-off errors – Important with >100 eqns – Substitute answer into original eqn.
Substitution Method: Solve the linear system. Y = 3x + 2 Equation 1 x + 2y=11 Equation 2.
3.3 Dividing Polynomials.
Lecture 4 The Euclidean Algorithm
Dividing Polynomials A review of long division:
Analysis of Algorithms
Solution to Equations RAFIZAH KECHIL, UiTM PULAU PINANG
Section 2.4 Dividing Polynomials; Remainder and Factor Theorems
Find all solutions of the polynomial equation by factoring and using the quadratic formula. x = 0 {image}
Copyright © 2014, 2010, 2007 Pearson Education, Inc.
Chapter 4 Systems of Linear Equations; Matrices
Unit 3: Matrices
Copyright © 2014, 2010, 2007 Pearson Education, Inc.
Precalculus Essentials
4.3 – The Remainder and Factor Theorems
Chapter 4 Systems of Linear Equations; Matrices
Presentation transcript:

1 Calculating Polynomials We will use a generic polynomial form of: where the coefficient values are known constants The value of x will be the input and the result is the value of the polynomial using this x value

2 Standard Evaluation Algorithm result = a[0] + a[1]*x xPower = x for i = 2 to n do xPower = xPower * x result = result + a[i]*xPower end for return result

3 Analysis Before the loop, there is –One multiplication –One addition The for loop is done N-1 times –There are two multiplications in the loop –There is one addition in the loop There are a total of –2N – 1 multiplications –N additions

4 Horner’s Method Based on the factorization of a polynomial The generic equation is factored as: For example, the equation: would be factored as:

5 Horner’s Method Algorithm result = a[n] for i = n - 1 down to 0 do result = result * x result = result + a[i] end for return result

6 Analysis The for loop is done N times –There is one multiplication in the loop –There is one addition in the loop There are a total of –N multiplications –N additions Saves N – 1 multiplications over the standard algorithm

7 Preprocessed Coefficients Uses a factorization of a polynomial based on polynomials of about half the original polynomial’s degree For example, where the standard algorithm would do 255 multiplications to calculate x 256, we could square x and then square the result seven more times to get the same result

8 Preprocessed Coefficients Used with polynomials that are monic (a n =1) and have a highest power that is one less than a power of 2 If the polynomial has highest power that is 2 k – 1, we can factor it as: where j = 2 k -1

9 Preprocessed Coefficients If we choose b so that it is a j-1 – 1, q(x) and r(x) will both be monic, and so the process can be recursively applied to them as well

10 Preprocessed Coefficients Example For the example equation of: because the highest degree is 3 = 2 2 –1, j would be 2 1 = 2, and b would have a value of a 1 – 1 = 6 This makes one factor x 2 + 6, and we divide p(x) by this polynomial to find q(x) and r(x)

11 Preprocessed Coefficients Example The division is: which gives

12 Analysis We analyze preprocessed coefficients by developing recurrence relations for the number of multiplications and additions In the factorization, we break the polynomial up into two smaller polynomials and do one additional multiplication and two additional additions

13 Analysis Because we required that N = 2 k – 1, we get: M(1) = 0A(1) = 0 M(k) = 2M(k–1) + 1A(k) = 2A(k–1) + 2 Solving these equations gives about N/2 multiplications and (3N – 1)/2 additions We need to include the k – 1 (or lg N) multiplications needed to calculate the series of values x 2, x 4, x 8, …

14 Polynomial Algorithm Comparison For the example polynomial: –Standard algorithm: 5 multiplications and 3 additions –Horner’s method 3 multiplications and 3 additions –Preprocessed coefficients 2 multiplications and 4 additions

15 Polynomial Algorithm Comparison In general, for a polynomial of degree N: –Standard algorithm: 2N – 1 multiplications and N additions –Horner’s method N multiplications and N additions –Preprocessed coefficients N/2 + lg N multiplications and (3N – 1)/2 additions

16 Linear Equations A system of linear equations is a set of N equations in N unknowns: a 11 x 1 + a 12 x 2 + a 13 x 3 + … + a 1N x N = b 1 a 21 x 1 + a 22 x 2 + a a3 x 3 + … + a 2N x N = b 2  a N x 1 + a N2 x 2 + a N3 x 3 + … + a NN x N = b N

17 Linear Equations When these equations are used, the coefficients (a values) are constants and the results (b values) are typically input values We want to determine the x values that satisfy these equations and produce the indicated results

18 Linear Equation Example An example set of linear equations with three unknowns is: 2x 1 – 4x 2 + 6x 3 = 14 6x 1 – 6x 2 + 6x 3 = 24 4x 1 + 2x 2 + 2x 3 = 18

19 Solving Linear Equations One method to determine a solution would be to substitute one equation into another For example, we solve the first equation for x 1 and then substitute this into the rest of the equations This substitution reduces the number of unknowns and equations

20 Solving Linear Equations If we repeat this, we get to one unknown and one equation and can then back up to get the values of the rest If there are many equations, this process can be time consuming, prone to error, and is not easily computerized

21 Gauss-Jordan Method This method is based on the previous idea We store the equation constants in a matrix with N rows and N+1 columns For the example, we would get:

22 Gauss-Jordan Method We perform operations on the rows until we eventually have the identity matrix in the first N columns and then the unknown values will be in the final column: 100x1x1 010x2x2 001x3x3

23 Gauss-Jordan Method On each pass, we pick a new row and divide it by the first element that is not zero We then subtract multiples of this row from all of the others to create all zeros in a column except in this row When we have done this N times, each row will have one value of 1 and the last column will have the unknown values

24 Example Consider the example again: We begin by dividing the first row by 2, and then subtract 6 times it from the second row and 4 times it from the third row

25 Example Now, we divide the second row by 6, and then subtract -2 times it from the first row and 10 times it from the third row

26 Example Now, we divide the third row by 10, and then subtract -1 times it from the first row and -2 times it from the second row

27 Example This gives the result of: And we have that x 1 = 3, x 2 = 1, and x 3 =