Lower bounds for arithmetic problems

Lower bounds for arithmetic problems

Information Processing North-Holland Letters 38 (1991) 83-87 Computer Sciences Department, 26 April 1991 University of Wisconsin - Madison, Madi...

543KB Sizes 0 Downloads 117 Views

Information Processing North-Holland

Letters 38 (1991) 83-87

Computer Sciences Department,

26 April 1991

University of Wisconsin

-

Madison, Madison,

WI 53706, USA

Communicated by M.J. Atallah Received 9 November 1990 Revised 2 January 1991

Keywords:

Computational

complexity,

lower bounds,

primality

Recently, Mansour, Schieber, and Tiwari devised a method to obtain nontrivial lower bounds in models of computation involving the floor operation (see [6,7]). Here we remark that their techniques can be used to show the lower bounds in Table 1. All lower bounds are on the number of operations necessary in the worst case for n-bit integer inputs. The operations allowed are +, -, *, /7 -c , 1. ] and the modei of computation used is the computation tree, although the bounds hold also for the random access machine (RAM) model. For precise definitions of these models, see [6,7] (computation tree), and [8,1] (RAM). It should be mentioned that a!1 the constants that appear in the trees T, that solve the problem for n-bit inputs have to be bounded by so,me absolute constant C. For the RAM model, which is “uniform”, this restriction is automatically satisfied since there is only a finite number of constants in a finite program. The constants implicit in the “a” notation depend on C. The operation symbol “/” stands for exact division, e.g., 6/4 is 1.5.

testing

e problems Let us define precisely the problems we are dealing with. In the sequel, an n-bit integer is an integer k such that 1 < k -C 2”. Primality testing (PT) is the problem of determining whether a given n-bit integer is prime or not. Modular exponentiation (ME) is the problem of computing Gh mod ?;y!for a!! u-bit integers a, b, m with m > 0. Finally, Jacobi symbol (JS) is the problem of computing the Jacobi symbol Jac( a, b) (defined in Section 3) for all n-bit integers a, b with b odd, b > 1, and gcd(a, b) = 1. The technique developed by Mansour, Schieber, and Tiwari can be applied directly only to decision problems, that is, problems that have only two possible outputs, as is the case of PT and JS (see Section 3). For modular exponentiation, we prove the lower bound for the following problem, and then reduce it to ME.

Table 1 Results for n-bit integer inputs Problem * Sponsored by the NSF (grant DCR-8552596) and by FAPESP, BRAZIL (grant 87/0197-2). ** Permanent address: DCC - IMECC - UNICAMP. Cx. Postal 6065, 13081 - Campinas

0020-0190/91/$03.50

~~

Lower bound

Primal&y testing

q/G)

Modular exponentiation

q/G)

Jacobi symbol

s2(log log n)

- SP, Brazil.

0 1991 - Elsevier Science Publishers

B.V. (North-

83

Volume 38. Number 2

26 April 1991

INFORMATION PROCESSING LEITERS

eudoprime to the base 2 (PSP2) ‘. &ckk if -I mod a = 1 or not, for an n-bit integer a.

and PSP2 are one-input probNotice that lems, whereas JS needs two inputs. Since there are a few differences in the way a problem is t according to the number of inputs, we will a each case separately.

In this section we obtain the Q(dG) lower bound for the single-input problems mentioned earlier. We start by recalling some number-t results. The first one depends on standard estimates on the distribution of prime numbers, for which [9] is a good reference. The second one is a consequence of Linnik’s work (see [5,2]). Fin the last one is a celebrated theorem of Fe

PI). . Fur any prime

integer X >, 3. let q = q(X) be not dividing A. Then q < X and

24 < A’. (Least prime in an arithmetic progresere is an absolute constatst c > 1 such that for all integers m, r,s with IPI,S> 1 and gcd(r, m) = 1, the least prime .wJution p to

nction otherwise. Of course, f is reducible to PT. We will show that f is 2n/(4c)_invariant, where c is the constant in a 2. If 1 < X < 2n(4c), we know that n is at Le se a0 = 2 and a, = 3. least 4. For X = 1, just c These are 4-bit integers For A >, 2, Lemma 2 guarantees the existence of a prime p satisfying p= I (mod A),

p > s,

oosea,=p-landa,= P2 - 1. It is clear that X divides both numbers and f (a,,) = 1 f 0 = f( ai). On the other hand, we also have

satisfies p < (ms )‘.

a0
p = r (mod ??I),

3 (Fermat). If p is integer not divisible by p, then

rime and a is an

lete our prerequisites, we state a theorem on single input progra be the j-1 N-, (II )-invariant if for

This shows that f is actually 2”/(4’)-invariant, Theorem 4 gives an

lower bound for the computation e same bound for PT. 2.2. Lower bomd fw ME

’ The mostcommon definition of the term pseudoprimein the

literature is: k is a pseudoprime to the base b if k is not prim ~4 6” - ’ s 1 (mod k). Notice that we use this term in a slightly different sense. 84

g(x)

=

1 0

if 2”= 1 (mod x+ l), otherwise.

and

of f, which

Volume 38, Number 2

INFORMATION PROCESSING LETT-ERS

Of course, g is reducible to PSP2. We will show at g is 2n/“3’ +*)-invariant, where c is the constant in Lemma 2. If 1 < X K 2”/(3”+ I), we again know that r? is at least 4. For X $2, just choose a, = 8 and a, = 10. These are 4-bit multiples of X with g(a,) = 0 f 1 = g( a, ). For A 2 3, take a0 =p, - 1, where p, is the Ieast prime satisfying

26 April 1991

two relatively prime integers a, h with h odd and greater than 1, characterized by the following properties: If b is prime, / Jac( u, b) =

1 - 1

p, = 1 (mod A), 91 ’ 2. We know that 2 and &a,)= that X divides Now let 4 and pz be the -Yi+q-’ _

a, < p1 < (2X)’ < AzC’from Lemma 1 by Fermat’s theorem. It is clear a(). be the least prime not dividing X least prime such that

(mod A),

p:! > 2”,

where q- ’ is the inverse of 4 modulo A, which exists because gcd( A, q) = 1. We are under the hypotheses of Lemma 2 here, so the existence of such a prime p2 is guaranteed. Choose a, = p2q 1. Notice that X divides a,, since p2q = 1 (mod A). We claim that g( a,) = 0. In fact, if 2p24- * = E (mod pzq) we would have 24=2p24=2

(mod pz)

(where the first equivalence comes from Fermat’s theorem), contradicting pz > 24. To see that a, and a, are n-bit integers, use Lemma 1 and Lemma 2 to get a,
if a is a quadratic residue mod b, if a is a quadratic nonresidue mod 6.

If b, and b, are odd integers (not necessarily rime),

Jac(a, b,b,) = Jac( a, b,)Jac( u, b2). In their paper [6], Mansour, Schieber, and Tiwari prove an Q(log log t?) lower bound for the computation of the gcd of two rr-bit integers, using the computation tree model. The Jacobi symbol, when restricted to arguments which are congruent to 1 modulo 4, has two properties very similar to the gcd, namely Jac( a mod b, b) = Jac( a, b), and Jac(n.

b) = Jac(b,

a)

(the first one can be verified from the definitions; the second is a special case of the quadratic reciprocity law; see [4, pp. 56-571). It turns out that these two properties suffice to make the proofs in [6] work, with a few minor modificaticns. To explain these modifications, we will assume that the reader is familiar with the results and notation of [6]. However, for convenience, we will quote below the definitions and results directly affected by our changes. We basically have to modify statements that explicitly mention the gcd, obtaining similar results that hold for trees which solve JS. Lemmas 9 and 10 of [6], which we reproduce below, are the ones that require some doctoring. The notation from [6] is used. . Let a,. cxz, cy3and t be positioe integers such that CY,-Ct, and cx2. cx3< 2’. Then the set

In this section we study the computation of the Jacobi symbol, which is a function Jac(a, b) of

S(0, Q11,a27 a3) n ((u,

0): 0 < Lf,u < 22r(‘+‘))

SS

INFORMATION

Volume 38. Number 2

PROCESSING

contains two pairs ( a,, a,) and (b,, b, ), such that gcd( a,, a,) # 1 and gcd(b,, b,) = 1.

gcd(u, u) = 1, and v> l>This is only to make sure that the pairs belong to the domain of Jac. Finally, of course we want Jacf a,, a,) = - 1 and Jac( b,, b,) = 1 instead of gcd(a,, a,) f 1 and gcd(b,,, b,) = 1. For the proof, the new pairs are defined as follows. Take a, = 6, = (1 + (Y$ where e is the least integer such that (1 + (Y~)~> ayz, and then put a, = .= + a, - aI= + 2a,“l+ 5x3,

where z is any integer between 1 and a, such that Jac( z, a,) = - 1. It is easy to verify that indeed Jac( aO, a,) = Jac( z, a,) = - 1 and Jac(b,, b,) = Jac(1, 6,) = 1. The fact that the pairs belong to the set described above is also straightforward, but we will omit the proof here since it requires the definition of S(0, CY,,(Y?,Q[~). Now we turn our attention to Lemma 10 of [6]. Let T be a decision tree of depth h that decides if a and b are relatively prime, “for all integers 2” > a > b > 0. Then, there is a path 9 from the root of T to a leaf, and a subset 9 of inputs, with the following properties: (1) 9’= S(r, q, cx2, cx3, A, 4) n {(a, b): 0 < a,b < 22’(t+‘), a,b odd, gcd( a, b) = 1, and b ) 7 }, for some positive where A = (a,, 8,, . . , ,a,.), aiid ir?i~~C.Y.Y

A

ZY...,

r,

d,,

s2,

a?,

8,.

a,,...,

h

:‘=‘;I,,. A,, . . . ,Xr ). (2) For each input ( a, b) E .Y’, the computation follows the path 9. (3) For each computation vertex u on the path 9, there is a pair af bivariate polynomials ( e.( X, y ), 86

b) =&(u,

v)/G,(u,

v),

where (u, v) is the (r, q, (uz, (Ye, A, A )-generator of (a, 6); i.e., the value computed at v on input ( a, b) E 9, is the value of the rational function I;l,(-x, _v),/G,(x, y) at (u, v). (4) Let ,Z= { F,(x, y)/G,,(x, y): v ~9). Define D and M to be the degree and the height of E, respectively. TIzen, r ~~5, max{ ar,, D 1 < 224h, and max{ ar2, (Ye, M } < 2’- _

n ((U, “): 0 < u,u -c 22r(r+? u,u odd,

g'

26 April lW1

G,,(x, y )) with integer coefficients, such that .for each input (a, 6) E 9, G,( u, v) + 0, and fy(a,

Our changes to this lemma are as follows. First, add the statement “a3 is a multiple of 4” to the hypotheses. Second, the set becoms

LETTERS

The changes here are as follows. The first sentence becomes “Let T be a computation tree of depth h that computes Jac( a, b) for all odd, relatively prime integers a, b with 2” > a > b > l”, again because we ought to make sure (a, b) belongs to the domain of Jac. The other modification is in the first property, which should also say that the integer f.x3can be forced to be a multiple of 4. This is achieved simply by taking (Y\~)= 4 in the base case of the inductive proof of Lemma 10 in [6]. The nature of the proof is such that subsequent a:i, will always be multiples of ai2!, resulting in an (Yewhich is a multiple of 4. The bound for a3 stated in the last property remains valid even after these modifications. With the lemmas altered as above, we can prove an J’i(log log n) lower bound for solving JS by computation trees. The same bound for RAMS is obtained using the methods of [7].

I would like to thank my adviser, Eric Bach, for suggesting the problem, providing references, and for the constant encouragement and help ever since my early years as a graduate student at UW-Madison. I am also grateful to Anne Condon for valuable comments on the draft, to the anonymous referees for their careful review and insightful suggestions, and to Prasoon Tiwari for copies of [6,7], for many fruitful discussions, and for his inestimable assistance on the preparation of the final manuscript.

Volume 38, Number 2

INFORMATION

PROCESSING LETTERS

A.V. Aho. J.E. Hopcroft and J.D. Ullman, ;Ilr,eDesign and Anatjsis of Computer Algorithms (Addison-Wesley, Reading, MA, 1974). PI S. Graham, On Linnik’s constant, Acta Art& 39 (1981) 163-179. 131 G.H. Hardy and E.M. Wright, An Introduction to the Theov of IVumbers (Oxford Univ. Press, Oxford, 1979). [41 K. Ireland and M. Rosen, A CIassical Introduction to Modern .Vumher Theory. Graduate Texts in Mathematics 84 (Springer. Berlin, 1982). 151 U.V. Linnik. On the least prime in an arithmetic progression, Mat. Sh. 15 (1944) 139-178. WI Y. Mansour, B. Schieber and P. Tiwari, A lower bound for integer greatest common divisor computations, Tech. Rept.

26 April 1991

TR 14272. IBM T.J. Watson Research Center. Yorktown Heights, NY, December 1988; to appear in J. ACM; preliminary version in: Proc. 29th IEEE sump. on Foundations of Computer Science (1988) 54-63. [71 Y. Mansour, B. Schieber and P. Tiwari, Lower bounds for computations with the floor operation, SIAM J. Comput. 20 (2) (1991). to appear; preliminary version in: froc. 16th Internat. Coil. on Automata, Languages, and Programming, Lecture Notes in Computer Science 372 (Springer, Berlin, 1989) 559-573. [8] W. Paul and J. Simon, Decisron Trees and Random Access Machines, Monographies de 1’Enseignement ltiathP.natique 30 (Enseignement Math., Geneva, 1981) 331-340. [9] J.B. Rosset and L. Schoenfeld, Approximate formulas for some functions of prime numbers, Illinois J. Muth. 6 (1962) 64-94.

87