Some facts about polynomials modulo m (Full proof of the Fingerprinting Theorem)



Similar documents
Zeros of Polynomial Functions

CHAPTER SIX IRREDUCIBILITY AND FACTORIZATION 1. BASIC DIVISIBILITY THEORY

3.2 The Factor Theorem and The Remainder Theorem

Chapter 4, Arithmetic in F [x] Polynomial arithmetic and the division algorithm.

The Factor Theorem and a corollary of the Fundamental Theorem of Algebra

U.C. Berkeley CS276: Cryptography Handout 0.1 Luca Trevisan January, Notes on Algebra

JUST THE MATHS UNIT NUMBER 1.8. ALGEBRA 8 (Polynomials) A.J.Hobson

Copy in your notebook: Add an example of each term with the symbols used in algebra 2 if there are any.

Revised Version of Chapter 23. We learned long ago how to solve linear congruences. ax c (mod m)

SOLVING POLYNOMIAL EQUATIONS

Quotient Rings and Field Extensions

FACTORING POLYNOMIALS IN THE RING OF FORMAL POWER SERIES OVER Z

Continued Fractions and the Euclidean Algorithm

Homework until Test #2

8 Primes and Modular Arithmetic

SUBGROUPS OF CYCLIC GROUPS. 1. Introduction In a group G, we denote the (cyclic) group of powers of some g G by

PYTHAGOREAN TRIPLES KEITH CONRAD

Zero: If P is a polynomial and if c is a number such that P (c) = 0 then c is a zero of P.

Math Review. for the Quantitative Reasoning Measure of the GRE revised General Test

Integer roots of quadratic and cubic polynomials with integer coefficients

The Division Algorithm for Polynomials Handout Monday March 5, 2012

9. POLYNOMIALS. Example 1: The expression a(x) = x 3 4x 2 + 7x 11 is a polynomial in x. The coefficients of a(x) are the numbers 1, 4, 7, 11.

The finite field with 2 elements The simplest finite field is

a 1 x + a 0 =0. (3) ax 2 + bx + c =0. (4)

Zeros of Polynomial Functions

= = 3 4, Now assume that P (k) is true for some fixed k 2. This means that

CHAPTER 5. Number Theory. 1. Integers and Division. Discussion

Notes on Factoring. MA 206 Kurt Bryan

Polynomial and Synthetic Division. Long Division of Polynomials. Example 1. 6x 2 7x 2 x 2) 19x 2 16x 4 6x3 12x 2 7x 2 16x 7x 2 14x. 2x 4.

63. Graph y 1 2 x and y 2 THE FACTOR THEOREM. The Factor Theorem. Consider the polynomial function. P(x) x 2 2x 15.

SECTION 0.6: POLYNOMIAL, RATIONAL, AND ALGEBRAIC EXPRESSIONS

8 Divisibility and prime numbers

Factoring Polynomials

a 11 x 1 + a 12 x a 1n x n = b 1 a 21 x 1 + a 22 x a 2n x n = b 2.

Jacobi s four squares identity Martin Klazar

UNCORRECTED PAGE PROOFS

POLYNOMIAL FUNCTIONS

SECTION 2.5: FINDING ZEROS OF POLYNOMIAL FUNCTIONS

Gröbner Bases and their Applications

GREATEST COMMON DIVISOR

Partial Fractions. (x 1)(x 2 + 1)

Partial Fractions. Combining fractions over a common denominator is a familiar operation from algebra:

2.3. Finding polynomial functions. An Introduction:

Introduction to Finite Fields (cont.)

FACTORING AFTER DEDEKIND

Math 0980 Chapter Objectives. Chapter 1: Introduction to Algebra: The Integers.

minimal polyonomial Example

THE NUMBER OF REPRESENTATIONS OF n OF THE FORM n = x 2 2 y, x > 0, y 0

FACTORING IN QUADRATIC FIELDS. 1. Introduction. This is called a quadratic field and it has degree 2 over Q. Similarly, set

Number Theory. Proof. Suppose otherwise. Then there would be a finite number n of primes, which we may

3.1. RATIONAL EXPRESSIONS

CS 103X: Discrete Structures Homework Assignment 3 Solutions

Determinants can be used to solve a linear system of equations using Cramer s Rule.

Section 4.2: The Division Algorithm and Greatest Common Divisors

Settling a Question about Pythagorean Triples

COLLEGE ALGEBRA. Paul Dawkins

Math 319 Problem Set #3 Solution 21 February 2002

March 29, S4.4 Theorems about Zeros of Polynomial Functions

7. Some irreducible polynomials

A Second Course in Mathematics Concepts for Elementary Teachers: Theory, Problems, and Solutions

Application. Outline. 3-1 Polynomial Functions 3-2 Finding Rational Zeros of. Polynomial. 3-3 Approximating Real Zeros of.

Zeros of a Polynomial Function

DIVISIBILITY AND GREATEST COMMON DIVISORS

Some Polynomial Theorems. John Kennedy Mathematics Department Santa Monica College 1900 Pico Blvd. Santa Monica, CA

Stupid Divisibility Tricks

Discrete Mathematics: Homework 7 solution. Due:

3 Monomial orders and the division algorithm

SOLUTIONS FOR PROBLEM SET 2

HOMEWORK 5 SOLUTIONS. n!f n (1) lim. ln x n! + xn x. 1 = G n 1 (x). (2) k + 1 n. (n 1)!

z 0 and y even had the form

BEGINNING ALGEBRA ACKNOWLEDMENTS

it is easy to see that α = a

Applications of Fermat s Little Theorem and Congruences

Polynomials. Dr. philippe B. laval Kennesaw State University. April 3, 2005

Lecture 6: Finite Fields (PART 3) PART 3: Polynomial Arithmetic. Theoretical Underpinnings of Modern Cryptography

1 Lecture: Integration of rational functions by decomposition

Copyrighted Material. Chapter 1 DEGREE OF A CURVE

The Euclidean Algorithm

Number Theory Hungarian Style. Cameron Byerley s interpretation of Csaba Szabó s lectures

ON THE EMBEDDING OF BIRKHOFF-WITT RINGS IN QUOTIENT FIELDS

Lecture Notes on Polynomials

Lagrange Interpolation is a method of fitting an equation to a set of points that functions well when there are few points given.

If A is divided by B the result is 2/3. If B is divided by C the result is 4/7. What is the result if A is divided by C?

Breaking The Code. Ryan Lowe. Ryan Lowe is currently a Ball State senior with a double major in Computer Science and Mathematics and

Second Order Linear Nonhomogeneous Differential Equations; Method of Undetermined Coefficients. y + p(t) y + q(t) y = g(t), g(t) 0.

PROBLEM SET 6: POLYNOMIALS


4.3 Lagrange Approximation

South Carolina College- and Career-Ready (SCCCR) Algebra 1

Indiana State Core Curriculum Standards updated 2009 Algebra I

CORRELATED TO THE SOUTH CAROLINA COLLEGE AND CAREER-READY FOUNDATIONS IN ALGEBRA

parent ROADMAP MATHEMATICS SUPPORTING YOUR CHILD IN HIGH SCHOOL

Cryptography and Network Security. Prof. D. Mukhopadhyay. Department of Computer Science and Engineering. Indian Institute of Technology, Kharagpur

Alum Rock Elementary Union School District Algebra I Study Guide for Benchmark III

SUNY ECC. ACCUPLACER Preparation Workshop. Algebra Skills

Algebra Unpacked Content For the new Common Core standards that will be effective in all North Carolina schools in the school year.

Unit 6: Polynomials. 1 Polynomial Functions and End Behavior. 2 Polynomials and Linear Factors. 3 Dividing Polynomials

k, then n = p2α 1 1 pα k

RESULTANT AND DISCRIMINANT OF POLYNOMIALS

Pre-Calculus II Factoring and Operations on Polynomials

Transcription:

Some facts about polynomials modulo m (Full proof of the Fingerprinting Theorem) In order to understand the details of the Fingerprinting Theorem on fingerprints of different texts from Chapter 19 of the book Algorithms Unplugged [AU2011], you have to look at polynomials modulo m. For this you need a little patience, and you should not be afraid of a fumbling around with variables, unknowns, integers, and prime numbers. The award in the end is a full proof of the theorem. We have calculated a fingerprint for a text (a 1,..., a n ) (of numbers between 0 and m 1) as follows: (1) (a 1 r n + a 2 r n 1 + + a n 1 r + a n r) mod m. Here r was a number between 1 and m 1. However, r = 0 is also allowed, it only always gives the result 0. Let us look a little more closely at expressions as in (1). Since we don t know in advance which r is to be substituted, we write a symbol x in place of r, a variable. In this way we enter the world of polynomials. Polynomials modulo m Let us look at m = 17 as an example. Then mod-m-polynomials are expressions like 10x 4 + 14x + 2 or x 3 + 2x or x 10 + 7. This means there are powers x 0 = 1, x 1 = x, x 2, x 3, x 4,..., of a symbol x (the variable). Among these powers there is the expression x 0, to be read as 1 and to be omitted when it appears as a factor: 2 x 0 = 2. Instead of x 1 we write x. Such powers of x we can multiply with numbers c between 0 and m 1 to obtain terms cx j. The factor c here is then called a coefficient. We get polynomials by adding arbitrary terms with different powers of x. In order not to get confused we normally order the terms according to falling powers of x, but we may also write 5x + 3x 2 + 1 or 5x + 2x 2 + 1 + x 2 : these are just a different way of writing 3x 2 + 5x + 1. 1

If we are given an expression like 2x 4 3x 3 + 30x 2 + 3 that is not really a polynomial modulo 17, because coefficients that are negative or larger than 16 are illegal, we may just take all numbers modulo 17 to obtain a proper mod-17-polynomial: 2x 4 + 14x 3 + 13x 2 + 3. The general format for a mod-m-polynomial is the following: (2) c n x n + c n 1 x n 1 + + c 2 x 2 + c 1 x + c 0. Here c n,..., c 0 are numbers between 0 and m 1 (endpoints included). 1 It is interesting to note that if one wants to calculate with polynomials there is no need to deal with the x and its powers at all. One just stores the numbers c 0, c 1,..., c n, e. g. in an array C[0..n], and has the complete information. Arithmetic for mod-m-polynomials With mod-m-polynomials we can carry out the arithmetic operations addition, subtraction, and multiplication. This is very easy, if one just applies the standard rules for placing things outside brackets or multiplying out products of sums. With coefficients we always calculate modulo m. Addition: We add two mod-m-polynomials by calculating as if x was just some unknown and collect terms that have the same power of x in them. The coefficients in these terms are added of course modulo m. For example (m = 17): (2x 4 + 3x 3 + 10x + 3) + (3x 5 + 14x 3 + 10x + 4) = 3x 5 + 2x 4 + 3x + 7. (The summand with x 3 disappears, because (3 + 14) mod 17 = 0.) Subtraction: We proceed in a way very similar to addition. For example: (10x 3 + 3x + 2) (x 3 + 2x + 13) = 9x 3 + x + 6. 1 In comparison to (1) the numbering of the terms is reversed and a summand c 0 has been added. 2

We subtract the coefficients that come with the same powers of x, always thinking modulo m. One can avoid subtraction or the use of negative numbers by first replacing coefficient c by m c in the polynomial to be subtracted, and add the resulting polynomial. In the example from above the calculation then runs as follows: (10x 3 + 3x + 2) + (16x 3 + 15x + 4) = 9x 3 + x + 6. A special situation occurs if one subtracts a polynomial from itself: (10x 3 + 3x + 2) (10x 3 + 3x + 2) = (10x 3 + 3x + 2) + (7x 3 + 14x + 15) = 0. The result is a polynomial in which all powers of x have a coefficient that is 0. This polynomial is called the zero polynomial. Although normally one would not really like to deal with such a strange thing that tells us nothing, we will see that the zero polynomial is very special and it is very important for our purpose that we recognize it when it shows up. Multiplication: In order to multiply two polynomials (modulo m) we multiply out and then collect terms with the same power of x. For example: (3) (10x 4 + 3x + 2) (x 3 + 2x + 13) = (10x 7 + 3x 5 + 11x 4 ) + (3x 4 + 6x 2 + 5x) + (2x 3 + 4x + 9) = 10x 7 + 3x 5 + 14x 4 + 2x 3 + 6x 2 + 9x + 9. Is there also a division for polynomials? Yes, but that is a little more complicated. Division: After the result of the multiplication from (3) we will certainly write (always modulo m): (10x 7 + 3x 5 + 14x 4 + 2x 3 + 6x 2 + 9x + 9) : (x 3 + 2x + 13) = 10x 4 + 3x + 2. Somtimes however (well, actually more often than not) it doesn t add up. Just as with ordinary numbers we then do division with remainder. We don t want to run into problems with dividing numbers modulo m, so as divisors we admit only polynomials in which the highest power of x appears with a coefficient of 1. For example, x 10 + 5 is admissible as divisor, but 10x 2 + 3x + 1 is not. The remainder in polynomial division is again a polynomial whose highest power of x is smaller than the highest power of x that occurs in the divisor. 3

Exampe: We have (modulo 17) and so we write (2x + 5) (x 2 + 4) + (2x + 4) = 2x 3 + 5x 2 + 10x + 7, (4) (2x 3 + 5x 2 + 10x + 7) : (x 2 + 4) = (x 2 + 4) with remainder 2x + 4. There is even an algorithm for dividing a polynomial f by a polynomial g, which always calculates the quotient polynomial and the remainder polynomial. We don t need such an algorithm here. All we have to know is that for every polynomial f and every polynomial g that has coefficient 1 with its highest power of x (which of course is at least x 0 ) there is a quotient polynomial q and a remainder polynomial re so that the following equation holds: (5) f = g q + re ; here the highest power of x appearing in re is smaller than the highest power of x in g. For example, in (4) the highest power of x in the remainder x = x 1 is smaller than the highest power of x in the divisor (x 2 ). For our fingerprint application we only need an extremely simple case: Division by polynomials x + s, for s a number. With a little patience you can check that (here: s = 3): That is, 3x 4 + 13x 3 + 5x 2 + 2x + 6 = (3x 3 + 4x 2 + 10x + 6) (x + 3) + 5. (3x 4 + 13x 3 + 5x 2 + 2x + 6) : (x + 3) = 3x 3 + 4x 2 + 10x + 6 with remainder 5. In general it is clear that when dividing by a polynomial x + s the remainder is simply a number. 2 2 The interested reader may want to try and find an algorithm to divide a polynomial c n x n + + c 1 x + c 0 by a polynomial x + s. 4

Substituting into polynomials, roots, factoring out linear factors x r Up to here we only calculated with polynomials as formal expressions, never touching the variable x. Another very important operation with polynomials is substitution. That means, at least in our simple situation, that we replace the x by some number between 0 and m 1 and evaluate to see what the resulting number is. For example, if in the polynomial f = 3x 4 + 13x 3 + 5x 2 + 2x + 1 we substitute the number 2 for x, we get f(2) = (3 2 4 + 13 2 3 + 5 2 2 + 2 2 + 1) mod 17 = 7, if we substitute the number 14 for x, we get and so on. f(14) = (3 14 4 + 13 14 3 + 5 14 2 + 2 14 + 1) mod 17 = 0, If f(r) = 0 we call r a root of f. Thus, r = 14 is a root of f = 3x 4 + 13x 3 + 5x 2 + 2x + 1. Now we divide f by x 14 = x + 3 (viewed modulo 17) and note: (3x 4 + 13x 3 + 5x 2 + 2x + 1) : (x + 3) = 3x 3 + 4x 2 + 10x + 6. There is no remainder in the division! We can try more examples with dividing polynomials by x r, where r is a root, and will always find that there is no remainder. Here s the general fact, and because it is very important for us, we prove it. Theorem 1 For polynomials modulo m, for a number m 2, we have: if r is a root of the polynomial f, then division of f by x r ( = x + (m r)) yields remainder 0. This means: It is possible to write f = (x r) q, for some (quotient) polynomial q. 5

Proof : We can certainly divide f by x r, with remainder, that is, we can write: f = q (x r) + re. Here re is a number between 0 and m 1, and q is a polynomial. Now we substitute r for x on both sides. Because r is a root of f, we get: 0 = f(r) = q(r) (r r) + re = re. Since the remainder re is 0, we get f = q (x r), and Theorem 1 is proved. One can put Theorem 1 as follows: If r is a root of f, one can factor out the factor x r from f. The next theorem says that if m is a prime number this can be done with several roots of a polynomial one after the other. The proof is a little more tricky. Theorem 2 Consider polynomials modulo m, for a prime number m 2. If k 1 and r 1,..., r k are different roots of f between 0 and m 1, then it is possible to write for some polynomial h. f = (x r 1 ) (x r 2 ) (x r k ) h, Proof : Let us first consider the case where f has two different roots r und t. By Theorem 1 we can write f = q (x r). Since t is a root of f, we have (modulo m): 0 = f(t) = q(t) (t r). This means: The number q(t) (t r), calculated with integer arithmetic (without taking remainders modulo m), is divisible by m. Because t and r are different numbers between 0 and m 1, the number t r is not divisible by m. Now it is a well known basic fact about prime numbers m that from m is a divisor of a b 6

it follows that m must divide a or b (or both) 3. This gets us that m divides q(t) (in the integers). Viewed modulo m this means that q(t) = 0. Thus t is a root of the quotient polynomial q. We apply Theorem 1 once again and write q = p (x t) for a suitable polynomial p. Thus we get that f = p (x t) (x r), as desired. Example: For m = 17 and (6) f = x 4 + 16x 3 + x 2 + 14x + 11 we have that f(2) = f(16) = 0 and that f = (x 2) (x 16) (x 2 + 3) = (x + 15) (x + 1) (x 2 + 3). If f happens to have more than two roots, one can proceed along the same pattern and keep factoring out linear factors, until the desired representation f = (x r 1 ) (x r 2 ) (x r k ) h is obtained. (Formally, one uses induction on k.) Now we can formulate and prove the statement we need for our purposes. Theorem 3 Consider polynomials modulo m, for a prime number m 2. If f is a polynomial that is not the zero polynomial, and x n is the highest power of x that occurs in f (with a coefficient c n 0), then f has no more than n distinct roots between 0 and m 1. Examples: (Always modulo 17.) The polynomial 2x + 11 has one root, which is 3; the polynomial 2x 2 + 7x + 12 has two roots, which are 2 and 3; the polynomial x 4 + 16x 3 + x 2 + 14x + 11 from (6) cannot have more than four roots (actually, there are only two roots: 2 and 16). Proof of Theorem 3: We take any k distinct roots of f and call them r 1,..., r k. The aim is to show that k cannot be larger than n. By Theorem 2 we can write: (7) f = (x r 1 ) (x r 2 ) (x r k ) h. 3 For numbers m that are not prime this is not necessarily so: the number 6 divides 4 9 = 36, but 6 divides neither 4 nor 9. 7

Here h cannot be the zero polynomial, since otherwise f would be the zero polynomial. In h there is a highest power of x, dx l, say, with d 0, l 0. Now if we multiply out the right hand side of (7) we obtain the power x k+l, with factor d as well, and there is no other term in the product with a larger power of x. Since x n is the highest power of x in f with a nonzero coefficient, we must have n = k + l k, as desired. Polynomials and fingerprints After these preparations we can finally prove the fingerprinting theorem from [AU2011]. Fingerprinting Theorem If T A and T B are different texts of length n, and if m is a prime number that is larger than the largest number occurring in T A and T B, then at most n out of the m pairs of numbers can consist of two equal numbers. FP(T A, r), FP(T B, r), 0 r < m, Proof : We look at two texts (that is to say: sequences of numbers) T A = (a 1,..., a n ) and T B = (b 1,..., b n ). The numbers a 1,..., a n, b 1,..., b n are between 0 and m 1. From these texts we form two polynomials: f A = a 1 x n + + a n x and f B = b 1 x n + + b n x, and the polynomial g obtained from f A and f B by subtraction modulo m: g = f A f B = (a 1 b 1 ) x n + + (a n b n ) x. Now if T A and T B are different texts, then (also if we look at the numbers modulo m) at least one of the coefficients (a i b i ) in g is not zero, hence g is not the zero polynomial. Obviously, in g no power of x with an exponent larger than n can occur. (Note that x n need not occur, since we could have 8

a n = b n. It very much depends on the texts what g looks like. Maybe it has only one nonzero term.) Now, obviously, FP(T A, r) = f A (r) and FP(T B, r) = f B (r). So if the fingerprints FP(T A, r) and FP(T B, r) are equal, then f A (r) = f B (r), hence g(r) = 0 and this means that r is a root of g. By Theorem 3 the polynomial g cannot have more than n roots. Hence there are no more than n numbers r with FP(T A, r) = FP(T B, r), and hence the Fingerprinting Theorem is proved. Literatur [AU2011] Vöcking, B., Alt, H., Dietzfelbinger, M., Reischuk, R., Scheideler, C., Vollmer, H., Wagner, D. (Eds.), Algorithms Unplugged, Springer- Verlag, 2011, ISBN: 978-3-642-15327-3. c Martin Dietzfelbinger 2011 9