Probabilistic, frequency and quantum automata on ...

3 downloads 0 Views 298KB Size Report
way probabilistic finite automaton but not by any 1-way probabilistic finite automata. On the other hand, such a distinction is not possible for frequency finite ...
Probabilistic, frequency and quantum automata on omega-words ? Ieva Rukˇs¯ ane, Rihards Kriˇslauks, Taisia Mischenko-Slatenkova, Ilze Dzelme-B¯erzi¸na, R¯ usi¸nˇs Freivalds, Ieva N¯agele Institute of Mathematics and Computer Science, University of Latvia, Rai¸ na bulv¯ aris 29, Riga, LV-1459, Latvia

Abstract. Frequency computation was introduced in 1960-ies in an attempt to show that many properties of probabilistic algorithms can be simulated by purely deterministic computational devices. The aim of this paper is to show that for automata working on infinite input tapes the situation is very much different. Technically our main result shows that there is an ω-language recognized with a bounded error by a 2way probabilistic finite automaton but not by any 1-way probabilistic finite automata. On the other hand, such a distinction is not possible for frequency finite automata.

1

Introduction

Pascal and Fermat believed that every event of indeterminism can be described by a real number between 0 and 1 called probability. Quantum physics introduced a description in terms of complex numbers called amplitude of probabilities and later in terms of probabilistic combinations of amplitudes most conveniently described by density matrices. Physicists are well aware that physical indeterminism is a complicated phenomenon and probabilistical models are merely reasonably good approximations of reality. The problem ”What is randomness?” has always been interesting not only for philosophers and physicists but also for computer scientists. The term ”nondeterministic algorithm” has been deliberately coined to differ from ”indeterminism”. Probabilistic (randomized) algorithms is one of central notions in Theory of Computation. However, since long ago computer scientists have attempted to develop notions and technical implementations of these notions that would be similar to but not equal to randomization. The notion of frequency computation was introduced by G. Rose [40] as an attempt to have an absolutely deterministic mechanism with properties similar to probabilistic algorithms. The definition was as follows. A function f : w → w is (m, n)-computable, where 1 ≤ m ≤ n, iff there exists a recursive function R: ?

The research was supported by Project 2009/0216/1DP/1.1.1.2.0/09/IPIA/VIA/044 from the European Social Fund.

wn → wn such that, for all n-tuples (x1 , · · · , xn ) of distinct natural numbers, card{i : (R(x1 , · · · , xn ))i = f (xi )} ≥ m. R. McNaughton cites in his survey [34] a problem (posed by J. Myhill) whether f has to be recursive if m is close to n. This problem was answered by B.A. Trakhtenbrot [44] by showing that f is recursive whenever 2m > n. On the other hand, B.A. Trakhtenbrot [44] proved that if 2m = n then nonrecursive functions can be (m, n)-computed. E.B. Kinber extended the research by considering frequency enumeration of sets [27]. The class of (m, n)-computable sets equals the class of recursive sets if and only if 2m > n. The notion of frequency computation can be extended to other models of computation. Frequency computation in polynomial time was discussed in full detail by M.Hinrichs and G.Wechsung [26]. For resource bounded computations, the behavior of frequency computability is completely different: for e.g., whenever n0 − m0 > n − m, it is known that under any reasonable resource bound there are sets (m0 , n0 )-computable, but not (m, n)-computable. However, scaling down to finite automata, the analogue of Trakhtenbrot’s result holds again: We show here that the class of languages (m, n)-recognizable by deterministic finite automata equals the class of regular languages if and only if 2m > n. Conversely, for 2m > n, the class of languages (m, n)-recognizable by deterministic finite automata [3] is uncountable for a two-letter alphabet. When restricted to a one-letter alphabet, then every (m, n)recognizable language is regular. This was also shown by Kinber. Frequency computations became increasingly popular when relation between frequency computation and computation with a small number of queries was discovered [31, 25, 6, 11]. However, there still remains a fundamental problem: is there a class of automata A such that probabilistic A-automata can perform an action such that no frequency automaton can, and is there a class of automata B such that frequency A-automata can perform an action such that no probabilistic automaton can. The study of finite state automata working on infinite words was initiated by B¨ uchi [8]. B¨ uchi discovered connection between formulas of the monadic second order logic of infinite sequences (S1S) and ω-regular languages, the class of languages over infinite words accepted by finite state automata. Few years later, Muller proposed an alternative definition of finite state automata on infinite words [37]. McNaughton proved that with Muller’s definition, deterministic finite state automata recognize all ω-regular languages [35]. Later, Rabin extended the decidability result of B¨ uchi for S1S to the monadic second order of the infinite binary tree (S2S) [39]. Rabin theorem can be used to settle a number of decision problems in logic. A theory of automata over infinite words has started from these studies. In the paper, we study probabilistic and frequency finite state automata over infinite words. The probabilistic variants of the finite state automata over infinite words have been recently introduced [5]. I. Dzelme-B¯erzi¸na has extensively studied ω-language recognition by quantum automata. She has proved that B¨ uchi

quantum finite state automata with bounded error accept a proper subset of the limit languages. She has also shown that Streett acceptance condition is more powerful than B¨ uchi acceptance condition also for quantum case.

2 2.1

Definitions and notations Notation

This section is devoted to the notations used in the paper. Σ denotes a finite set of symbols called alphabet. A word is a sequence of symbols from Σ. The set Σ ∗ represents the set of all finite words over alphabet Σ, where Σ ω is the set of all infinite words over alphabet Σ. For infinite word α we write α = α(0)α(1)α(2)... with α(i) ∈ Σ. A set of infinite words over a given alphabet is called an ωlanguage. The number of occurrences of the symbol a in an infinite word (ω-word) α is denoted by |α|a . For a given ω-word α ∈ Σ ω , let Occ(α) = {a ∈ Σ|∃i, α(i) = a} be the finite set of symbols occurring in α and Inf (α) = {a ∈ Σ|∃ω j, α(j) = a} where ∃ω denotes the quantifier ”there exists infinite many”. Definition 1. ω-languages. Let U ⊆ Σ ∗ be a language of finite strings. The limit U , lim(U ) = {α ∈ Σ ω |∃ω n ∈ N0 : α[0..n] ∈ U }. An ω-word belongs to lim(U ) iff it has infinitely many prefixes in U. 2.2

Classical automata

In this section, first the basic concepts of ω-automata are presented (for more details refer to [24], [43]) and then the ω - quantum finite state automata and group finite state ω-automata are introduced. Definition 2. An ω-automaton is a quintuple A = (Q, Σ, δ, q0 , Acc), where – – – – –

Q is a finite set of states, Σ is a finite alphabet, δ : Q × Σ → 2Q is the state transition function, q0 ∈ Q is the initial state, Acc is the acceptance component.

In a deterministic ω-automaton, a transaction function δ : Q × Σ → Q is used. The acceptance component can be given in the different ways. We will consider three different definitions of acceptance component (they will be explained below). Definition 3. Let A = (Q, Σ, δ, q0 , Acc) be an ω-automaton. A run of A on an ω-word α = α1 α2 ... ∈ Σ ω is an infinite state sequence ρ = ρ(0)ρ(1)ρ(2)... ∈ Qω , such that the following holds: 1. ρ(0) = q0

2. ρ(i) ∈ δ(ρ(i − 1), αi ) for i > 0 if A is a non-deterministic finite state ωautomaton and ρ(i) = δ(ρ(i − 1), αi ) for i > 0 if A is a deterministic finite state ω-automaton. The acceptance condition Acc defines which of the infinite runs are accepting. In this paper we consider the three types of acceptance conditions. Definition 4. A B¨ uchi acceptance condition Acc is a subset F of Q, where the elements of F are called accepting states. An infinite run ρ = ρ(0)ρ(1)... is called B¨ uchi accepting if Inf (ρ) ∩ F 6= ∅, it means that run ρ visits the states of F infinitely often. Definition 5. A Streett acceptance condition Acc is a finite set of pairs (Hi , Ki ) where Hi and Ki are subsets of Q (Acc = {(H1 , K1 ), ..., (Hs , Ks )}). An infinite run ρ = ρ(0)ρ(1)... is called Streett accepting if for each i ∈ {1, 2, ..., s} Inf (ρ) ∩ Hi 6= ∅ or Inf (ρ) ∩ Ki = ∅. Definition 6. A Rabin acceptance condition Acc is a finite set of pairs (Hi , Ki ) where Hi and Ki are subsets of Q (Acc = {(H1 , K1 ), ..., (Hs , Ks )}). An infinite run ρ = ρ(0)ρ(1)... is called Rabin accepting if there is some i ∈ {1, 2, ..., s} for which Inf (ρ) ∩ Hi = ∅ and Inf (ρ) ∩ Ki 6= ∅. The Streett condition is dual to the Rabin condition. It is therefore sometimes called complemented pair condition. B¨ uchi acceptance condition can be considered as the special case of Streett {(F, Q)} and Rabin acceptance {(∅, F )} conditions. ω-automata with B¨ uchi acceptance condition are called B¨ uchi automata, with Streett acceptance condition - Streett automata, and with Rabin acceptance condition - Rabin automata. The accepted language of the ω-automaton A (L(A)) is defined as a set of infinite words α ∈ Σ which have accepting run in A. It is known that the classes of languages accepted by non-deterministic B¨ uchi automata (NBA), deterministic Streett automata (DSA), non-deterministic Streett automata (NSA), deterministic Rabin automata (DRA), non-deterministic Rabin automata (NRA) are the same. These are ω-regular languages and can be represented by ω-regular expressions (finite sums of expressions in the form αβ ω , where α and β are regular expressions over finite words, and language defined by β is non-empty and does not contain empty string). Deterministic B¨ uchi automata (DBA) are less powerful, the class of DBA is a proper subclass of the ω-regular languages, DBA recognize limit languages.

2.3

Quantum automata

Quantum finite state automata have also different notations. In this paper we will adapt a definition of measure-once quantum finite state automata [36] for infinite words.

Definition 7. A quantum finite state ω-automaton is a quintuple A = (Q, Σ, δ, q0 , Acc) – Q is a finite set of states, – Σ is a finite input alphabet, – δ is the transition function δ : Q × Σ × Q → C[0,1] , which represents the amplitudes that flows from the state q ∈ Q to the state q 0 ∈ Q after reading symbol σ ∈ Σ, – q0 ∈ Q is the initial state, – Acc is the acceptance component. For all states q1 , q2 , q 0 ∈ Q and symbols σ ∈ Σ, the function δ must be unitary, thus the transition function satisfies the condition  P 1 (q1 = q2 ) 0 )δ(q , σ, q 0 ) = δ(q , σ, q . 1 2 q0 0 (q1 6= q2 ) The linear superposition of the automaton’s A states is represented by a n-dimensional complex unit vector, where n = |Q|. The superposition is dePn noted by |φi = i=1 αi |qi i, where {|qi i} is the set orthonormal basis vectors corresponding to the states of the automaton A. The transition function δ is represented by a set of unitary matrices {Vσ }σ∈Σ , where Vσ is the unitary transition P of the automaton A after reading the symbol σ and is defined by Vσ (| qi) = q0 ∈Q δ(q, σ, q 0 ) | q 0 i. A computation of the automaton A on an input word α = a1 a2 a3 .... ∈ Σ ω proceeds as follows. It starts computation in the superposition | q0 i, a transition corresponding to the current input letter is performed. Definition 8. Let A = (Q, Σ, δ, q0 , Acc) be a quantum finite state ω-automaton. A run of A on an ω-word α = a1 a2 ... ∈ Σ ω is an P infinite sequence of superpon sitions ψω = |ψ(0)i|ψ(1)i|ψ(2)i..., where |ψ(j)i = i=1 αi |qi i ({|qi i} is the set of the automaton’s A states), such that the following holds: 1. | ψ(0)i =| q0 i 2. | ψ(i)i = Vai | ψ(i − 1)i for i > 0. The acceptance condition can be viewed in the similar way as for classical ω-automata. In this paper, we examine quantum finite state ω-automata with B¨ uchi, Streett and Rabin acceptance condition and we use the abbreviations: QBA for B¨ uchi quantum finite state automata, QSA for Streett quantum finite state automata, and QRA for Rabin quantum finite state automata. Definition 9. A superposition |φi = Q) if P

Pn

qi ∈F

i=1

αi |qi i is called Fp - accepting (F ⊆

|αi |2 ≥ p,

where p is acceptance probability of the superposition.

Definition 10. A B¨ uchi acceptance condition for quantum case Acc is a subset F of Q, where the elements of F are called accepting states. An infinite run ψω = |ψ(0)i|ψ(1)i|ψ(2)i... is called B¨ uchi accepting with probability p if run ψω visits Fp -accepting superpositions infinitely often. Definition 11. A Streett acceptance condition Acc is a finite set of pairs (Hi , Ki ) where Hi and Ki are subsets of Q (Acc = (H1 , K1 ), ..., (Hs , Ks ). An infinite run ψω = |ψ(0)i|ψ(1)i|ψ(2)i... is called Streett accepting with probability p if for each i ∈ {1, 2, ..., s} ψω contains infinite number of Hi p accepting superpositions or ψω contains only finite number of Ki p accepting superpositions. Definition 12. A Rabin acceptance condition Acc is a finite set of pairs (Hi , Ki ) where Hi and Ki are subsets of Q (Acc = (H1 , K1 ), ..., (Hs , Ks ). An infinite run ψω = |ψ(0)i|ψ(1)i|ψ(2)i... is called Rabin accepting with probability p if there is some i ∈ {1, 2, ..., s} for which ψω contains only finite number of Hi p -accepting and Ki p -accepting superpositions. The language accepted by a quantum finite state ω-automaton A with the alphabet Σ and cut-point λ, denoted Lλ (A), is defined as set of infinite words σ ∈ Σ that have accepting run with probability p > λ in A. A quantum finite state ω-automaton accepts language with bounded error if there exists an  > 0 such that for all accepting runs probability is greater than λ + .

3

Results

R.Freivalds [14] proved that the language {0n 1n } can be recognized by 2-way probabilistic finite automata with an arbitrarily high probability 1− . Our main result considers the language L = {0m1 1n1 20m2 1n2 2 · · · } where each word in L contains infinitely many symbols 2, and X 2−nk k∈R

diverges where R = {k|mk = nk }. Theorem 1. (1) There exists a 2-way probabilistic finite automaton recognizing the language L with probability 1. (2) There exists no 1-way probabilistic finite automaton recognizing the language L with a bounded error. (3) There exists a 2-way quantum finite automaton recognizing the language L with probability 1. (4) There exists no 1-way quantum finite automaton recognizing the language L with a bounded error.

The proof of this Theorem is based on a classical result from theory of probabilities. Borel-Cantelli lemma. If E1 , E2 , . . . is a sequence of independent random events P with probabilities p1 , p2 , . . . then: -if i pi diverges then with probability 1 infinitely many of the events E1 , E2 , . . . have Pa positive outcome, -if i pi converges then with probability 1 only a finite number of the events E1 , E2 , . . . has a positive outcome. Proof of Theorem 1. (1) Let c() and d() be large natural numbers such that 2c() d() 1 ) > 1 − . 2( )d() <  , ( 2 1 + 2c() Let the input substring x be of a form 0mk 1nk . The automaton processes alternately the block of zeros and the block of ones. One processing of a block is a series of options when c() random symbols 0 or 1 are produced per every letter in the block. We call the processing to be positive if all the results are 1, and negative otherwise. If the length of the block is n then the probability of a positive processing of it equals 2−n.c() . We interpret a processing of an ordered pair of blocks 0m 1n as a competition. A competition where one processing is positive and the other one is negative is interpreted as a win of the block processed positively. The automaton holds competitions until the total number of wins for the given blocks of zeros and ones reaches d(). If at this moment the blocks 0mk and 1nk has at least one win each, our ω-automaton enters a special state qE . If all the wins belong to one of the blocks 0mk or 1nk , then our ω-automaton enters a special state qF . After that the ω-automaton reads the symbol 2, enters a spacial state qS , goes to competitions of the blocks 0mk+1 and 1nk+1 and never returns to blocks with smaller indices. A set of states of this ω-automaton is declared to be accepting iff it contains the states qS and qE but does not contain the state qF . Let an ω-word be in the ω-language L. Then it contains infinitely many symbols 2. Hence the state qS is entered infinitely often. Additionally, where R = {k|mk = nk }. Hence by Borel-Cantelli lemma, the state qE is entered infinitely often with probability 1. X

2−nk

k∈R

diverges Let an ω-word be not in the ω-language L because it contains only a finite number of symbols 2. Then the state qS is not entered infinitely often. Let an ω-word be not in the ω-language L because X 2−nk k∈R

diverges. Then by Borel-Cantelli lemma, the state qE by Borel-Cantelli lemma, the state qE is entered infinitely often with probability 1 is entered only a finite number of times. (2) Assume on the contrary that there exists a 1-way probabilistic finite automaton A recognizing L with a probability 1 − δ where 21 > δ > 0. Let r be a natural number such that 1 − (1 + 1r )δ > 12 . Consider an ω-word x = 0m1 1n1 20m2 1n2 2 · · · 20ms 1ns 2 · · · ∈ L. For arbitrary moment t of the processing x by A denote by p1 (t), p2 (t), · · · , pk (t) the distribution of probabilities of the states q1 , q2 , · · · , qk of the automaton A. Now consider a sequence of ω-words differing from x only in the s-th subword 0ms 1ns : x1 = 0m1 1n1 20m2 1n2 2 · · · 20ms +1 1ns +1 2 · · · x2 = 0m1 1n1 20m2 1n2 2 · · · 20ms +2 1ns +2 2 · · · ··· m 1 n1

xu = 0

1 20

m2 n2

1 2 · · · 20ms +u 1ns +u 2 · · · ···

Since x ∈ L, all these ω-words are in L and hence A accepts them. Consider distribution of probabilities of the states of A at moments when A crosses the gap between 0ms +u and 1ns +u . Since all pi (t) are real numbers between 0 and 1, and there are infinitely many ω-words xu , there must exist an accumulation point p1 (∞), p2 (∞), · · · , pk (∞) such that for arbitrary  > 0 there exists a u such that the distance between p1 (u), p2 (u), · · · , pk (u) and p1 (∞), p2 (∞), · · · , pk (∞) is less than . Hence there are two distinct u1 and u2 such that the distance between the distributions p1 (u1 ), p2 (1 ), · · · , pk (u1 ) and p1 (u2 ), p2 (2 ), · · · , pk (u2 ) is less that 0ms +u 1ns +u . Hence the probability to accept the word xcombined containing a combined subword 0ms +u1 1ns +u2 differs from the probability to accept xu1 or xu2 no more that for rδ . The same construction in the fragment 0ms +u+1 1ns +u+1 using smaller value 0 δ = 2δ gives another combined ω-word where both the u-th and u + 1-th fragments are corrupted. This way after infinitely many substitutions we get an ω-word which is accepted with a probability 1 − 32 δ but the word is not in L because it contains infinitely many fragments where mu 6= nu . (3) Similar to (1). (4) Similar to (2). t u Lemma 1. For arbitrary natural number z there is natural number w such that if any 2-way deterministic finite automaton A recognizes an ω-language, has z states and reads all symbols on the input tape, then there is a constant c such that the automaton crosses any point on the input tape no more than c times.

Proof. For arbitrary 2-way deterministic finite automaton recognizing an ω-language and having z states and an arbitrary point t on the input tape, by l(j) and r(j) we define two reflection functions {1, 2, · · · , z} → {1, 2, · · · , z} describing the state ql(j) (or qr(j) , resp.) in which the automaton returns to the point t after being crossed in the state qj in the direction from the right to the left (or from the left to the right, resp.). It is easy to see that for a fixed automaton the function l(j) depends only on the first t symbols of the ω-word and not on the tail of the word. A crossing sequence of the automaton A on an ω-word x at a point t is the sequence of the states qk1 , qk2 , · · · , qks at the moments when the automaton crosses the point t. If qku = qku+2v the qku = qku+2v = qku+4v = · · · and the crossing sequence is infinitely long. This cannot happen if A reads all symbols on the input tape. Hence c ≤ 2z. t u Lemma 2. If the ω-words x and y are such that they have points t1 and t2 where the crossing sequences of A are exactly the same then the combined word w obtained by taking the head of x till the point t1 and the tail of y after the point t2 then the crossing sequence of A on w at the point t1 coinsides with the two crossing sequences of A on x and y at the points t1 and t2 , respectively, and A accepts w iff A accepts y. t u

Proof. Immediate.

Theorem 2. (1) There exists no 2-way deterministic finite automaton recognizing the language L. (2) There exists no 2-way frequency finite automaton recognizing the language L with frequency (n, n). (3) There exists no 2-way frequency finite automaton recognizing the language L with frequency (m, n) where m > n2 . Proof. (1) Assume from the contrary that there exists a 2-way deterministic finite automaton A recognizing L. Every automaton recognizing L is to read all symbols on the input tape. By Lemma 1, the length of every crossing sequence of A does not exceed c. Consider an ω-word x = 0m1 1n1 20m2 1n2 2 · · · 20ms 1ns 2 · · · ∈ L. For arbitrary point t denote by p1 (t), p2 (t), · · · , pk (t) the crossing sequence of A at t. Now consider a sequence of ω-words differing from x only in the s-th subword 0ms 1ns : x1 = 0m1 1n1 20m2 1n2 2 · · · 20ms +1 1ns +1 2 · · · x2 = 0m1 1n1 20m2 1n2 2 · · · 20ms +2 1ns +2 2 · · · ··· m 1 n1

xu = 0

1 20

m2 n2

1 2 · · · 20ms +u 1ns +u 2 · · · ···

Since x ∈ L, all these ω-words are in L and hence A accepts them. Consider the crossing sequences of A at points between 0ms +u and 1ns +u . There are only a finite number of possible crossing sequences of length not exceeding c. Hence there are two distinct u1 and u2 such that the crossing sequence is the same. Consider the word xcombined containing a combined subword 0ms +u1 1ns +u2 but otherwise the same as the considered words. By Lemma 2 is also accepted by A. Repeating this construction for infinitely many values of u we get an ω-word which is accepted by A but which is not in L. Contradiction. (2) This part of our Theorem is not implied immediately from (1) because even a (2, 2)-automaton can use the other tape as a counter. For instance, the ω-language M = {0m1 1n1 20m2 1n2 2 · · · | (∃b)(∀s)(ms = ns = b)} can be recognized by a deterministic finite (2, 2)-automaton but not by a deterministic finite (1, 1)-automaton. However, we prove below that L cannot be recognized by any (n, n)-automaton. Indeed, assume from the contrary that there exists a 2-way deterministic finite (n, n)-automaton A recognizing L. Consider a natural number b , an ω-word x = 0b 1b 20b 1b 2 · · · 20b 1b 2 · · · and an n-tuple of ω-words x01 = 0120b 1b 20b 1b 2 · · · 20b 1b 2 · · · x02 = 02 12 20b 1b 20b 1b 2 · · · 20b 1b 2 · · · ··· x0n = 0n 1n 20b 1b 20b 1b 2 · · · 20b 1b 2 · · · These words are in L. Hence A accepts all of them. It means that there is there is an accepting set of states Q1 = {qk1 , qk2 , · · · , qkd } and a moment t such that when A processes this n-tuple of ω-words after the moment t1 only states from Q1 are entered and each state from Q1 is entered infinitely many times. Now we consider a natural number u such that it is larger than the lengths of all initial fragments of x01 , · · · , x0n observed by A till the moment t1 . Denote by y01 , y02 , · · · , y0n the initial fragments of x01 , x02 , · · · , x0n , respectively, of the length u. Consider an infinite sequence of n-tuples of ω-words which differ only in the first component but have the same x02 , x03 , · · · , x0n . The first component are, respectively, y01 0120b 1b 20b 1b 2 · · · 20b 1b 2 · · · y01 02 12 20b 1b 20b 1b 2 · · · 20b 1b 2 · · · ··· s s

b b

y01 0 1 20 1 20b 1b 2 · · · 20b 1b 2 · · · ···

Since the sequence is infinite but, by Lemma 2, the possibilities for the crossing sequences are limited, there two distinct n-tuples in this sequence such that A cannot distinguish between them and, moreover, enters only states from Q1 are entered and each state from Q1 is entered infinitely many times. Let the two ntuples have indices i and j in our sequence. Consider a combined first component y01 0i 1j 20b 1b 20b 1b 2 · · · 20b 1b 2 · · · . After the moment t1 A enters only the states from Q1 on this combined n-tuple. Now let t2 be a moment after t1 such that each state from Q1 is entered at least once between moments t1 and t2 . Again we consider an infinite sequence of n-tuples of ω-words which differ only in one component. However, now this component is the second component. This way, we cyclically change the components and in the limit we get an n-tuple of ω-words which is accepted but each component of which has infinitely many subwords 0m 1n where m 6= n. Contradiction. Now consider a sequence of ω-words differing from x only in the s-th subword 0ms 1ns : x1 = 0m1 1n1 20m2 1n2 2 · · · 20ms +1 1ns +1 2 · · · x2 = 0m1 1n1 20m2 1n2 2 · · · 20ms +2 1ns +2 2 · · · ··· xu = 0m1 1n1 20m2 1n2 2 · · · 20ms +u 1ns +u 2 · · · ··· Since x ∈ L, all these ω-words are in L and hence A accepts them. (3) We use the easily observable property of L showing that if an ω-word x is in L then changing any finite initial fragment of x we again obtain an ω-word y ∈ L. Assume from the contrary that L is recognized by (m, n)-automaton A such that m > n2 . We wish to construct an (n, n)-automaton for L. Given any x, we construct n distinct ω-words x1 , x2 , · · · , xn by adding initial fragments 012, 00112, 0001112, · · · , 000 · · · 111 · · · 2 to x, applying A to them and producing the result which coincides with the majority of the results of A on x1 , x2 , · · · , xn . This is a contradiction since we already proved in (2) impossibility of such an automaton. t u

References 1. Farid M. Ablayev, R¯ usi¸ nˇs Freivalds. Why sometimes probabilistic algorithms can be more effective. Lecture Notes in Computer Science, vol. 233, pp. 1–14, 1986. 2. D. Aharonov, A. Kitaev and N. Nisan. Quantum Circuits with Mixed States. STOC, (1998) 20–30. 3. Holger Austinat, Volker Diekert, Ulrich Hertrampf, Holger Petersen. Regular frequency computations. Theoretical Computer Science, vol. 330 No. 1, pp. 15–20, 2005. 4. Christel Baier, Marcus Gr¨ osser, Nathalie Bertrand. Probabilistic ω-Automata. Journal of the ACM, vol. 59, No. 1, doi 10.1145/ 2108242.2108243, 2012.

5. Christel Baier, Marcus Gr¨ osser. Recognizing ω-regular languages with probabilistic automata. Proc. of the 20th IEEE Symposium on Logic in Computer Science, pp. 137–146, 2005. 6. Richard Beigel, William I. Gasarch, Efim B. Kinber. Frequency computation and bounded queries. Theoretical Computer Science, vol. 163, No. 1/2, pp. 177–192, 1996. 7. A. Brodsky, N. Pippenger: Characterizations of 1-Way Quantum Finite Automata. SIAM Journal on Computing, vol. 31, No. 5, pp. 1456–1478, 2002. 8. J.R.B¨ uchi: On a decision method in restricted second order arithmetic. Z. Math. Logik Grundlag. Math, 6 (1960) 66–92 9. Cristian Calude. What Is a Random String? Journal of Universal Computer Science, vol. 1, No. 1, pp. 48–66, 1995. 10. Cristian Calude. Algorithmic Randomness, Quantum Physics, and Incompleteness. Lecture Notes in Computer Science, vol. 3354, pp. 1–17, 2005. 11. John Case, Susanne Kaufmann, Efim B. Kinber, Martin Kummer. Learning recursive functions from approximations. Journal of Computer and System Sciences, vol. 55, No. 1, pp. 183–196, 1997. 12. A.N.Degtev. On (m,n)-computable sets. Algebraic Systems, Edited by D.I. Moldavanskij, Ivanovo Gos. Universitet, pp. 88–99, 1981. 13. Ilze Dzelme-B¯erzi¸ na. Mathematical logic and quantum finite state automata. Theoretical Computer Science, vol. 410, No. 20, pp. 1952–1959, 2009. 14. R¯ usi¸ nˇs Freivalds. Probabilistic Two-Way Machines. Lecture Notes in Computer Science, vol 118, pp. 33–45, 1981. 15. R.Freivalds. On the growth of the number of states in result of the determinization of probabilistic finite automata. Avtomatika i Vichislitel’naya Tekhnika, No. 3, pp. 39–42, 1982 (Russian) 16. R¯ usi¸ nˇs Freivalds, Marek Karpinski. Lower Space Bounds for Randomized Computation. Lecture Notes in Computer Science, 820:580-592, 1994. 17. R¯ usi¸ nˇs Freivalds. Complexity of probabilistic versus deterministic automata. Lecture Notes in Computer Science, vol. 502, pp. 565–613, 1991. 18. R¯ usi¸ nˇs Freivalds. Inductive Inference of Recursive Functions: Qualitative Theory. Lecture Notes in Computer Science, vol. 502, pp. 77–110, 1991. 19. R¯ usi¸ nˇs Freivalds, J¯ anis B¯ arzdi¸ nˇs, K¯ arlis Podnieks. Inductive Inference of Recursive Functions: Complexity Bounds. Lecture Notes in Computer Science, vol. 502, pp. 111–155, 1991. 20. R¯ usi¸ nˇs Freivalds. Models of computation, Riemann Hypothesis and classical mathematics. Lecture Notes in Computer Science, vol.1521, pp. 89–106, 1998. 21. R¯ usi¸ nˇs Freivalds. Non-constructive methods for finite probabilistic automata. International Journal of Foundations of Computer Science, vol. 19, No. 3, pp.565– 580, 2008. 22. R¯ usi¸ nˇs Freivalds. Amount of nonconstructivity in finite automata. Theoretical Computer Science, vol. 411, No. 38-39, pp.3436–3443, 2010. 23. E.M. Gold. Language identification in the limit. Information and Control, vol. 10, No. 5, pp. 447–474, 1967. 24. E. Gr¨ adel, W. Thomas, T. Wilke, editors: Automata, Logics, and Infinite Games: A Guide to Current Research. Lecture Notes in Computer Science 2500. Springer. (2002) 25. Valentina Harizanova, Martin Kummer, Jim Owings. Frequency computations and the cardinality theorem. The Journal of Symbolic Logic, vol. 57, No. 2, pp. 682–687, 1992.

26. Maren Hinrichs and Gerd Wechsung. Time bounded frequency computations. Information and Computation, vol. 139, pp. 234-257, 1997. 27. Efim B. Kinber. Frequency calculations of general recursive predicates and frequency enumeration of sets. Soviet Mathematics Doklady, vol. 13, pp. 873–876, 1972. 28. Efim B. Kinber. On frequency real-time computations. Teoriya Algoritmov i Programm, (Edited by Ya.M.Barzdin) vol. 2, pp. 174–182, 1973 (Russian) 29. Efim B. Kinber. Frequency computations in finite automata, Kibernetika, No. 2, pp. 7–15, 1976(Russian; English translation in Cybernetics 12 (1976) 179-187). 30. A. Kondacs, J. Watrous: On the power of quantum finite state automata. Proc. FOCS’97, (1997) 66–75. 31. Martin Kummer. A proof of Beigel’s Cardinality Conjecture. The Journal of Symbolic Logic, vol. 57, No. 2, pp. 677–681, 1992. 32. E.F. Moore. Gedanken-experiments on sequential machines. Automata Studies (Ann. of Math. Studies, No. 34), Princeton Univ. Press, Princeton, N.J., pp. 129– 153, 1956. 33. D.E. Muller. Infinite sequences an finite machines. Proc. 4th IEEE Symp. on Switching Circuit Theory and Logical Design, pp. 3–16, 1963. 34. Robert McNaughton. The Theory of Automata, a Survey. Advances in Computers, vol. 2, pp. 379–421, 1961. 35. R. McNaughton: Testing and generating infinite sequences by a finite automaton. Inform. Control, 9 (1966) 521–530 36. C.Moore, J.Crutchfield: Quantum automata and quantum grammars Theoretical Computer Science, 237 (2000) 275–306. 37. D.E. Muller: Infinite sequences an finite machines. Proc. 4th IEEE Symp. on Switching Circuit Theory and Logical Design, (1963) 3–16 38. Michael O. Rabin and Dana Scott. Finite automata and their decision problems. IBM Journal of Research and Development, vol. 3, No. 2, pp. 115–125, 1959. 39. M.O. Rabin: Decidability of second order theories and automata on infinite trees. Trans. AMS, 141 (1969) 1–37 40. Gene F. Rose. An extended notion of computability. Abstracts of International Congress for Logic, Methodology and Philosophy of Science, p.14, 1960. 41. Gene F. Rose and Joseph S. Ullian. Approximations of functions on the integers. Pacific Journal of Mathematics, vol.13 , No.2, pp.693–701, 1963. 42. Raymond M. Smullyan. Theory of Formal Systems, Annals of Mathematics Studies, No. 47, Princeton, N.J., 1961. 43. W. Thomas: Languages, Automata, and Logic. Handbook of Formal Languages 3, (1997) 389–455. 44. Boris A. Trakhtenbrot. On the frequency computation of functions. Algebra i Logika, vol. 2, pp.25–32, 1964 (Russian)