Abstract
We consider online algorithms with respect to the competitive ratio. In this paper, we explore one-way automata as a model for online algorithms. We focus on quantum and classical online algorithms. For a specially constructed online minimization problem, we provide a quantum log-bounded automaton that is more effective (has less competitive ratio) than classical automata, even with advice, in the case of the logarithmic size of memory. We construct an online version of the well-known Disjointness problem as a problem. It was investigated by many researchers from a communication complexity and query complexity point of view.
1. Introduction
In the paper, we discuss a computational model used to solve optimization problems. We focus on online algorithms that many researchers explore. An online algorithm processes an input data stream and outputs a data stream in an online fashion. It should return a piece of output variables immediately after reading a piece of input variables. At the same time, the best answer can depend on the whole input. The main goal is a minimization of an objective function (we call it the cost of an output). We can say that an online algorithm solves an online minimization problem. Researchers consider different measures of effectiveness for online algorithms [1,2]. At the same time, the competitive ratio is the most standard and useful [3,4]. If we consider the cost of the output generated by an online algorithm and the cost of the output produced by an optimal offline algorithm, then the competitive ratio is the ratio of these to costs. If the ratio is at most c in the worst case, then we call the algorithm c-competitive. We also can say that the competitive ratio of the algorithm is c.
Typically, online algorithms have no limits for time and memory complexity. The main restriction is a lack of knowledge about future input variables. At the same time, researchers develop online algorithms with different types of restrictions. Some of them are restrictions on memory [5,6,7,8,9,10,11], other ones are restrictions on time complexity [12,13,14]. Often, an algorithm with restricted resources is closer to real-world applications.
In this paper, we focus on the memory complexity of online algorithms. We expect that an input stream is such big that it cannot be stored entirely in memory. An online algorithm processes a data stream. That is why we can consider automata (streaming algorithms, state machines) as online algorithms for this setup. In the paper, we use the “log-bounded automata” term. It is a uniform automata-like model with memory such that the size of memory can depend on the length of an input. This model was explored in [5,7,8]. Note that the automaton is allowed to use only one input head in the considered model. Sometimes, for emphasizing that the model is input data processing model and it is “one-pass”, we call the model one-way log-bounded automata. It means that we cannot reread the input and store the whole required information about the past in memory. Sometimes, to emphasize that the algorithms are used as online algorithms or for solving an online minimization problem, we call the model one-way log-bounded automata for an online minimization problem.
We consider classical and quantum models of “log-bounded automata” as online algorithms. The classical model was developed in papers of different researchers [5,6,7,10,11] for a long time. At the same time, the quantum model was introduced several years ago in [8] and discussed in [9]. Quantum computing [15,16,17] itself is one of the hot topics in computer science of the last few decades. There are many problems where quantum algorithms outperform the best-known classical algorithms [18,19,20]. A restriction for the memory size is especially important for the quantum model of algorithms because near-future quantum computers are able to manipulate with a few qubits.
In the case of one-way log-bounded automata as online algorithms, we know that the quantum model can be more effective than its classical counterparts with respect to a competitive ratio. The result was proven for two cases. The first one is sublogarithmic size of memory [8]. The second case is polylogarithmic size of memory [21]. Note that if an algorithm can use the linear size of memory, then it can store the whole input in memory. In that case, it is equivalent to the standard online algorithm model without restriction on the memory size. That is why the only sub-linear size of memory is interesting in the case of the restricted size of memory.
Researchers also considered other quantum models. One of them is quantum online algorithms with repeated test [22]; another one is quantum online algorithms with restriction on the size of memory [23,24]; quantum algorithms with a buffer [25,26] and others. The question of comparing quantum and classical models was explored for data stream processing models by different researches [27,28,29,30,31,32,33,34,35,36,37,38,39,40].
Our Results
Let us focus on demonstrating the quantum supremacy in the case of the logarithmic size of memory. For this goal, we choose a problem and demonstrate that a quantum model for the problem is more effective than a classical counterpart.
A similar result was proven in [21]. At the same time, the problem that was considered in [21] has one restriction. It is not defined for all inputs and requires a pre-validation to check whether an input is permissible. Such problems are called “promise problems” or “partial functions”. It is an important restriction for a problem. The paper explores “total functions” or problems without a pre-validation procedure for an input.
We investigate an online minimization problem that is based on the Disjointness Boolean function . For some integer b, the function is defined on two binary strings and , and . Here and are bit-masks (or characteristic vectors) of two input sets . The result is 1 iff .
Researchers explored communication complexity and quantum query algorithms for the Disjointness Boolean function [41,42,43]. Additionally, the function was used for comparing quantum and classical streaming algorithms in [28].
In this paper, we consider an online version of this well-known problem that is . The definition of the problem is based on the problems that were presented in [28,44]. We provide a c-competitive quantum log-bounded automaton for , and we show that any classical counterpart is less effective. Formally, any log-bounded automaton for the problem is -competitive and . A similar result was presented in [44]. This paper presents a more significant separation between the competitive ratios of quantum and classical algorithms.
Often, online algorithms are investigated in terms of advice complexity measure [45,46,47]. We are interested in this measure also. The model with advice was not considered in [44].
The main point of the model is the following one. An online algorithm gets some bits of advice about an input. A trusted Adviser sending these bits knows the whole input and has unlimited computational power. Such additional information helps the online algorithm for the computation process and allows to obtain a better competitive ratio. Deterministic and randomized online algorithms with advice are considered in [45,48,49]. Typically, online algorithms researchers use the “Adviser” term, and other models researchers use the “Oracle” term.
In this paper, we provide a quantum log-bounded automaton for with a single advice bit and a logarithmic size of memory that is almost optimal, i.e., -competitive for . At the same time, any classical algorithm with the logarithmic size of memory is less effective. Formally, any classical algorithm with the logarithmic size of memory is -competitive and .
Note that the usage of a specially constructed problem for demonstrating the power of models is a common approach. Sometimes the problems are artificial, but they allow authors to show more representative results [45,49,50].
The paper is organized as follows. We give definitions in Section 2. In Section 3.1 we present our results for the quantum models and Section 3.2 contains results for classical models. The conclusion is presented in Section 4.
2. Preliminaries
In the paper, we use different notations for -functions. A function is such that iff . A function is such that if ; otherwise, . So, .
Let us define the computational models.
An online minimization problem is presented by a set of possible inputs and a cost function. An input is a sequence of input variables. Here n is a length of the input, shortly . Let be a set of feasible outputs associated with an input I. An output is a sequence of output variables . The cost function assigns a positive real value to an input and an output . We call an optimal solution for if it satisfies the next statement
An online algorithm for this problem is defined as follows. A deterministic online algorithm A outputs a sequence such that the variable is computed from input variables .
An algorithm A is c-competitive if we can present a constant such that for every positive integer n and for any input of size n, the following statement is correct
Here is an output of an optimal offline algorithm for the considered problem; c is the minimal number that satisfies the inequality. The number c is the competitive ratio of the algorithm A. In a case of and , the algorithm A is optimal. Typically c is constant. At the same time, c can be a function on n.
We can define An online algorithm A with advice as a sequence of algorithms where . The trusted adviser chooses that depends on an input I and the algorithm computes an output sequence such that . An algorithm A is c-competitive with advice complexity if there exists a constant such that, for every n and for any input I of size n, there exists some such that .
A randomized online algorithmR computes an output sequence such that is computed from , where is a content of the random tape, i. e., an infinite binary sequence, where every bit is chosen uniformly at random and independently of all the others. By we denote the random variable expressing the cost of the solution computed by R on I. R is c-competitive in expectation if there exists a constant such that, for every I, .
We use one-way automata for online minimization problems as online algorithms with restricted memory size. In the paper, we use the terminology for branching programs [51] and algorithms. We say that an automaton computes a Boolean function if for any input X of length m, the automaton returns 1 iff . We can say that an automaton returns 1 if it accepts an input word and returns 0 otherwise. Additionally, we use the terminology on memory from algorithms. We say that an automaton has s bits of memory if it has states. In fact, the model that we consider is a stable id-OBDD [30,31,51], that is an algorithm that uses at most s bits of memory and processes a data stream.
Let us present the definitions of log-bounded automata that we use. A deterministic log-bounded automaton with bits of memory that processes an input is a 4-tuple .
- The set D is a set of states, , is the initial state.
- The function is a transition function , where is a size of the input alphabet.
- is an output function , where is a size of the output alphabet.
It is a uniform model. The computation starts from the state . Then, on reading an input symbol , it changes the current state to . At the end of the computation, the automaton outputs .
A probabilistic log-bounded automaton is a probabilistic counterpart of the model. It chooses from more than one transition in each step such that each transition is associated with a probability. Thus, the automaton can be in a probability distribution over states during the computation. The total probability must be 1, i.e., the sum of probabilities of outgoing transitions from a single state for a single letter must be 1. Thus, a probabilistic automaton returns a result for each input with some probability. For , the automaton returns a result v for an input with bounded-error if the automaton returns the result v with probability at least for some . The automaton computes a function with bounded error if it returns with bounded error for each . The automaton computes a function f exactly if .
A deterministic online streaming algorithm (a deterministic log-bounded automaton for online minimization problem) with bits of memory that process input is a 4-tuple .
- The set D is a set of states, , is the initial state.
- is a transition function .
- is an output function .
The computation starts from the state . Then on reading an input symbol it change the current state to and outputs . The main difference between an “online streaming algorithm” and a standard “online algorithm” definition is a restriction on memory and forbidding reading the previous input variables.
A randomized online streaming algorithm and a deterministic online streaming algorithm with advice have similar definitions, but with respect to definitions of corresponding models of online algorithms.
Comment. Note that any online algorithm can be simulated by an online streaming algorithm (automaton for online minimization problem) using bits of memory. It is n bits in the case of binary input and bits in the general case.
Let us consider a quantum online streaming algorithm (quantum log-bounded automaton for online minimization problem). More information on quantum computation and quantum streaming computational models (automata) can be found in [17,35,52,53,54]. For some integer , a quantum online algorithm Q with q qubits is defined on an input and outputs . A memory of the quantum algorithm is a state of a quantum register of q qubits. In other words, the computation of Q on an input I can be traced by a -dimensional vector from Hilbert space over the field of complex numbers. The initial state is a given -vector (we use Dirac notation for vectors). The algorithm can perform one of two kinds of operators. The first one is applying a unitary -matrix. The second one is measurement.
Let us describe a measurement process. Suppose that Q is in a state before a measurement and the algorithm measures the i-th qubit. Let 0-value for the qubit i is associated with states ; let 1-value for the qubit i is associated with states . If we measure the qubit, then we obtain 1-result with probability and we obtain 0-result with probability . If the result of the measurement is , then after measurement, the quantum system is converted to the state such that , where is an element of the new vector and is an element of the old vector. All other elements of the new vector are 0.
Suppose, on j-th step, the algorithm measures v qubit. Then, an outcome of the measurement is . We test variable on j-th step, for . The algorithm does all three following operations in the presented order.
- 1.
- It does a measurement. Let the outcome be u.
- 2.
- The algorithm applies a unitary -matrix that depends on the input variable and the outcome u.
- 3.
- It does a measurement. Let the outcome be . Then, the algorithm outputs on this step. Here is a function that converts the result of the measurement to an output variable.
The algorithm Q is c-competitive in expectation if there exists a non-negative constant such that, for every I, .
A quantum log-bounded automaton has a similar definition, but it returns at the end of the computation. See [35,55] for more details on quantum automata.
3. On Quantum Online Streaming Algorithm for the Online Disjointness Problem
Let us define problem that is based on the Disjointness Boolean function. The function is such that
We can say that and are bit-masks or characteristic vectors for sets . The function is such that iff the corresponding have no intersections, i.e., . For some positive integers t, k, r, and w such that k mod t = 0, , the online minimization problem is organized as follows. Figure 1 describes the structure of an input.
Figure 1.
The structure of an input for .
Let m be an positive integer. Formally, an input has the following structure: where is a binary representation of m and , where . For some positive integer n, let . Let be a function such that iff the following properties are right:
- 1.
- For some positive integer and binary strings , the structure of is
- 2.
- and
- 3.
- ;
- 4.
- , where is a length of a vector v;
- 5.
- , where is a binary representation of an integer .
- 6.
- The value of the function .
- 7.
- .
The authors of [28] have constructed a problem using a similar idea.
For , let a Boolean variable be such that . Let be output variables that correspond to input variables . The cost function is
where . Recall, parameters and r or the problem satisfy conditions k mod and . Let us discuss the meaning of the cost function. The output is split into t blocks. The size of each block is T. We say that a block is “right” if all each element from the block satisfies . Otherwise it is a “wrong” block. The cost of a “right” block is r, and the cost of a “wrong” block is w. The sum of costs of all blocks is the total cost of the output. Our goal is to develop an algorithm that minimizes the cost of the output. A similar concept of the cost function was used, for example, in [49].
3.1. A Quantum Online Streaming Algorithm for the Online Disjointness Problem
Let us discuss a quantum log-bounded automaton for function. For construction of the automaton, we will use the following existing result:
Lemma 1
([56]). We can construct a quantum log-bounded automaton that checks the equality of two binary strings with bounded error for . The size of the memory of the automaton is .
Note that the proof of the following lemma is similar to the proof from [44]. At the same time, the structure of differs from the structure of the corresponding function from [44]. That is why we present the full proof here. The current form of the function allows us to obtain better error probability.
Lemma 2.
Suppose that we have a quantum register that stores m, i.e., . There is a bounded error quantum log-bounded automaton for that uses qubits of memory and has error probability for , where is a length of .
Proof.
As proof, we construct a quantum automaton for the problem. The automaton consists of five parallel procedures. A procedure per property from the following list:
- 1.
- For an integer b, the string have the following structure:Here, we use for several repetitions of the string.
- 2.
- The string satisfies and ;
- 3.
- , and ;
- 4.
- ;
- 5.
- .
Property 1. We use a deterministic procedure for checking the first property. The size of memory is . Firstly, we check whether the strings have the following structure
We can do it using a constant number of states. Secondly, it checks that all binary parts have the same length and stores its length in a quantum register . We can use states or memory. The detailed implementation is presented in Appendix A.1.
Property 2. We use a deterministic procedure for checking the second property. We store the string and compute a number of 4s and 5s that is . Then, we check whether is correct, where . The algorithm stores and counts using states or bits of memory. The algorithm for the first property already stored b and m is stored in , that is why we can use them for checking the equality. The detailed implementation is presented in Appendix A.2.
Property 3. We use a quantum fingerprinting technique [56,57] based on a quantum procedure for checking the third property. We assemble two strings from the existing ones:
where “∘” is concatenation. If , then
and
Let us choose . Due to Lemma 1, we can present a log-bounded automaton for checking equality of and . The size of memory is . The detailed implementation is presented in Appendix A.3.
Property 4. We use a quantum procedure for checking the fourth property. The procedure is based on the quantum fingerprinting method also and checks whether is correct. We construct an automaton using Lemma 1 for checking the property with bounded error . Suppose , then the automaton reaches an error probability using qubits. The detailed implementation is presented in Appendix A.4.
Property 5. We use a quantum procedure for checking the fifth property, and it uses some ideas from [28]. As a base, we use the well-known Grover’s algorithm [58,59] for the unstructured search problem. The size of quantum memory for the procedure is and error probability is . Let us present the description of the procedure. Let and . If the input satisfies the first four properties, then we can say that the input is m copies of string. The Grover’s Search algorithm was defined for Query model [16,17] and it does queries to the oracle or queries in a case of unknown number of solutions. We simulate a query to the oracle by reading the input string . So, copies of this string allow as to provide multiple queries. We simulate the search of the index such that or . In that case .
Let us provide the emulation of a query to the oracle. We have qubits as a quantum register , p qubits as a quantum register . Additionally, there is a qubit and a qubit .
Initially, the quantum system is in the state. Firstly, the automaton reads the string. In other words, it processes . We assume that the automaton already knows b on this step. Firstly, we apply the Hadamard transformation for obtaining the following state . Then, we apply the inversion transformation (X-gate or NOT-gate) for obtaining the following state .
We split the automaton’s steps to macro-steps. The l-th one is reading strings for . During checking the third property, we store l in . The computing process of l is presented in Appendix A.3. Assume that the automaton reads string’s a-th symbol. If the automaton reads 1, then we apply the V transformation to registers . Here for . The automaton does not change the quantum registers if it reads 0.
Assume that the automaton reads string’s a-th symbol. If the automaton reads 1, then we apply the W transformation to registers . Here for . The automaton does not change the quantum registers if it reads 0. In other words, the amplitude for a state is inverted only if . Indexes with such property are our solution. We process the string exactly like we process the string.
Remember that we already tested the equality in procedure 3 and procedure 4. Therefore, after processing , the effect that does to the second register is removed. One macro step simulates one query of Grover’s search algorithm.
Then, we apply Grover’s diffusion transformation to the register . The transformation is . It rotates all amplitudes near the mean, where R is a unitary transformation that inverts sign for all basis states except zero basis state. Reader can find details on the Grover’s diffusion transformation D in [58,59].
One macro-step (processing of strings ) and the Grover’s diffusion transformation together correspond to one step of Grover’s search algorithm. Due to [59], the automaton simulate steps of the algorithm if , where is a-th symbol of the string . The automaton does steps if , where . Initially, . The automaton simulates the required number of Grover’s search steps and measures . If we obtain result, then we reads one more block and check the equality . For checking the equality, we store these two bits in qubits. Then, we measure both qubits and check equality of measurement results.
If the condition is right, then process stops. Otherwise, we assign to the , initialize by and repeat the procedure for the new value of v. The probability of correct answer of the algorithm is at least , due to [59]. Using the standard success boosting procedure, we can get the error probability by repeating the algorithm times.
It is easy to see that the size of memory for presented automaton for is qubits. The error probability is where . □
If we compare the obtained result with results of [28,44], then we can see that the function and the automaton have several modifications. Using this modification we show that the error probability is . At the same time, similar constructions from [28,44] allow us to obtain only constant error probability.
Using the previous result, we can construct a quantum online streaming algorithm for with a smaller competitive ratio compared to [44]. This property is presented in the following theorem.
Theorem 1.
Suppose . We provide a quantum online streaming algorithm Q for that is expected c-competitive, uses qubits of memory, where . Here for .
Proof.
Firstly, we store m into the quantum register of qubits. We guess , we choose it randomly and uniformly from the set . We output the result of guessing as the first output variable . After that the automaton (streaming online algorithm) computes and outputs that is . On the i-th step the automaton computes and outputs . If (we guess correctly), then for each other output variable is correct, i.e., for . If , then all output variables are incorrect, i.e., for . Let . We can show that for . Let us compute a cost of the output for this algorithm if a probability of computing is . Let us remind that all output variables are split to t blocks. Let us change the cost function. The new one is such that 1 is the cost of a “right” block, and 0 is the cost of a “wrong” block. Formally,
The main cost function can be computed by the new one using the following statement .
For computing the competitive ratio, we should calculate .
Let us compute the probability that a block i is a “right” block (costs 1). Let . So, if the i-th block is “right”, then for all binary strings inside the block the computation of is right and a guess of is right. A probability of this event is .
Let . If the i-th block is “right”, then two conditions should be true:
- (i)
- for all binary strings inside the block, the computation of should be right.
- (ii)
- If we consider a number of errors for computation of for preceding s plus 1 if is wrong. Then this number should be even.
A probability of the first condition is . Let us compute the probability of the second condition.
Let be the number of errors before computation of . Let be the number of of errors during computation of . If , then , otherwise . Let the probability mod . Hence, mod . If we compute with an error, then we have mod . If we compute with no error, then we have mod . Hence,
Remember that with probability . Hence, .
We can compute the probability as follows
Hence, . Let us compute the expected cost:
Therefore, .
Let us compute the expected competitive ratio.
Let us estimate .
Hence, . □
The quantum streaming algorithm with advice is presented in the following theorem.
Theorem 2.
There is the expected c-competitive quantum online streaming algorithm Q with qubits of memory and single advice bit for , where and for and .
Proof.
The algorithm is the same as in the Theorem 1, but is obtained as an advice bit. Let us compute similarly as in the proof of the previous theorem. Assume that is an error for computing . Let be the number of errors before computation of . It is a number of errors for computation of for preceding Ls. Let the probability mod . Hence, mod . Remember that we obtain as the advice bit; therefore, .
So, .
The probability of the event is .
We can compute the expected value for the cost
Let us compute
Therefore, and . Hence, we obtain the claim of the theorem. □
3.2. Bounds for Classical Automata for the Online Disjointness Problem
We use some results from the communication complexity theory. We briefly remind the reader of the model (see [60]). There are two players, Alice and Bob. They want to compute a Boolean function . Alice has variables from a set and Bob variables from a set . Alice starts computation and sends a message to Bob. Then, Bob continues and sends a message to Alice, etc. The player who can compute returns an answer. Alice and Bob can use a probabilistic mechanism. The probabilistic communication complexity is the total number of bits in all messages. It is known that
Lemma 3
([42]). The probabilistic communication complexity of the Boolean function is , where , Alice has x and Bob has y.
Using this result, we can show the following one.
Lemma 4.
Suppose, we have a promise that properties 1–5 and 7 of are correct. Suppose the length of the string is and the integer m such that . Then, there is no bounded error probabilistic log-bounded automata for that uses bits of memory.
Proof.
Suppose that there is a probabilistic automaton R for with bits of memory. Then, we can simulate the work of R by a probabilistic communication protocol such that Alice knows and Bob knows . Each player simulates R on his part of the input. Then he/she sends a state of the memory of R to the opposite player. See more details on an emulation of stream processing models by communication protocols, for example, in [37,51,61]. Therefore, the communication protocol uses bits of memory for computing . This fact contradicts with Lemma 3. □
Using this result, we can show that for probabilistic and deterministic automata, the problem is hard.
Theorem 3.
There is no c-competitive deterministic online streaming algorithm for that uses bits of memory, where , .
Proof.
Let us consider any online streaming algorithm A for the problem such that the size of memory is at most bits. Assume, the algorithm A returns as the first output variable. Let us prove that there are two parts of the input such that A returns the same value for both, but .
Assume that there is no such triple . Then it means that we can construct an automaton that uses bits of memory and has the following property: iff , for any . The automaton simulates A. Hence, the automaton computes the function or the function . If it computes the function , then we can provide an automaton such that . This statement contradicts with the main claim of the theorem. Similarly, we can prove that we have analogous triples for .
Let us choose , for .
Let be such that . An optimal offline solution is where .
Let us prove that for each . We have , hence , so we obtain .
Therefore, all output variables are “wrong” and the cost is . Hence, the competitive ratio c more than . □
Theorem 4.
There is no expected c-competitive randomized online streaming algorithm for that uses bits of memory, where and , .
Proof.
We can show that a bounded error randomized online streaming algorithm A cannot compute . We prove the claim using the idea from the proof of Theorem 3. It is easy to see that the only option for an algorithm is to guess the value of and randomly uniformly choose it. Using this strategy, we can obtain the required competitive ratio. If we want to get a cost r for a block, then it should guess all output bits of the block. So, the cost of the i-th block is . Hence, . Therefore, the algorithm A is c competitive in expectation, for . □
For proofs of properties for classical models with advice (Theorems 5 and 6), we show that if the model does not have enough memory, then the problem can be interpreted as the “String Guessing, Unknown History” () from [50].
The following result for the is known:
Lemma 5
([50]). Consider an input string of length k for , for some positive integer k. Any online algorithm that is correct in more than characters, for , needs to read at least advice bits.
Using above result we show complexity of the problem.
Theorem 5.
There is no c-competitive deterministic online streaming algorithm for that uses bits of memory and b advice bits, where , , v is such that , and .
Proof.
We start with a proof of the following claim. For any online algorithm for that obtains b advice bits, we can suggest an input such that the algorithm has at least errors in computation. We prove it by induction.
Firstly, let us prove the claim for . Then the adviser can send , where . Using this advise we return all correct output variables .
Secondly, let us show the correctness of the claim in a case of . Therefore, there is no advice at all. So, it is exactly the Theorem 3 situation.
Thirdly, let us show the correctness of the claim in a case of . Assume that the claim is correct for a pair such that , and at least one of these inequalities is strict. Let us consider the computation process of the function.
Assume that there is an input such that there is no way to compute an output with bounded error. Then using the input, we obtain the case for input variables and b advice bits. So, the computation of for binary strings is incorrect, and the computation for is incorrect also.
Assume that the algorithm computes an output for with a bounded error always. So we can describe the process of communication with the adviser in the following way: the adviser separates all possible inputs into non-overlapping groups . After that, he sends a group number containing current input to the algorithm. Then, the algorithm A processes the input with the knowledge that an input can be only from this group.
Let us consider three sets of groups:
- such that is and ,
- such that is and ,
- .
Let , for some . If , then as we take any input from any group . Hence we have at most possible groups for the adviser that distinguish next s. We can say that the adviser can encode them using bits. Therefore, we get the situation for advice bits and binary strings . The claim is true for this situation. If , then we pick an input from any group . Therefore, there are at most possible groups for the adviser and the same situation. For this case, the claim is correct.
Suppose the size of sets and is . Assume that the algorithm solves the problem, and the memory size is , where . The automaton B with the following structure can simulate the algorithm’s work on . The automaton B has two memory registers: a register of b bits and a register of bits. We assume that is initialized by advice bits. After that, the automaton B invokes A depending on the value of advice bits stored in . The memory size of B is and it computes by simulating A. We obtain a contradiction with the theorem’s claim. Hence, transferring the answer of as an advice bit is the only way to compute the result of the function. So, we have a situation for binary strings and advice bits.
So, it means that for the algorithm, the problem is the same as the String Guessing Problem with Unknown History () from [50].
Due to Lemma 5, for obtaining v right answers , we need advice bits.
Because of the cost function properties, the best case for the algorithm is getting all s of a block. Therefore, the algorithm can obtain advice bits on full blocks, for . In that case, the cost of these blocks is r. Each of the rest blocks has at least one “wrong” output variable. So, such a block costs w. Hence, we suggest the input such that the corresponding output costs
Let us compute the competitive ratio c
□
Next, we show an analog of Theorem 5 for randomized case. Ideas from [62,63,64,65] are the basis for the proof of the following theorem.
Theorem 6.
Suppose . Any randomized online streaming algorithm A using b advice bits, less than bits of memory, and solving , has the expected competitive ratio
for , v is such that , and .
Proof.
Let us suggest the proof that is based on the proof of Theorem 5. Suppose that an online algorithm obtains b advice bits. Then, we can suggest an input such that on this input, the computation of has an error for at least strings . The claim can be proven by the way similar to the proof of Theorem 5. At the same time, we use the probabilistic automaton B to simulate A, and the part of the automaton that uses memory is probabilistic.
Therefore, for the algorithm, our problem is equivalent to the String Guessing Problem with Unknown History () from [50].
Hence, if we want to obtain v right answers for output variables, then we should use
We can show that if we do not know from the adviser, then we cannot compute the output variable with bounded error. Hence, the only way to obtain the variables is randomly uniformly choosing them. We can apply the proof technique as in Theorem 4. We use the same approach for all segments between “known” output variables. □
4. Conclusions
We provide an expected -competitive quantum online streaming algorithm with no advice and an expected -competitive quantum online streaming algorithm with a single advice bit. They are such that and for . At the same time, any classical algorithm with a logarithmic size of memory is -competitive for a model with no advice and -competitive for a model with advice bits, where .
Author Contributions
The main idea and lower bounds, K.K.; constructions and concepts, K.K. and A.K. All authors have read and agreed to the published version of the manuscript.
Funding
This paper has been supported by the Kazan Federal University Strategic Academic Leadership Program (“PRIORITY-2030”).
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Not applicable.
Data Availability Statement
Not applicable.
Conflicts of Interest
The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.
Appendix A. Details of the Proof for Lemma 2
Appendix A.1. The Implementation of the Procedure for Checking the First Property from Lemma 2
Let us remind the reader of the property that we are checking.
- for some integer b, where means repeating the string several times
We present the description of the procedure as a quantum automaton. The automaton uses the following registers of qubits. The register contains 2 qubits. The possible values are as follows.
- means the automaton reads a binary string before 5.
- means the automaton reads a binary string from 4 or 5 to 2.
- means the automaton reads a binary string from 2 to 3.
- means the automaton reads a binary string from 3 to 4.
The register contains 1 qubit. The possible values are as follows.
- means the automaton rejects the input.
- means the automaton continues computation.
We use the register of qubits for counting a length of the current binary string. We store a length of the first binary string in the register of .
We start the computation from state.
Let us present the behavior of the automaton depending on an input symbol . Assume that we have a transformation
Note that we can implement -operator using control-operators [17]. Let us describe the transition function as an Algorithm A1.
Appendix A.2. The Implementation of the Procedure for Checking the Second Property from Lemma 2
Let us remind the reader of the property that we are checking.
- and ;
We present the description of the procedure as a quantum automaton. The automaton uses the following registers:
- a register of qubits;
- a register of qubits;
- a single qubit ;
- a register of qubits.
We start the computation from state.
Let us consider the behavior of the automaton depending on an input symbol v.
Let . If , then the automaton reads and stores bits one by one in qubits of using operator.
The automaton stores the current index in using
Let . Then, the automaton converts .
Let . Then, the automaton applies transformation to .
Let . Then, the automaton the identity transformation.
Let . Then, the automaton measures . If the result of the measurement is u, then we check an equality . After that, the automaton measures and checks an equality . The last equality means that the string satisfies the forth condition. If at least one of these two equality are wrong, then the automaton rejects the input.
Recall, at this moment, the automaton already have stored b in the register and m in the register .
Let us describe the behavior of the automaton depending on an input symbol . Note, that we can implement -operator using control-operators [17]. Let us describe the transition function as an Algorithm A2.
| Algorithm A1 Transition on a symbol |
|
| Algorithm A2 Transition on a symbol |
|
Appendix A.3. The Implementation of the Procedure for Checking the Third Property from Lemma 2
Let us remind the reader of the property that we are checking.
- , and ;
Let us present the quantum automaton for checking the property. It based on the quantum fingerprinting technique [56,57]. Let us assamble two string:
here “∘” is concatenation.
If , then
For some constant , we suggest a quantum algorithm for checking the equality of these strings with bounded error . It uses qubits of memory and is based on the automaton from Lemma 1.
Here we describe the main idea of the automaton. A reader can find more details in [36,56,57].
We use the following quantum registers:
- is a quantum register of qubits.
- is a single qubit.
- is a quantum register of qubits. We store an index of a symbol of a string in this register.
A set of special parameters from [56,57] is used by the algorithm.
We start from the state. The automaton do the following transformations if . This condition means the automaton read and stored .
Firstly, if the automaton reads a symbol 5, then it applies the Hadamard transformation to . Hence, the quantum system is in the state
For all next steps and symbols 0 or 1, we apply the transformation to that is
Assume that the automaton reads the j-th symbol of that is , and . The condition means and the automaton reads on of symbols of .
If , then the automaton does nothing. If , then the automaton applies the transformation that is the rotation of qubit to the angle with respect to the state of and of . Here .
Assume that the automaton reads the j-th symbol of that is , and and . The condition and means . The same symbol is the -th symbol of that is .
If , then the automaton does nothing. If , then the automaton applies the transformation that rotates to the angle with respect to the state of and of .
Note, that on this step and are already computed.
Assume that the automaton reads the j-th symbol of that is , and . The condition means the first string is finished and we read the -th symbol of and .
If , then the automaton does nothing. If , then the automaton applies the transformation that rotates to the angle with respect to the state of and of .
Finally, the automaton on symbol 6 applies the Hadamard transformation to and measures . If we obtain 0 as a result of measurement, then these strings are equal; otherwise, they are unequal. So, memory size is qubits. Assume that , then the automaton computes the function with error probability and uses qubits.
Appendix A.4. The Implementation of the Procedure for Checking the Forth Property from Lemma 2
Let us remind the reader of the property that we are checking.
- .
The fourth procedure is similar to the third procedure. We check an equality . We construct an automaton using Lemma 1 for checking the property with bounded error . Suppose , then the automaton reaches an error probability using qubits.
The quantum memory is a quantum register of qubits, and a qubit . We have the same set of special parameters as for the third procedure. We start from the state.
Firstly, using the Hadamard transformation for , we obtain
Let the automaton read the j-th symbol of that is , for . Therefore, the automaton reads the j-th symbol of .
If , then the automaton does nothing. If , then the automaton applies a transformation that rotates to an angle with respect to the state of the register and of .
Let the automaton read the j-th symbol of that is , for . It means the automaton reads the j-th symbol of .
If , then the automaton does nothing. If , then the automaton applies the transformation that rotates to an angle with respect to the state of the register and of .
If the input symbol is 4, then the automaton applies the Hadamard transformation to and measures . If the result of the measurement is 0, then . Otherwise, the input does not satisfy the fourth condition. Suppose , then the automaton has an error probability and uses quantum memory of size .
References
- Boyar, J.; Irani, S.; Larsen, K.S. A comparison of performance measures for online algorithms. In Workshopon Algorithms and Data Structures; Springer: Berlin/Heidelberg, Germany, 2009; Volume 5664, pp. 119–130. [Google Scholar]
- Dorrigiv, R.; López-Ortiz, A. A survey of performance measures for on-line algorithms. SIGACT News 2005, 36, 67–81. [Google Scholar]
- Sleator, D.D.; Tarjan, R.E. Amortized efficiency of list update and paging rules. Commun. ACM 1985, 28, 202–208. [Google Scholar] [CrossRef] [Scilit]
- Karlin, A.R.; Manasse, M.S.; Rudolph, L.; Sleator, D.D. Competitive snoopy caching. In Proceedings of the 27th Annual Symposium on Foundations of Computer Science, Toronto, ON, Canada, 27–29 October 1986; pp. 244–254. [Google Scholar]
- Becchetti, L.; Koutsoupias, E. Competitive Analysis of Aggregate Max in Windowed Streaming. In International Colloquium on Automata, Languages, and Programming; Springer: Berlin/Heidelberg, Germany, 2009; Volume 5555, pp. 156–170. [Google Scholar]
- Giannakopoulos, Y.; Koutsoupias, E. Competitive analysis of maintaining frequent items of a stream. Theor. Comput. Sci. 2015, 562, 23–32. [Google Scholar] [CrossRef] [Scilit]
- Boyar, J.; Larsen, K.S.; Maiti, A. The frequent items problem in online streaming under various performance measures. Int. J. Found. Comput. Sci. 2015, 26, 413–439. [Google Scholar] [CrossRef] [Scilit]
- Khadiev, K.; Khadieva, A.; Mannapov, I. Quantum Online Algorithms with Respect to Space and Advice Complexity. Lobachevskii J. Math. 2018, 39, 1210–1220. [Google Scholar] [CrossRef] [Scilit]
- Ablayev, F.; Ablayev, M.; Khadiev, K.; Vasiliev, A. Classical and quantum computations with restricted memory. In Adventures Between Lower Bounds and Higher Altitudes; Springer: Cham, Swizerland, 2018; Volume 11011, pp. 129–155. [Google Scholar]
- Baliga, G.R.; Shende, A.M. On space bounded server algorithms. In Proceedings of the ICCI’93: 5th International Conference on Computing and Information, Sudbury, ON, Canada, 27–29 May 1993; pp. 77–81. [Google Scholar]
- Hughes, S. A new bound for space bounded server algorithms. In Proceedings of the 33rd Annual on Southeast Regional Conference, Clemson, SC, USA, 17–18 March 1995; pp. 165–169. [Google Scholar]
- Flammini, M.; Navarra, A.; Nicosia, G. Efficient offline algorithms for the bicriteria k-server problem and online applications. J. Discret. Algorithms 2006, 4, 414–432. [Google Scholar] [CrossRef] [Scilit]
- Rudec, T.; Baumgartner, A.; Manger, R. A fast work function algorithm for solving the k-server problem. Cent. Eur. J. Oper. Res. 2013, 21, 187–205. [Google Scholar] [CrossRef] [Scilit]
- Kapralov, R.; Khadiev, K.; Mokut, J.; Shen, Y.; Yagafarov, M. Fast Classical and Quantum Algorithms for Online k-server Problem on Trees. arXiv 2020, arXiv:2008.00270. [Google Scholar]
- Nielsen, M.A.; Chuang, I.L. Quantum Computation and Quantum Information; Cambridge University Press: Cambridge, UK, 2010. [Google Scholar]
- Ambainis, A. Understanding Quantum Algorithms via Query Complexity. Proc. Int. Conf. Math. 2018, 4, 3283–3304. [Google Scholar]
- Ablayev, F.; Ablayev, M.; Huang, J.Z.; Khadiev, K.; Salikhova, N.; Wu, D. On quantum methods for machine learning problems part I: Quantum tools. Big Data Min. Anal. 2019, 3, 41–55. [Google Scholar] [CrossRef] [Scilit]
- de Wolf, R. Quantum Computing and Communication Complexity; Institute for Logic, Language and Computation: Amsterdam, The Netherlands, 2001. [Google Scholar]
- Jordan, S. Quantum Algorithms Zoo. 2021. Available online: http://quantumalgorithmzoo.org/ (accessed on 25 December 2021).
- Montanaro, A. Quantum algorithms: An overview. NPJ Quantum Inf. 2016, 2, 1–8. [Google Scholar] [CrossRef] [Scilit]
- Khadiev, K.; Khadieva, A.; Kravchenko, D.; Rivosh, A.; Yamilov, R.; Mannapov, I. Quantum versus Classical Online Streaming Algorithms with Logarithmic Size of Memory. arXiv 2019, arXiv:1710.09595. [Google Scholar]
- Yuan, Q. Quantum Online Algorithms. Ph.D. Thesis, UC Santa Barbara, Santa Barbara, CA, USA, 2009. [Google Scholar]
- Khadiev, K.; Khadieva, A. Two-Way Quantum and Classical Automata with Advice for Online Minimization Problems. In International Symposium on Formal Methods; Springer: Cham, Swizerland, 2020; pp. 428–442. [Google Scholar]
- Khadiev, K.; Khadieva, A. Two-way quantum and classical machines with small memory for online minimization problems. In International Conference on Micro-and Nano-Electronics 2018; International Society for Optics and Photonics: Bellingham, WA, USA, 2019; Volume 11022, p. 110222T. [Google Scholar] [CrossRef] [Scilit]
- Khadiev, K.; Lin, D. Quantum online algorithms for a model of the request-answer game with a buffer. Uchenye Zap. Kazan. Univ. Seriya Fiz. Mat. Nauk. 2020, 162, 367–382. [Google Scholar] [CrossRef] [Scilit]
- Khadiev, K. Quantum request-answer game with buffer model for online algorithms. Application for the Most Frequent Keyword Problem. CEUR Workshop Proc. 2021, 2850, 16–27. [Google Scholar]
- Le Gall, F. Exponential Separation of Quantum and Classical Online Space Complexity. In Proceedings of the 18th ACM Symposium on Parallelism in Algorithms and Architectures, Cambridge, MA, USA, 30 July–2 August 2006; pp. 67–73. [Google Scholar]
- Le Gall, F. Exponential separation of quantum and classical online space complexity. Theory Comput. Syst. 2009, 45, 188–202. [Google Scholar] [CrossRef] [Scilit]
- Gavinsky, D.; Kempe, J.; Kerenidis, I.; Raz, R.; de Wolf, R. Exponential Separations for One-way Quantum Communication Complexity, with Applications to Cryptography. In Proceedings of the 39th Annual ACM Symposium on Theory of Computing, San Diego, CA, USA, 11–13 June 2007; pp. 516–525. [Google Scholar]
- Ablayev, F.; Gainutdinova, A.; Karpinski, M.; Moore, C.; Pollett, C. On the computational power of probabilistic and quantum branching program. Inf. Comput. 2005, 203, 145–162. [Google Scholar] [CrossRef] [Scilit]
- Ablayev, F.; Gainutdinova, A.; Khadiev, K.; Yakaryılmaz, A. Very narrow quantum OBDDs and width hierarchies for classical OBDDs. Lobachevskii J. Math. 2016, 37, 670–682. [Google Scholar] [CrossRef] [Scilit]
- Gainutdinova, A. Comparative complexity of quantum and classical OBDDs for total and partial functions. Russ. Math. 2015, 59, 26–35. [Google Scholar] [CrossRef] [Scilit]
- Sauerhoff, M.; Sieling, D. Quantum branching programs and space-bounded nonuniform quantum complexity. Theor. Comput. Sci. 2005, 334, 177–225. [Google Scholar] [CrossRef] [Scilit]
- Ambainis, A.; Yakaryılmaz, A. Superiority of exact quantum automata for promise problems. Inf. Process. Lett. 2012, 112, 289–291. [Google Scholar] [CrossRef] [Scilit]
- Ambainis, A.; Yakaryılmaz, A. Automata and Quantum Computing. arXiv 2015, arXiv:1507.01988. [Google Scholar]
- Khadiev, K.; Khadieva, A. Reordering Method and Hierarchies for Quantum and Classical Ordered Binary Decision Diagrams. In International Computer Science Symposium in Russia; Springer: Cham, Swizerland, 2017; Volume 10304, pp. 162–175. [Google Scholar]
- Ablayev, F.; Ambainis, A.; Khadiev, K.; Khadieva, A. Lower Bounds and Hierarchies for Quantum Memoryless Communication Protocols and Quantum Ordered Binary Decision Diagrams with Repeated Test. In International Conference on Current Trends in Theory and Practice of Informatics; Edizioni della Normale: Cham, Swizerland, 2018; Volume 10706, pp. 197–211. [Google Scholar]
- Gainutdinova, A.; Yakaryılmaz, A. Nondeterministic unitary OBDDs. In International Computer Science Symposium in Russia; Springer: Cham, Swizerland, 2017; pp. 126–140. [Google Scholar]
- Gainutdinova, A.; Yakaryılmaz, A. Unary probabilistic and quantum automata on promise problems. Quantum Inf. Process. 2018, 17, 28. [Google Scholar] [CrossRef] [Scilit]
- Ibrahimov, R.; Khadiev, K.; Prūsis, K.; Yakaryılmaz, A. Error-free affine, unitary, and probabilistic OBDDs. Int. J. Found. Comput. Sci. 2021, 32, 827–847. [Google Scholar] [CrossRef] [Scilit]
- Buhrman, H.; Cleve, R.; Wigderson, A. Quantum vs. classical communication and computation. In Proceedings of the the 30th Annual ACM Symposium on Theory of Computing, Dallas, TX, USA, 24–26 May 1998; pp. 63–68. [Google Scholar]
- Razborov, A.A. On the distributional complexity of disjointness. In International Colloquium on Automata, Languages, and Programming; Springer: Berlin/Heidelberg, Germany, 1990; pp. 249–253. [Google Scholar]
- Chattopadhyay, A.; Pitassi, T. The story of set disjointness. ACM SIGACT News 2010, 41, 59–85. [Google Scholar] [CrossRef] [Scilit]
- Khadiev, K.; Khadieva, A. Quantum Online Streaming Algorithms with Logarithmic Memory. Int. J. Theor. Phys. 2021, 60, 608–616. [Google Scholar] [CrossRef] [Scilit]
- Komm, D. An Introduction to Online Computation: Determinism, Randomization, Advice; Springer: Cham, Swizerland, 2016. [Google Scholar]
- Boyar, J.; Favrholdt, L.; Kudahl, C.; Larsen, K.; Mikkelsen, J. Online Algorithms with Advice: A Survey. ACM Comput. Surv. 2017, 50, 19. [Google Scholar]
- Böckenhauer, H.J.; Komm, D.; Královič, R.; Královič, R.; Mömke, T. On the advice complexity of online problems. In International Symposium on Algorithms and Computation; Springer: Berlin/Heidelberg, Germany, 2009; Volume 5878, pp. 331–340. [Google Scholar]
- Hromkovic, J. Design and Analysis of Randomized Algorithms: Introduction to Design Paradigms; Springer: Berlin/Heidelberg, Germany, 2005. [Google Scholar]
- Böckenhauer, H.J.; Hromkovič, J.; Komm, D.; Královič, R.; Rossmanith, P. On the power of randomness versus advice in online computation. In Languages Alive; Springer: Berlin/Heidelberg, Germany, 2012; pp. 30–43. [Google Scholar]
- Böckenhauer, H.J.; Hromkovič, J.; Komm, D.; Krug, S.; Smula, J.; Sprock, A. The string guessing problem as a method to prove lower bounds on the advice complexity. Theor. Comput. Sci. 2014, 554, 95–108. [Google Scholar] [CrossRef] [Scilit]
- Wegener, I. Branching Programs and Binary Decision Diagrams: Theory and Applications; SIAM: Philadelphia, PA, USA, 2000. [Google Scholar]
- Ablayev, F.; Gainutdinova, A.; Karpinski, M. On Computational Power of Quantum Branching Programs. In International Symposium on Fundamentals of Computation Theory; Springer: Berlin/Heidelberg, Germany, 2001; Volume 2138, pp. 59–70. [Google Scholar]
- Ablayev, F.M.; Gainutdinova, A. On the Lower Bounds for One-Way Quantum Automata. In Mathematical Foundations of Computer Science 2000; Springer: Berlin/Heidelberg, Germany, 2000; Volume 1893, pp. 132–140. [Google Scholar]
- Ablayev, F.; Gainutdinova, A. Complexity of Quantum Uniform and Nonuniform Automata. In Developments in Language Theory; Springer: Berlin/Heidelberg, Germany, 2005; Volume 3572, pp. 78–87. [Google Scholar]
- Say, A.C.; Yakaryılmaz, A. Quantum finite automata: A modern introduction. In Computing with New Resources; Springer: Berlin/Heidelberg, Germany, 2014; pp. 208–222. [Google Scholar]
- Ablayev, F.; Vasiliev, A. On quantum realisation of Boolean functions by the fingerprinting technique. Discret. Math. Appl. 2009, 19, 555–572. [Google Scholar] [CrossRef] [Scilit]
- Ablayev, F.M.; Vasiliev, A. Algorithms for Quantum Branching Programs Based on Fingerprinting. Int. J. Softw. Inform. 2013, 7, 485–500. [Google Scholar] [CrossRef] [Scilit]
- Grover, L.K. A fast quantum mechanical algorithm for database search. In Proceedings of the Twenty-Eighth Annual ACM Symposium on Theory of Computing, Philadelphia, PA, USA, 22–24 May 1996; pp. 212–219. [Google Scholar]
- Boyer, M.; Brassard, G.; Høyer, P.; Tapp, A. Tight bounds on quantum searching. Fortschritte Phys. 1998, 46, 493–505. [Google Scholar] [CrossRef] [Scilit]
- Kushilevitz, E.; Nisan, N. Communication Complexity; Cambridge University Press: Cambridge, UK, 1997; pp. I–XIII, 1–189. [Google Scholar]
- Khadiev, K. On the Hierarchies For Deterministic, Nondeterministic and Probabilistic Ordered Read-k-Times Branching Programs. Lobachevskii J. Math. 2016, 37, 682–703. [Google Scholar] [CrossRef] [Scilit]
- Khadiev, K.; Ibrahimov, R.; Yakaryılmaz, A. New Size Hierarchies for Two Way Automata. Lobachevskii J. Math. 2018, 39, 997–1009. [Google Scholar]
- Dwork, C.; Stockmeyer, L.J. A time complexity gap for two-way probabilistic finite-state automata. SIAM J. Comput. 1990, 19, 1011–1123. [Google Scholar] [CrossRef] [Scilit]
- Ablayev, F.; Khadiev, K. Extension of the hierarchy for k-OBDDs of small width. Russ. Math. 2013, 53, 46–50. [Google Scholar] [CrossRef] [Scilit]
- Shepherdson, J.C. The reduction of two–way automata to one-way automata. IBM J. Res. Dev. 1959, 3, 198–200. [Google Scholar] [CrossRef] [Scilit]
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
