We consider the logarithmic space counting classes #L, opt-L, and span-L, which are defined analogously to their polynomial time counterparts. We obtain complete functions for these three classes in terms of graphs and finite automata. We show that #L and opt-L are both contained in NC', but that, surprisingly, span-L seems to be a much harder counting class than #L and opt-L. We deinonst,rate that span-Lfunctions can be computed in polynomial time if and onlyif P = NP = PH = P(#P), i.e. iff the class P(#P) and all the classes of the polyiiomial time hierarchy are contained in P. This result follows from the fact that span-L and #P are very similar: span-L C #P, and any function in #P can be represented as a subtraction of two functions in span-L. Nevertheless, #P C span-L would imply NL = P = NP. We furthermore investigate various restrictions of the classes opt-L and span-L, and show, e.g., that if opt-L coincides with one of its restricted versions. then L = NL follows.
Iiit ro duct ioiiDuring the past several years the topic of "counting" appeared in many different settings in complexity theory. In the case of logarithmic space, for example, powerful counting techniques revealed the zntrznszc computational power of various machine models to achieve counting, above all NI,, and LOGCFL (see [la] [26] [3]). On the other hand, counting was used to zncrease the computational power of polyiiomial time machines by defining counting variants of NP, like the function classes opt-P (see [ls]), #P (see I291 [30]) and spaii-P ([17], see also [25] [IS]). These classes have been shown to contain interesting functional counting variants of NP-complete problems. Recently, Toda pointed out tlie enormous power that such classes can have: tlie whole polynomial time hierarchy is contained in P(#P) [27].This raises the question, whether the phenomenon of increasing the computational power by counting is a general one and shows up by logarithmic space classes as well, and if so to what extent, or whether e.g. due to the intrinsic counting power of NL here no more power is gained. Stated alternatively, this question concerns the complexity of functional counting variants of NLcomplete problems. For example, it is well-known that the non-emptiness problem L ( M ) # O? for a given finite automaton M is NL-complete with respect to logarithmic space reductions. This holds irrespectively of whether the automaton Af is deterministic (DFA) [14] or nondeterministic (NFA). Consider the following functional counting variants of this problem: computing the number of words accepted by a DFA or NFA which are smaller than a given word z, the "ranking functions" for DFA or NFA, and the problem of computing the maximal word smaller than or equal to a given word z accepted by a NFA, the "maximal word function" for NFA. How difficult are these functions to compute? Can they, e.g., be computed by a deterministic log space Turing machine with oracle in NL?We show that these functions are, respectively, many-one complete for the three logarithmic spac...