Richard Fateman CS 282 Lecture 71 Polynomial Division, Remainder,GCD Lecture 7.

Slides:



Advertisements
Similar presentations
Richard Fateman CS 282 Lecture eea1 Extended Euclidean Algorithm Lecture eea.
Advertisements

Dividing Polynomials.
Polynomials Functions Review (2)
5-4 Dividing Polynomials Long Division Today’s Objective: I can divide polynomials.
Slide Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
Richard Fateman CS 282 Lecture 81 Evaluation/Interpolation Lecture 8.
Richard Fateman CS 282 Lecture 21 Basic Domains of Interest used in Computer Algebra Systems Lecture 2.
Richard Fateman CS 282 Lecture 31 Operations, representations Lecture 3.
Polynomial Division, Remainder,GCD
Richard Fateman CS 282 Lecture 111 Determinants Lecture 11.
Dividing Polynomials Section 2.4. Objectives Divide two polynomials using either long division or synthetic division. Use the Factor Theorem to show that.
Richard Fateman CS 282 Lecture 31 Operations, representations Lecture 3.
Richard Fateman CS 282 Lecture 61 Evaluation/Interpolation (I) Lecture 6.
EXAMPLE 1 Use polynomial long division
C. Higher Functions Pre-Calculus 30.
Dividing Polynomials; Remainder and Factor Theorems.
The Remainder and Factor Theorems Check for Understanding 2.3 – Factor polynomials using a variety of methods including the factor theorem, synthetic division,
Quiz 2 key.
Fractions Chapter Simplifying Fractions Restrictions Remember that you cannot divide by zero. You must restrict the variable by excluding any.
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.
CPSC 3730 Cryptography and Network Security
Synthetic Division. This method is used to divide polynomials, one of which is a binomial of degree one.
Warm Up #1 1. Use synthetic substitution to evaluate f (x) = x3 + x2 – 3x – 10 when x = – ANSWER –4.
Advanced Algebraic Algorithms on Integers and Polynomials Prepared by John Reif, Ph.D. Analysis of Algorithms.
10-6 Dividing Polynomials Warm Up Warm Up Lesson Presentation Lesson Presentation California Standards California StandardsPreview.
Real Zeros of Polynomial Functions
5.4 – Apply the Remainder and Factor Theorems Divide 247 / / 8.
Polynomial Division and the Remainder Theorem Section 9.4.
Lesson 2.3 Real Zeros of Polynomials. The Division Algorithm.
6.5 The Remainder and Factor Theorems p. 352 How do you divide polynomials? What is the remainder theorem? What is the difference between synthetic substitution.
1 What we will learn today…  How to divide polynomials and relate the result to the remainder and factor theorems  How to use polynomial division.
Chapter 4 – Finite Fields
Data Security and Encryption (CSE348) 1. Lecture # 12 2.
Information Security Lab. Dept. of Computer Engineering 87/121 PART I Symmetric Ciphers CHAPTER 4 Finite Fields 4.1 Groups, Rings, and Fields 4.2 Modular.
The Remainder and Factor Theorems 6.5 p When you divide a Polynomial f(x) by a divisor d(x), you get a quotient polynomial q(x) with a remainder.
ACTIVITY 31: Dividing Polynomials (Section 4.2, pp )
6-7 The Division Algorithm & The Remainder Theorem dividend=quotient. divisor + remainder If a polynomial f(x) is divided by x - c, the remainder is the.
1. 2 Polynomial Function A polynomial function is a function of the form where n is a nonnegative integer and each a i (i = 0,1,…, n) is a real number.
12-6 Dividing Polynomials Warm Up Lesson Presentation Lesson Quiz
Dividing Polynomials Section 2.4. Objectives Divide two polynomials using either long division or synthetic division. Use the Factor Theorem to show that.
Graded Warm Up  Complete the graded warm up on your desk by yourself. There should be no talking.
3.3 Polynomial and Synthetic Division. Long Division: Let’s Recall.
5.5 – Dividing Polynomials Divide 247 / / 8.
5-4 Dividing Polynomials Synthetic Division
Cryptography and Network Security Chapter 4 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
Polynomial Synthetic Division
Polynomial Long Division
3.2 Division of Polynomials. Remember this? Synthetic Division 1. The divisor must be a binomial. 2. The divisor must be linear (degree = 1) 3. The.
Page : 1 bfolieq.drw Technical University of Braunschweig IDA: Institute of Computer and Network Engineering  W. Adi 2011 Lecture-5 Mathematical Background:
Number-Theoretic Algorithms
Polynomial Division.
Lecture 4 The Euclidean Algorithm
Dividing Polynomials A review of long division:
Dividing Polynomials.
Section 5.4 – Dividing Polynomials
Mathematical Background: Extension Fields
To divide polynomials using long division.
Aim: How do we divide a polynomial by a binomial?
Polynomial Division, Remainder,GCD
Polynomial Division; The Remainder Theorem and Factor Theorem
Revision on Polynomials
Discrete Math for CS CMPSC 360 LECTURE 12 Last time: Stable matching
Division of Polynomials
Dividing Polynomials.
Cryptology Design Fundamentals
21 = P(x) = Q(x) . (x - r) + P(r) 4.3 The Remainder Theorem
3.1 The Remainder Theorm AND The Factor Theorem.
5.5 Apply the Remainder and Factor Theorems
Mathematical Background: Extension Finite Fields
Presentation transcript:

Richard Fateman CS 282 Lecture 71 Polynomial Division, Remainder,GCD Lecture 7

Richard Fateman CS 282 Lecture 72 Division with remainder, integers p divided by s to yield quotient q and remainder r: 100 divided by 3 p = s*q + r 100 = 3* by some measure r is less than s: 0<r<s

Richard Fateman CS 282 Lecture 73 Division with remainder, polynomials p(x) divided by s(x) to yield quotient q(x) and remainder r(x): p = s*q + r by some measure (degree in x, usually) r<s notice there is an asymmetry if we have several variables..

Richard Fateman CS 282 Lecture 74 Example (this is typeset from Macsyma) quotient, remainder

Richard Fateman CS 282 Lecture 75 Long division: In detail ) x 3 +3x 2 +3x+1x+1 x 2 x 3 + x 2 2x 2 +3x + 2x 2x 2 +2x x+1 +1 x+1 0

Richard Fateman CS 282 Lecture 76 That was lucky: Divisible AND we could represent quotient and remainder over Z[x]. Consider this minor variation -- the divisor is not monic (coefficient 1) : 2x+1 instead of x+1. This calculation needs Q[x] to allow us to do the division...

Richard Fateman CS 282 Lecture 77 Long division: In detail ) x 3 + 3x 2 + 3x +12x+1 1/2x 2 x 3 + 1/2x 2 5/2x 2 +3x + 5/4x 5/2x 2 +5/4x 7/4x+1 +7/8 7/4x+7/8 1/8

Richard Fateman CS 282 Lecture 78 Macsyma writes it out this way

Richard Fateman CS 282 Lecture 79 In general that denominator gets nasty: 5^4 is 625.

Richard Fateman CS 282 Lecture 710 Symbols (other indeterminates) are worse

Richard Fateman CS 282 Lecture 711 Pseudo-remainder.. Pre-multiplying by power of leading coefficient... a 3 note: we are doing arithmetic in Z[a,b][x] not Q(a,b)[x].

Richard Fateman CS 282 Lecture 712 Order of variables matters too. Consider x 2 +y 2 divided by x+y, main variable x. Quotient is x-y, remainder 2y 2. That is, x 2 +y 2 = (x-y)(x+y) + 2y 2. Now consider main variable y Quotient is y-x, remainder 2x 2. That is, x 2 +y 2 = (-x+y)(x+y) + 2x 2.

Richard Fateman CS 282 Lecture 713 Some activitives (Gröbner Basis reduction) divide by several polynomials P divided by s 1, s 2,... to produce P= q 1 s s (not necessarily unique)

Richard Fateman CS 282 Lecture 714 Euclid’s algorithm (generalized to polynomials): Polynomial remainder sequence P 1, P 2 input polynomials P 3 is remainder of divide(P 1,P 2 ).... P n is remainder of divide(P n-2,P n-1 ) If P n is zero, the GCD is P n-1 At least, an associate of the GCD. It could have some extraneous factor (remember the a 3 ?)

Richard Fateman CS 282 Lecture 715 How bad could this be? (Knuth, vol ) Euclid’s alg. over Q

Richard Fateman CS 282 Lecture 716 Making the denominators disappear by premultiplication.... Euclid’s alg. over Z, using pseudoremainders

Richard Fateman CS 282 Lecture 717 Compute the content of each polynomial Euclid’s alg. over Q. Each coefficient is reduced... not much help. 1 1/9 9/25 50/ /

Richard Fateman CS 282 Lecture 718 Better but costlier, divide by the content Euclid’s alg. over Q, content removed: primitive PRS

Richard Fateman CS 282 Lecture 719 Some Alternatives Do computations over Q, but make each polynomial MONIC, eg. p 2 = x 6 +5/3x (this does not gain much, if anything. recall that in general the leading coefficient will be a polynomial. Carrying around 1/(a 3 +b 3 ) is bad news. Do computations in a finite field (in which case there is no coefficient growth, but the answer may be bogus)

Richard Fateman CS 282 Lecture 720 Sample calculation mod 13 drops some coefficients! x 8 +x 6 -3x 4 -3x 3 -5x 2 +2x-5 3x 6 +5 x 4 -4x 2 +4x-5 -2x 4 +3x x was 585x 2... but 585|13 5x bad result suggests 5x-2 is the gcd, but 5x-2 is not a factor of p 1 or p 2

Richard Fateman CS 282 Lecture 721 This modular approach is actually better than this... In reality, the choice of 13 was easily avoidable, and there are plenty of “lucky” primes which will tell us the GCD is 1

Richard Fateman CS 282 Lecture 722 Another Alternative: the subresultant PRS Do computations where a (guaranteed) divisor not much smaller than the content can be removed at each stage (subresultant PRS) In our example, the subresultant’s last 2 lines are 9326x (actually the subres PRS is usually better; our example was an abnormal remainder sequence)

Richard Fateman CS 282 Lecture 723 The newest thought: Heuristic GCD, the idea is to evaluate In our example, p 1 ( )= p 2 ( )= the integer GCD is 1 Can we conclude that if the GCD is h(x), that h( )=1 ?

Richard Fateman CS 282 Lecture 724 The GCD papers, selected, online in /readings. Recent “reviews” M. Monagan, A. Wittkopf: On the design and implementation of Brown's Algorithm (GCD) over the integers and number fields. Proc. ISSAC 2000 p or the class directory, monagan.pdf P. Liao, R. Fateman: Evaluation of the heuristic polynomial GCD Proc ISSAC 1995 p or this directory, liao.pdf

Richard Fateman CS 282 Lecture 725 The GCD papers, selected, online in /readings. Classics. G.E. Collins: Subresultants and reduced polynomial remainder sequences JACM Jan or this directory, collins.pdf W.S Brown: The Subresultant PRS algorithm ACM TOMS 1978 brown.pdf

Richard Fateman CS 282 Lecture 726 The GCD papers, selected, online in /readings. The sparse GCDs J. Moses and D.Y.Y. Yun The EZ GCD algorithm 1973 Proc. SYMSAC moses-yun.pdf R. Zippel: SPMOD (reference?) text. PhD

Richard Fateman CS 282 Lecture 727 The GCD papers, selected, online in /readings. The sparse GCDs E. Kaltofen Greatest common divisors of polynomials given by straight-line programs JACM kaltofen.pdf