DLOGTIME versus NLOGTIME Frank Vega

To cite this version:

Frank Vega. DLOGTIME versus NLOGTIME. 2015. ￿hal-01132561￿

HAL Id: hal-01132561 https://hal.archives-ouvertes.fr/hal-01132561 Preprint submitted on 17 Mar 2015

HAL is a multi-disciplinary open access ’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. DLOGTIME versus NLOGTIME

Frank Vega

Abstract

The P versus NP problem has become in one of the most interesting and crucial ques- tions for many fields such as computer science, mathematics, biology and others. This outstanding problem consists in knowing the answer of the following incognita: Is P equal to NP? We show a solution of this question in a lower level that would be the answer of DLOGTIME versus NLOGTIME problem. Keywords: DLOGTIME, NLOGTIME, P, NP, MAXIMUM, Turing machine 2000 MSC: 68-XX, 68Qxx, 68Q15

1. Introduction

The P versus NP problem is a major unsolved problem in computer science. This problem was introduced in 1971 by Stephen Cook [1]. It is considered by many to be the most important open problem in the field [2]. The Turing machine has been a useful concept in theory of computing since it was created by Alan Turing in the last century [3]. Since then, it has appeared new defi- nitions related with this concept such as the deterministic or nondeterministic Turing machine. A deterministic Turing machine has only one next action for each step de- fined in its program or transition function [4]. A nondeterministic Turing machine can contain more than one action defined for each step of the program where this program is not a function but a relation [4]. Another huge advance was the definition of a . A language L over an alphabet is any set of strings made of symbols from that alphabet [5]. A

Email address: [email protected] (Frank Vega)

Preprint submitted to Theoretical Computer Science March 16, 2015 complexity class is a set of problems, which are represented as a language, grouped by measures such as the running time, memory, etc [5]. In computational complexity theory, the class P consists of those decision prob- lems (defined as languages) that can be solved on a deterministic Turing machine in an amount of time that is polynomial in the size of the input; the class NP consists of all those decision problems whose positive solutions can be verified in polynomial time given the right information, or equivalently, whose solution can be found in polynomial time on a nondeterministic Turing machine [4]. The set of languages decided by nondeterministic Turing machines within time f is denoted NTIME( f (n)) [6]. In case of languages would be decided by deterministic Turing machines within time f is denoted DT IME( f (n)) [6]. Then, the P =? NP question would be equivalent to DT IME(nk) =? NTIME(nk) where DT IME(nk) = S j k S j j>0 DT IME(n ) and NTIME(n ) = j>0 NTIME(n ) [6]. We pretend to show in the next few pages the solution of DLOGT IME = DT IME(log(n)) versus NLOGT IME = NTIME(log(n)) problem.

2. Theoretical framework

Let’s explain a simple notation that we frequently use in the paper.

Definition 2.1. For any instance I, the notation |I| is the bit-length of I.

The following subsections will help you to understand better this proof.

2.1. The Turing machine model

The argument made by Alan Turing in the twentieth century proves mathematically that for any computer program we can create an equivalent Turing machine [3]. A Turing machine M has a finite set of states and a finite set of symbols called the alphabet of M. The set of states has a special s state which is known as the initial state. The alphabet contains special symbols such as the B start symbol and the $ blank symbol. The operations of a Turing machine are based on a transition function δ which takes the initial state with a string of symbols of the alphabet that is known as the input. Then, it proceeds to reading the symbols on the cells contained in a tape through

2 a head or cursor. At the same time, the symbols on each step are erased and written by the transition function and later moved to the left ←−, right −→ or remained in the same place − for each cell. Finally, this process is interrupted if it halts in a final state: the state of acceptance “yes”, the rejection “no” or halting h [7]. A Turing machine halts if it reaches a final state. If a Turing machine M accepts or rejects a string x, then M(x) = “yes” or “no” is respectively written. If it reaches the halting state h, then we write M(x) = y where the string y is considered as the output string, i.e., the string remaining in M when this halts [7]. A transition function δ is also called the “program” of the Turing machine and is represented as the triple δ(q, σ) = (p, ρ, D). For each q current state and σ current symbol of the alphabet, the Turing machine will go to the next p state, overwrite the σ symbol by ρ and move the cursor in the direction D ∈ {←−, −→, −} [7]. When M is a nondeterministic Turing machine, the program δ is not longer a function, but a relation.

2.2. The MAXIMUM problem Definition 2.2. Given an A array of n (distinct) integer numbers and a x integer, MAXIMUM is the problem of deciding whether x is the maximum number in A.

How many comparisons are necessary to determine when some integer is the maxi- mum of an array of n elements? We can easily obtain a upper bound of n comparisons: examine each element of the array in turn and keep track of the largest element seen so far and finally we compare the final result with x [5]. Is this the best we can do? Yes, since we can obtain a lower bound of n−1 comparisons for the problem of determining the maximum in an array of integers and one final comparison to verify whether that maximum is equal to x or not [5]. Hence, n comparisons are necessary to determine whether an element x is the maximum in A and this naive algorithm for MAXIMUM is optimal with respect to the number of comparisons performed [5].

3. Results

3.1. The BOUNDED-MAXIMUM problem Definition 3.1. Given an A array of n (distinct) positive integer numbers and a x inte- ger where |A| ≤ n2, BOUNDED − MAXIMUM is the problem of deciding whether x

3 is the maximum number in A.

Theorem 3.2. BOUNDED − MAXIMUM < DLOGT IME.

Proof. If the pair A and x belongs to BOUNDED − MAXIMUM, then the maximum bit-length of x should be less than or equal to |A|, because x will be in A. As we see in Definition 2.2, we should use n comparisons to know whether x is the maximum in array of n (distinct) integers and this number of comparisons will be optimal [5]. This would mean we cannot always accept any (A, x) instance of BOUNDED−MAXIMUM in O(log(|A|)) time, because we must use at least n comparisons in many cases and it will not exist a k constant number such that k × log(|A|) > n for every value of n. The reason is |A| ≤ n2, and thus, log(|A|) ≤ log(n2) = 2 × log(n), but n will be exponentially greater than 2 × log(n).

3.2. NLOGTIME problems

Definition 3.3. Given an A array of n (distinct) positive integer numbers and a x in- teger where |A| ≤ n2,IS − IN − ARRAY is the problem of deciding whether x is in A.

Theorem 3.4. IS − IN − ARRAY ∈ NLOGT IME.

Proof. Given an A array of n (distinct) positive integer numbers and a x integer where |A| ≤ n2, we are going to create an algorithm which decides whether x is in A by a nondeterministic Turing machine in O(log(|A|)) time. For that purpose, we create a nondeterministic Turing machine N such that for the empty string as input, N will output a positive integer i in a nondeterministic way where 0 ≤ i ≤ (2(blog2(n)c+1) − 1). The program δ of N is built as follows:

(i) we create k = (blog2(n)c + 1) different p j states in N where 1 ≤ j ≤ k and;

(ii) for each p j and p j+1 states, we create the following actions in N:

δ(p j, $) = (p j+1, 0, −→) (1)

δ(p j, $) = (p j+1, 1, −→) (2)

4 (iii) the halting state in N will be related to the k − th state pk with the following actions:

δ(pk, $) = (h, 0, −) (3)

δ(pk, $) = (h, 1, −) (4)

(iv) and finally, the initial state in N will be into a single action:

δ(s, B) = (p1, B, −→) (5)

After that, an algorithm for IS − IN − ARRAY will be very simple:

(1) first, we take the positive integer i as output of the running of N with the empty

string where 0 ≤ i ≤ (2(blog2(n)c+1) − 1); (2) next, if i > n or i = 0, then we halt in the state of rejection; (3) else, we obtain the y = A[i] positive integer using the array indexing; (4) finally, we accept when x is equal to y otherwise we reject.

The running time of the first until the third step would be O(log2(n)) time, because the running of N with the empty string does not exceed the (blog2(n)c + 2) steps. The fourth step will use a single comparison with an element in A. In addition, if (A, x) belongs to IS −IN−ARRAY, then |x| ≤ |A|. Hence, we could always accept any (A, x) ∈ IS − IN − ARRAY in O(log(|A|)) time using this algorithm, because n ≤ |A|. Moreover, we could also decide any (A, x) instance in IS − IN − ARRAY using O(log(|A|)) time, because we can always accept (A, x) when (A, x) ∈ IS − IN − ARRAY in that time [5]. Furthermore, for this algorithm we could create an equivalent nondeterministic Turing machine, due to the use of the N nondeterministic Turing machine. Consequently, IS − IN − ARRAY ∈ NLOGT IME.

Definition 3.5. Given an A array of n (distinct) positive integer numbers and a x in- teger where |A| ≤ n2,LESS − T HAN is the problem of deciding whether x complies with x < y for some y in A.

Theorem 3.6. LESS − THAN ∈ NLOGT IME.

5 Proof. The LESS −THAN and IS −IN−ARRAY share the same kind of instance: an A array of n (distinct) positive integer numbers and a x integer where |A| ≤ n2. Indeed, we could use the same idea of algorithm in Theorem 3.4 for the proof of LESS −THAN ∈ NLOGT IME in the following way:

(1) first, we take the positive integer i as output of the running of N with the empty

string where 0 ≤ i ≤ (2(blog2(n)c+1) − 1); (2) next, if i > n or i = 0, then we halt in the state of rejection; (3) else, we obtain the y = A[i] positive integer using the array indexing; (4) finally, we accept when x < y otherwise we reject.

We only changed the fourth step in relation to the algorithm in Theorem 3.4. In- deed, we changed the comparison of equal by less than. To sum up, LESS − THAN ∈ NLOGT IME, because IS − IN − ARRAY ∈ NLOGT IME.

3.3. DLOGTIME=?NLOGTIME

Definition 3.7. Given an A array of n (distinct) positive integer numbers and a x inte- ger where |A| ≤ n2, GREAT ER − OR − EQUAL is the problem of deciding whether x complies with x ≥ y for every element y in A.

Lemma 3.8. GREAT ER−OR−EQUAL is the complement of LES S −T HAN problem.

Proof. Indeed, the acceptance of some (A, x) instance for LESS − THAN will imply the rejection of (A, x) for GREAT ER − OR − EQUAL and viceversa. This will happen because of the contraposition of “ < ” and “ ≥ ” operators.

Theorem 3.9. DLOGT IME , NLOGT IME.

Proof. Let’s state a hypothesis that has an absurd consequence if it is true.

Hypothesis 3.10. DLOGT IME = NLOGT IME.

Given an A array of n (distinct) positive integer numbers and a x integer where |A| ≤ n2, if x is in A, then every (A, x) instance will be in BOUNDED − MAXIMUM if and only if (A, x) is in GREAT ER − OR − EQUAL. In addition, we could verify whether x is in A just in logarithmic time by a deterministic Turing machine if IS −IN −ARRAY ∈

6 DLOGT IME. If the Hypothesis 3.10 is true, then IS − IN − ARRAY ∈ DLOGT IME. Therefore, it will exist a logarithmic time reduction from BOUNDED − MAXIMUM to GREAT ER − OR − EQUAL when the Hypothesis 3.10 is true. We could take any (A, x) instance and verify whether x is in A in logarithmic time. In case of x is in A and we would want to know whether (A, x) is in BOUNDED − MAXIMUM, then we would only need to check whether (A, x) is in GREAT ER − OR − EQUAL. On the other hand, if the Hypothesis 3.10 is true, then LESS −THAN ∈ DLOGT IME. But, if we solve LESS −THAN within a logarithmic time using a deterministic Turing machine, then we could solve GREAT ER − OR − EQUAL in logarithmic time by the same Turing machine because of Lemma 3.8. Indeed, when this deterministic Turing machine accepts or rejects an instance for LESS − THAN, then it would also be - jecting or accepting the same instance for GREAT ER − OR − EQUAL respectively. As result, if the Hypothesis 3.10 is true, then GREAT ER−OR− EQUAL ∈ DLOGT IME. Nevertheless, if GREAT ER − OR − EQUAL ∈ DLOGT IME, then BOUNDED − MAXIMUM ∈ DLOGT IME, because we could use a logarithmic time reduction from BOUNDED − MAXIMUM to GREAT ER − OR − EQUAL through IS − IN − ARRAY over the supposition that the Hypothesis 3.10 is true. But, this is not possible, as we proved in Theorem 3.2, and therefore, the Hypothesis 3.10 is false. In conclusion, DLOGT IME , NLOGT IME as a direct consequence of using the Reductio ad absur- dum rule [8].

4. Conclusions

This proof could be the decisive step in the final solution of the outstanding P versus NP problem. Certainly, there is a close relation between DLOGT IME = ?NLOGT IME and P =?NP questions. Indeed, we hope this proof might be a use- ful tool to find the solution of another unsolved problems in computational complexity theory.

7 References

[1] S. A. Cook, The complexity of Theorem Proving Procedures, in: Proceedings of the 3rd Annual ACM Symposium on the Theory of Computing (STOC’71), ACM Press, 1971, . 151–158.

[2] L. Fortnow, The Status of the P versus NP Problem, Communications of the ACM 52 (9) (2009) 78–86, available at http://www.cs.uchicago.edu/~fortnow/ papers/pnp-cacm.pdf. doi:10.1145/1562164.1562186.

[3] A. M. Turing, On Computable Numbers, with an Application to the Entschei- dungsproblem, Proceedings of the London Mathematical Society 42 (1936) 230– 265.

[4] M. Sipser, Introduction to the Theory of Computation, 2nd Edition, Thomson Course Technology, 2006.

[5] T. H. Cormen, C. E. Leiserson, . L. Rivest, C. Stein, Introduction to Algorithms, 2nd Edition, MIT Press, 2001.

[6] S. Arora, B. Barak, Computational Complexity: A Modern Approach, Cambridge, 2009.

[7] C. H. Papadimitriou, Computational complexity, Addison-Wesley, 1994.

[8] S. Read, Thinking About Logic, Oxford, 1995.

8