Journal of Mathematical Research with Applications Jan., 017, Vol. 37, No. 1, pp. 90 96 DOI:10.3770/j.issn:095-651.017.01.008 Http://jmre.dlut.edu.cn Application of Polynomial Interpolation in the Chinese Remainder Problem Tianxiao HE 1,, Scott MACDONALD, Peter J.-S. SHIUE 3 1. Department of Mathematics, Illinois Wesleyan University, Bloomington, Illinois 6170, USA;. Math Learning Center, University of Nevada, Las Vegas, Las Vegas, Nevada, 89154-1099, USA; 3. Department of Mathematical Sciences, University of Nevada, Las Vegas, Las Vegas, Nevada, 89154-400, USA Dedicated to Professor Renhong WANG on the Occasion of His Eightieth Birthday Abstract This paper presents an application of polynomial interpolation in the solution of the Chinese Remainder Problem for bother integers and polynomials. Keywords Chinese Remainder problem; Chinese Remainder theorem; Lagrange interpolation; Newton interpolation MR(010) Subject Classification 11A07; 65B10; 11A41; 33C45; 39A70; 41A80 1. Introduction For given integers a i (1 i n) and positive integers m i (1 i n) that are pairwise relatively prime, the Chinese Remainder Problem (CRP) for integers may be stated as follows: Find an integer m satisfying the congruences m a i (mod m i ), i = 1,,..., n. (1) Note that if we have found one solution x, then all solutions of (1) belong to its residue class modulo M = m 1 m... m n. This result is known as the Chinese Remainder Theorem (CRT) for integers. There are numerous results on the solution of CRP, for instance, see Andrews [1], Grosswald [], Nagasaka, Shiue, and Ho [3], etc. Particularly, an interpolation approach to the solutions can be found in Stewart [4] and surveyed in Schoenberg [5]. In this paper, we will view the solution of a CRP shown in (1) equivalently to a Lagrange interpolation or Newton interpolation, which can be used to extend the CRP for integers to the CRP for polynomials.. Main results Received August 5, 016; Accepted September 3, 016 This work was completed while the third author is on sabbatical leave from University of Nevada, Las Vegas, and the author would like to thank UNLV for its support. * Corresponding author E-mail address: the@iwu.edu (Tianxiao HE); scott.macdonald@unlv.edu (Scott MACDONALD); shiue@unlv.nev ada.edu (Peter J.-S. SHIUE)
Application of polynomial interpolation in the Chinese Remainder problem 91 We now establish the following theorem on the CRP for polynomials and view them as interpolation problems. Theorem.1 Let F be a field, and let a 1 (x), a (x),..., a n (x) be arbitrary polynomials and m 1 (x), m (x),..., m n (x) pairwise relatively prime polynomials in F [x]. unique polynomial f(x) such that and deg f(x) < deg M(x), where M(x) = Π n i=1 m i(x). Then there exists a f(x) a i (x) (mod m i (x)), i = 1,,..., () Proof Since gcd(m i (x), m j (x)) = 1 for all i j, m i (x) is relatively prime to Then we can solve p i (x) := M(x) m i (x). h i (x)m i (x) + k i (x)p i (x) = 1 for h i (x) and k i (x). Therefore, k i (x)p i (x) satisfies or equivalently, k i (x)p i (x) 0 (mod m j (x)) for all j i, k i (x)p i (x) 1 (mod m i (x)), k i (x)p i (x) δ i,j (mod m j (x)), (3) where δ is the Kronecker symbol. We can use {k i (x)p i (x)} n i=1 as the Lagrange interpolation basis and construct f(x) as f(x) = n a i (x)k i (x)p i (x). (4) i=1 Note that if deg f(x) deg M(x), then we can use the division algorithm to replace f(x) by r(x) = f(x) q(x)m(x). Remark. A constructive proof of Theorem.1 can be found in Schroeder [6] and Bach and Shallit [7]. The proof of Theorem.1 gives the following algorithm based on Lagrange interpolation to solve CRP (): (i) Set M(x) = m 1 (x)m (x) m n (x); (ii) Solve k i (x)p i (x) 1 (mod m i (x)), where p i (x) = M(x)/m i (x); and (iii) Write the solution of () as (4). Example.3 As an example, we consider the CRP (A): f(x) 3 (mod x 1), f(x) (mod x ), f(x) 1 (mod x 3). First, M(x) = (x 1)(x )(x 3). Then we solve k 1 (x) from k 1 (x) M(x) 1 (mod x 1), (x 1)
9 Tianxiao HE, Scott MACDONALD and Peter J.-S. SHIUE or equivalently, for some polynomial h i (x) F [x]. Since k 1 (x)(x )(x 3) + h 1 (x)(x 1) = 1 (x )(x 3) = (x 4)(x 1) +, we have 1 (x )(x 3) 1 (x 4)(x 1) = 1, which implies k 1 (x) = 1/. Similarly, from we solve k (x) M(x) (x ) 1 (mod x ), k 3(x) M(x) 1 (mod x 3), (x 3) k (x) = 1, k 3 (x) = 1, respectively. Finally, we obtain the solution of () f(x) = 3 1 (x )(x 3) (x 1)(x 3) 1 (x 1)(x ) = x + x +. It is obvious that the above algorithm based on Lagrange interpolation becomes inconvenient if an extra congruence relation were included in the set of congruences that f(x) must satisfy. The reason is that all k i (x) (i = 1,,..., n) have to be recalculated. To overcome the difficulty, we present the second method, an algorithm based on Newton interpolation, which will give an equivalent result obtained from the first method and allow to add in one more term in f(x) for an extra congruence relation. by Denote by f[x j, x j+1,..., x k ] the divided difference of f at knots {x j, x j+1,..., x k } defined f[x j, x j+1,..., x k ] := f[x j+1, x j+,..., x k ] f[x j, x j+1,..., x k 1 ] x k x j and f[x j ] = f(x j ) (1 j < k n). Then by denoting x 1 = 1, x =, and x 3 = 3, the solution of CRP (A) can be written as f(x) = f[x 1 ] + f[x 1, x ](x x 1 ) + f[x 1, x, x 3 ](x x 1 )(x x ), (5) where the divided difference can be found in the following chart: Thus x 1 = 1 f[x 1] = 3 x = f[x ] = f[x 1, x ] = 3 = 1 1 x 3 = 3 f[x 3] = 1 f[x, x 3] = 1 = 3 f[x1, x, x3] = f[x,x 3 ] f[x 1,x ] 3 x 3 x 1 = 1 f(x) = f[x 1 ] + f[x 1, x ](x x 1 ) + f[x 1, x, x 3 ](x x 1 )(x x ) = 3 + ( 1)(x 1) + ( 1)(x 1)(x ) = x + x +. (6) Remark.4 We now compare Newton interpolation and Lagrange interpolation in the solution of CRP (A). For the view of Lagrange interpolation, we write CRP (A) as finding f(x) so that f(x) 3 (mod x 1),
Application of polynomial interpolation in the Chinese Remainder problem 93 f(x) (mod x ), f(x) 1 (mod x 3), which is equivalent to the interpolation problem of finding f(x) so that f(x i ) = y i, where x 0 = 1, x 1 =, x = 3, y 0 = 3, y 1 =, and y = 1. Thus, using Lagrange interpolation, we obtain (x x 1 )(x x ) f(x) = y 0 (x 0 x 1 )(x 0 x ) + y (x x 0 )(x x ) 1 (x 1 x 0 )(x 1 x ) + y (x x 0 )(x x 1 ) (x x 0 )(x x 1 ) = 3 (x )(x 3) (x 1)(x 3) 1 (x 1)(x ) = x + x +. From this example, one may see if an extra congruence relation, say f(x) 1 (mod x 4), is given, then to solve the corresponding CRP using Lagrange interpolation, each term of Lagrange interpolation needs to be reconstructed. solution of the CRP by adding one more term in (5) However, Newton interpolation gives the following f(x) =f[x 1 ] + f[x 1, x ](x x 1 ) + f[x 1, x, x 3 ](x x 1 )(x x )+ f[x 1, x, x 3, x 4 ](x x 1 )(x x )(x x 3 ), where the divided difference can be found from chart (7) by adding in one more row: Thus, x 1 = 1 f[x 1 ] = 3 x = f[x ] = f[x 1, x ] = 1 x 3 = 3 f[x 3] = 1 f[x, x 3] = 3 f[x 1, x, x 3] = 1 x 4 = 4 f[x 4] = 1 f[x 3, x 4] = f[x, x 3, x 4] = 5/ f[x 1, x, x 3, x 4] = 7/6 (7) f(x) =3 + ( 1)(x 1) + ( 1)(x 1)(x ) + 7 (x 1)(x )(x 3) 6 = 7 6 x3 8x + 89 6 x 5. Example.5 To show the convenience of the second method, we assume an extra congruence relation is added in CRP (A) to give the following CRP (B): f(x) 3 (mod x 1), f(x) (mod x ), f(x) 1 (mod x 3), f(x) 5 (mod x). Since the Newton method is independent of the order of the congruence relations, we simply input the extra relation below the congruence relations of CRP (A) and calculate the corresponding divided difference table of CRP (B) as x 1 = 1 f[x 1 ] = 3 x = f[x ] = f[x 1, x ] = 1 x 3 = 3 f[x 3 ] = 1 f[x, x 3 ] = 3 f[x 1, x, x 3 ] = 1 x 4 = 0 f[x 4 ] = 5 f[x 3, x 4 ] = f[x, x 3, x 4 ] = 1 f[x 1, x x 3 x 4 ] = 1
94 Tianxiao HE, Scott MACDONALD and Peter J.-S. SHIUE Thus the solution of CRP (B) is f(x) =f[x 1 ] + f[x 1, x ](x x 1 ) + f[x 1, x, x 3 ](x x 1 )(x x )+ f[x 1, x, x 3, x 4 ](x x 1 )(x x )(x x 3 ) =3 + ( 1)(x 1) + ( 1)(x 1)(x ) + ( 1 (x 1)(x )(x 3) ) = 1 x3 + x 7 x + 5. We now survey the Newton interpolation method for CRP as follows. Theorem.6 Let F be a field, and let {a i } n i=1 F and distinct {b i} n i=1 F. Then there exists a unique polynomial f(x) F [x] with degree < n such that f(b i ) = a i (8) for i = 1,,..., n, which is equivalent to f(x) a i (mod x b i ) (9) for i = 1,,..., n. Proof Denote m i (x) = x b i and a i (x) = a i. Then Theorem.1 guarantees the unique existence of f(x) that satisfies (9). The equivalence between (9) and (8) from the fact that f(x) a i (mod x b i ) is equivalent to f(b i ) = a i for i = 1,,..., n. Besides the convenience to treat extra congruence relations, from the following examples we shall see the computation derived from Theorem.6 is simpler than the method from.1 usually. As an example, one may see Example.7 below. The above example works for linear congruence relations. We now give a general description of the algorithm based on Newton interpolation for arbitrary congruence relations of the CRP (), that is, to find f 1 f 1 (x), f f (x),... successively from the following congruence system: f 1 a 1 (x) (mod m 1 (x)), f 1 + f m 1 a (x) (mod m (x)), f 1 + f m 1 + f 3 m 1 m a 3 (x) (mod m 3 (x)),, f 1 + f m 1 + + f n m 1 m m n 1 a n (x) (mod m n (x)). Then the solution f(x) of CRP () is f(x) = f 1 + f m 1 + + f n m 1 m m n 1. Indeed, for each i = 1,,..., n, f(x) = f 1 + f m 1 + + f i m 1 m m i 1 (mod m i ) = a i (x) (mod m i ), which is from the congruence system.
Application of polynomial interpolation in the Chinese Remainder problem 95 Example.7 Consider the following CRP (C) with nonlinear congruence relations f(x) x 1 (mod x x + 1), f(x) x (mod x 1). Solving the corresponding congruence system: f 1 x 1 (mod x x + 1), f 1 + f (x x + 1) x (mod x 1), we may obtain f 1 (x) = x 1 and f (x) = 1. Thus the solution of CRP (C) is f(x) = x 1 + 1 (x x + 1) = x. Using Theorem.6, we may find f(x) more easily. In fact, from f 1 (x) = x 1, we have x 1 + f (x x + 1) x (mod x 1), or equivalently, 1 + f (x x + 1) 0 (mod x 1), which, from Theorem.6, is equivalent to 1 + f (x x + 1) x=1 = 0. Hence, f (x) = 1 and f(x) = x 1 + (x x + 1) = x. Sometimes, we may find the mixed method derived from Theorems.1 and.6 might be more convenient in solving division problems. We use the following example to demonstrate this mixed method. Example.8 ([8, P.14]) Let p(x) be a polynomial satisfying the conditions that if it is divided by (x ) and x 1, then remainders 56x 4 and 5 are obtained. To find the remainder when p(x) is divided by (x ) (x 1), we denote p(x) = q 1 (x)(x ) + 56x 4, p(x) = q (x)(x 1) + 5 for some q 1 (x) and q (x). Then, we obtain the following CRP: p(x) 56x 4 (mod (x ) ), p(x) 5 (mod x 1). From Theorem.1, we have f 1 (x) 56x 4 (mod (x ) ), f 1 (x) + f (x ) 5 (mod x 1), which implies 56x 4 + f (x ) 5 (mod x 1). From Theorem.6, we have 56 ( 1) (1)(1 4 + f ) = 5,
96 Tianxiao HE, Scott MACDONALD and Peter J.-S. SHIUE which implies f = 76/9 and References p(x) = 56x 4 + 76 9 (x ) = 1 9 (76x + 00x 74). [1] G. E. ANDREWS. Number Theory. Dover Publications, Inc., New York, 1994. [] E. GROSSWALD. Topics from the Theory of Numbers. Reprint of the 1984 second edition. Modern Birkhäuser Classics. Birkhäuser Boston, Inc., Boston, MA, 009. [3] K. NAGASAKA, P. J.-S. SHIUE, C.-W. HO. A Fast Algorithm of the Chinese Remainder Theorem and its Application to Fibonacci Numbers. Kluwer Acad. Publ., Dordrecht, 1991. [4] B. M. STEWART. Theory of Numbers. Second Edition, The Macmillan Co., New York; Collier-Macmillan Ltd., London 1964. [5] I. J. SCHOENBERG. The Chinese remainder problem and polynomial interpolation. College Math. J., 1987, 18(4): 30 3. [6] M. R. SCHROEDER. Number Theory in Science and Communications. Second Enlarged Edition, Springer- Verlag, 1985. [7] E. BACH, J. SHALLIT. Algorithmic Number Theory. Vol. 1. Efficient algorithms. Foundations of Computing Series. MIT Press, Cambridge, MA, 1996. [8] R. S. MILLMAN, P. J. SHIUE, E. B. KAHN. Problems and Proofs in Numbers and Algebra. Springer, Cham, 015.