On efficient computation of the coefficients of some polynomials with applications to some enumeration problems

On efficient computation of the coefficients of some polynomials with applications to some enumeration problems

13 June 1981 INFORMATION PROCESSINGLETTERS Volume 12, number 3 I I a-l Fig. 2. are strong enough to solve CH problem. It would be interesting t...

463KB Sizes 1 Downloads 21 Views

13 June 1981

INFORMATION PROCESSINGLETTERS

Volume 12, number 3

I

I

a-l

Fig. 2.

are strong enough to solve CH problem. It would be interesting to establish similar thresholds for some other problems.

6. Appendix

bi

a 3,

a-1 Fig. 3.

ate choice of points a_ iai,bi, Co and POhtS Cl, ....Ck are added to ensure desired input length only.

We will prove that there exists a 6, > 0 such that properties (Pl)-(P3) are t e for InSti, 0 6 i < m. E )befr.xed.Atfirstwe Letiandj(OGi#j< verify the property (P3). Let us evaluate de@‘, a’, ce) where a’ = (ai f a$/2 and b’ = (bi + b#2 (for terminology see Section 4). We have a’ =(-4m+i+j,

1 t(i+j)/2),

b’ = (- 1,2m - 312 + 1/(2(2m - i)) + I /(2(2m - j)) - bd p co = (0,2m - 1).

5. Conclusion

We have just proved that any algorithm for solving the convex hull problem needs some other than linear test functions. In fact, we have shown that our Theorem I is still true even if all the points in the instance form the vertices of a simple polygon (polygon whose boundary is a simple closed curve). It is also known [5] that quadratic test functions 140

We emphasize only the main steps of calculations det(b’, a’, co) = -(l + (i + j)/2 - (2m - 1)) X (2m - 312 + 1/(2(2m - i)) + 1/(2(2m - j)) - 6 & X(4m-(i+j))+(2m-

1)(-4mt(itj))

= (2m - (i + j)/2)(1/(2m - i) t 1/(2m - j) - 26,) -

Volume 12, number 3 =

INFORMATION PROCESSING LETTERS

(2m - j)/(2m - i) + (2m - i)/(2m i j) -&n(4m-(i+j))-

1.

Using a simple identity

we get for 6, = 1/(2sm3): det(b’, a’, ce) = (i - j)*/(2(2m - i) (2m - j)) -

(4m- (i + j))/(2’m3),

.

13 June 1981

a set of points, Techn. Rep. No. SOCS 79.2, McGill University (1979). [ 3) D.P. Dobkin and R.J. Lipton, On the complexity of computations under varying sets of primitives, J. Comput. System Sci. 18 (197!)) 86-91. [4] P. van Emde Boas, On the n(n log n) lower bound for convex hull and max:ial vector determination, Information Processing Lett. 10 (1980) 132-135. (5 ] R.L. Graham, An efficient algorithm for determining the convex hull of a finite planar $;et,Information Processing Lett. 1 (1972) 132-133. [ 6 ] R. Grllnbaum, Convex Polytcpes (Interscience, New York, 1967). 17) A.C. Yao, A lower bound to fmding convex hulls, Rep. STANCS-79-733, Stanford University (1979).

>1/(8m*) - 22m/(2sm3) = 0, and b’ is left to directed line a’ce. The properties (pl) and (P2) may be simply verified. This completes the proof for the existence of 6, > 0 with desired properties.

References [ 1] A.V. Aho, J.E. Hopcroft and J.D. Ullman, The Design and Analysis of Computer Algorithms (Addison-Wesley, Reading, MA, 1976). [ ?] D. Avis, On the complexity of finding the convex hull of

Post scriptum At the tune of revision of this paper the author has received a message from D. Avis considering his note submitted to Inf~wmationProcessingLetters with the reasoning coming to the same effect [8]. In my paper an alternative proof is presented that requires only a basic knowledge cf convex regions and is fully constructive. [8] D. Avis, Comments on a lower bound for convex hull determination, Information Processing Lett. 11 (1980) 126.

141

Volume 12, number 3

INFORMATiON PROCESSING LETTERS

13 June1981

ON EFFICIENT COMPUTATIONOF THE COEFFICIENTS OF SOME POLYNOMIALS WITH APPLICATIONS TO SOME ENUMERATIONPROBLEMS * Albert0 BERTONI and Giancarlo MAURI Istituto di Cibernetica, Universitirdi Milano, Milano, Italy Received May 12 1980; revised version receiveti 3 March 1981

Analysis of algorithms, combinatorial problems, computational complexity

1. Introduction Generating functions [7] are a tool of wide use in combinatorics and for the automatized solution of many combinatorial problems (especially for enumeration problems) it is of great importance to have efficient algorithms for manipulating them. Since in most cases an enumeration problem can be reduced to finding some coefficients in the power series expansion of a suitable generating function [3], we are interested in a general method to efficiently compute the coefficients of a polynomial (intended as the generatkg function of a sequence of numbers). Such a method car. be obtained by generalizing an idea suggested by Shamir [9] to efficiently compute (in time O(log n)) the factorial n!. In the first part of the paper, we describe the method and give some general complexity results. Here, the time complexity of the algorithms is evaluated under the assumption that every arithmetic operation has unitary execution time; thus, the complexity is the number of abstract operations (i.e. arithmetic operations) on abstract data types (i.e. numbers), no matter how they are represented This algebraic complexity measure has been extensively used for algorithms on polynomials [S]; however, a low (polynomial)

* This research has been developed in the frame of the Communication and Programming Project of Universiti dk Milan0 and Honeywell Information Systems, Italy. 142

oO20~19O/sl~on

-OOOO/$O2 SO 0 North-Holland

algebraic complexity does not imply a polynomial complexity on a Turing Machine, since in this case we must take into account also the size of the operands. Then, in Section 4, we show how the method applies to some concrete problems; more precisely, we show that: (a) The first n terms in the sequence generated by a linear finite difference equation with constant coefficients can be computed in O(log n) arithmetic operations each. (b) The number of leftmost derivations of length n of a context free grammar can be computed in time O(log n). (c) The pesmanent of a given n X n matrix A can be computed in time 0(n3). An interesting consequence is that every problem in the class ##P(i.e. solvable by a (non deterministic) counting Turing Machine in polynomial time, see Valian [ 1l]), being polynomialiy reducible to the computation of a permanent , can be solved in polynomial arithmetic time.

2. The model of computation The model we assume is the Random Access Machine (RAM) [ 11,which disposes of registers RO,Rx, .... R,, that can hold integer numbers of arbitrary length, and can execute sequences of instructions (programs) of the following types: (a) L: Ri + Rk l Rh; where * E {+, -, X, I), the set of the usual arithmetic operations on integers. (b) L: If Ri = 0 then Lt else L3.

Vdume 12, number 3

INFORMATION PROCESSING LETTERS

(c) L: Print &; HALT. The semantics of these instructions is rather obvious; furthermore, the RAM must have an indirect addressing facility. We say that a prog-am
3. The main theorems 0ne of the fundamental concepts in combinatorial theory is that of enumeration, ‘0 formalize it, we will defme an enumeration system as a pair ( 9, J ), where 9 is a set of indexes and J = {SJi E 9 ) a family of finite sets indexed by 9. By enumeratio,vproblem we will mean the problem of computing, given an enumeration system ( 9, d ), the associated enumeration finction f : 9 + o, where c3 is the set of natural numbers, defined by f(i) = #Sip the cardinality of the set Si* One of the basic techniques used in combinatorics to deal with enumeration problems is that of generating jkzctions; we shah not attempt to give here a rigorous general definition of generating function; roughly speaking, the generating function of an enumeration function f is a representation of f as an element of some algebra d; typically, for 9 = GI,the generating function associated with f : w + o is a function Pf(x) that can be expanded in the form

13June 1981

to evaluate P(x), in its implicit form, at any point x in polynomial time. Theorem 1. Let Q be any program which evaluates P(x), given x, in at most t steps. Then there is a program Qr’which computes the coefficient pk (0 G k G n) in at most 4t + 5 steps.

To prove the theorem, we prove first the following lemma: Lemma 1. Let t be the arithmetic complexity of any program Q,which evaluates P(x). Then, we have t > log2 n. Proof of Lemma 1. By induction on t, we prove n d

2*, and thus t > log2 n. In fact: (a) For t = 0, we have II = 0; so, 0 = n G 2’ = 1; (b) Let n < 2* and let * be the (t + l)th operation in the evaluation of the polynomial. After executing *, we have evaluated a polynomial of degree n’ < 2n, and we have n’ G 2n < 2 2’ = 2*+‘. l

Proof of Theorem 1. We claim that: Pk =~(p(l))~pk(l))-~?~(~))~pk+'(l))=p(l).

In fact, by induction on k, we prove first that K-l ,g

pj ’

(a)

Pj(1) < Pk(l):

5

pj *Pj(l)=po
0

sincepk>O,(lgkO; k

C pj Pj(l) 0

(b)



=

k-'

Pf(x) = E

f(n) x”,

=

n=O

where the nth coefficient is exactly the value f(n) of the enumeration function f, for any n. So, given a function P(x) which represents, in an implicit form, a polynomial 5&e pkxk of effective degree n (i.e. with pn # O), with integer non-negative coefficients, we are interested in explicitly finding the coefficients. The foliowing theorem says that we can do this in polynomial time, provided that we are able

F

pj Pj( 1) + pk * Pk(l) l


and P(l)(p(p(l))/Pk+‘(l))=pk+r

*P(l)+ l**+pn*Pn-k(l) 143