DLOGTIME Versus NLOGTIME Frank Vega
Total Page:16
File Type:pdf, Size:1020Kb
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 L’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 complexity class. A language L over an alphabet is any set of strings made up 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 all 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 NT IME( 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) =? NT IME(nk) where DT IME(nk) = S j k S j j>0 DT IME(n ) and NT IME(n ) = j>0 NT IME(n ) [6]. We pretend to show in the next few pages the solution of DLOGT IME = DT IME(log(n)) versus NLOGT IME = NT IME(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 jIj 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 2 f −; −!; −} [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 jAj ≤ 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 jAj, 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(jAj)) 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(jAj) > n for every value of n. The reason is jAj ≤ n2, and thus, log(jAj) ≤ 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 jAj ≤ n2, IS − IN − ARRAY is the problem of deciding whether x is in A. Theorem 3.4. IS − IN − ARRAY 2 NLOGT IME. Proof. Given an A array of n (distinct) positive integer numbers and a x integer where jAj ≤ n2, we are going to create an algorithm which decides whether x is in A by a nondeterministic Turing machine in O(log(jAj)) 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.