<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Ultrametric Automata with One Head Versus Multihead Nondeterministic Automata?</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Maksims Dimitrijevs</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Irina Scegulnaja</string-name>
          <email>irina.scegulnaja@gmail.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>University of Latvia, Faculty of Computing</institution>
          ,
          <addr-line>Raina bulvaris 19, Riga, LV-1586</addr-line>
          ,
          <country country="LV">Latvia</country>
        </aff>
      </contrib-group>
      <fpage>13</fpage>
      <lpage>19</lpage>
      <abstract>
        <p>The idea of using p-adic numbers in Turing machines and nite automata to describe random branching of the process of computation was recently introduced. In the last two years some advantages of ultrametric algorithms for nite automata and Turing machines were explored. In this paper advantages of ultrametric automata with one head versus multihead deterministic and nondeterministic automata are observed.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        Addition, subtraction, multiplication and division of p-adic numbers are done
the same way like natural numbers. p-adic numbers are widely used in chemistry
[
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], molecular biology [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] and mathematics [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], and were rst described in 1897
by Kurt Hensel. More about p-adic numbers and mathematical operations is
written by David A. Madore in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
      </p>
      <p>We will also need an absolute value or norm, which is a distance from zero.
It's denoted by jjxjj and has the following properties:
1. jjxjj = 0 if and only if x = 0,
2. jjx yjj = jjxjj jjyjj,
3. jjx + yjj
jjxjj + jjyjj.</p>
      <p>0; if x = 0
p-norm will be: jjxjjp =</p>
      <p>Norm is called ultrametric if jjx + yjj max(jjxjj; jjyjj).</p>
      <p>
        If p is a prime number, then the p-adic ordinal of a, denoted by ordpa, is the
highest power of p which divides a. Accordingly for any rational number x, it's
(1=pordpx; if x 6= 0
[
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
3
      </p>
    </sec>
    <sec id="sec-2">
      <title>Ultrametric Automata</title>
      <p>
        Ultrametric automata are described in more details by Rusins Freivalds [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. He
had also introduced some speci c de nitions of ultrametric automata. Here we
will describe some basics of ultrametric automata.
      </p>
      <p>Most principles of the work of ultrametric automata are in common with
probabilistic automata. Compared to deterministic automaton, probabilistic
automaton has a stochastic vector (vector of probabilities) instead of one beginning
state. Transitions also have probabilities and can be represented with the help
of stochastic matrices. One matrix shows transitions for one speci c letter of the
input alphabet. Probabilistic automaton also has a threshold, and input word is
accepted if and only if the sum of probabilities of every accepting state exceeds
threshold after input word is read.</p>
      <p>Ultrametric automaton has an additional element - prime number p.
Probabilities of transitions are p-adic numbers, and are called amplitudes. Ultrametric
automaton doesn't have limitation for beginning state vector and transition
matrices to be stochastic. While probabilistic automaton has an accepting
threshold, ultrametric automaton has an accepting interval, which is represented by
two real numbers. After reading input word amplitude of every accepting state
is transformed into p-norm. If sum of such p-norms belongs to an accepting
interval, input word is accepted.
4</p>
    </sec>
    <sec id="sec-3">
      <title>Multihead Automata</title>
      <p>M ultihead automata are similar to nite automata with one head. Transition
function will be di erent - it will be in the following form: S (A [ f`; ag)k !
S f 1; 0; 1gk where k is number of heads, S is the set of states, A is an input
alphabet, ` is left end-marker, a is right end-marker. f 1; 0; 1gk means, that
every one of k heads can:
{ move one symbol to the left on the input word, if value is -1;
{ stay on the same symbol of the input word, if value is 0;
{ move one symbol to the right on the input word, if value is 1.</p>
      <p>
        If head is on the left end-marker it can't move to the left, and, respectively,
it can't move to the right, if it is on the right end-marker. Here were mentioned
main principles of how di ers two-way multihead deterministic nite automaton
from two-way deterministic nite automaton with one head. In the case of
oneway automata head can't move to the left. More precise de nition can be found
in [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ].
      </p>
      <p>In the case of nondeterministic and ultrametric nite automata de nition
will di er with the fact that we have to deal with multiple heads. So, the only
di erence will be in the transition function. It will be like transition function of
deterministic multihead automata, but transitions will be made with amplitudes.
5</p>
      <p>
        Advantages of Multihead Ultrametric Automata
It is known that one-way deterministic nite automata with k heads are weaker
(can recognize fewer languages) than one-way nondeterministic nite automata
with k heads for k 2 [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. Using these results we can prove theorem for multihead
ultrametric automata.
      </p>
      <p>Theorem 1. For every prime number p for every k 1 set of languages
recognized by one-way deterministic nite automata with k heads is a proper subset
of the set of languages, that can be recognized by one-way p-ultrametric nite
automata with k heads.</p>
      <p>
        Proof. For k = 1 let's take language L1 = fw2wrev2jw 2 f0; 1g g where wrev
consists of the same letters, as w, but in opposite order. In [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] it was proven,
that for every prime p we can construct one-way p-ultrametric automaton with
one head that can recognize the language L1. Language is not regular, so it can't
be recognized by one-way deterministic nite automaton with one head. On the
other hand, ultrametric automata can recognize all the languages that can be
recognized by deterministic automata.
      </p>
      <p>We can transform any nondeterministic automaton into p-ultrametric. In
this case we will keep all states and transitions of nondeterministic automaton,
all beginning states will have amplitude 1, all transitions will be made with
amplitude 1 and input word will be accepted by ultrametric automaton if p-norm sum
of all accepting states will be greater than 0. Resulting ultrametric automaton
does not depend on parameter p. This means that one-way ultrametric automata
with k heads are at least as powerful as one-way nondeterministic automata with
k heads. For every k 2 for every prime number p the set of languages
recognizable by one-way deterministic nite automata with k heads is a proper subset
nite automata with
2 we obtain that for automata with
of set of languages recognizable by one-way p-ultrametric
k heads.</p>
      <p>From parts of proof for k = 1 and k
k heads condition holds for every k 1.</p>
      <p>Now let's take a look at situation where we can reduce the number of heads
for ultrametric automata compared to deterministic ones.</p>
      <p>
        Theorem 2. For every prime number p for every k 1 there is a language
which can be recognized by one-way p-ultrametric nite automaton with 2 heads
and cannot be recognized by one-way deterministic nite automaton with k heads.
Proof. In [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] it is shown that there is a language L which can be recognized
by one-way nondeterministic nite automaton with two heads and cannot be
recognized by one-way deterministic nite automaton with k heads for any k.
Like in the proof of the rst theorem we can replace nondeterministic automaton
with p-ultrametric automaton for any prime number p.
6
      </p>
      <p>
        Power of Ultrametric Automata with One Head
There is a proof that for one-way deterministic and nondeterministic nite
automata class of languages recognizable by automaton with k + 1 head is wider
than class of languages recognizable by automaton with k heads, for all
natural k 1 [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. This was proven by using language Lb, which is de ned for all
positive natural numbers b in the following way: Lb = fw1 w2 ::: w2bj(wi 2
f0; 1g ) ^ (wi = w2b+1 i) f or all 1 i 2bg. This was proven with the help
of theorem which says, that one-way deterministic and nondeterministic nite
automaton with k heads recognizes language Lb if and only if b k2 [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ].
Theorem 3. For every integer k 1 for every prime number p there exist
languages that cannot be recognized by one-way deterministic or nondeterministic
automaton with k heads, but can be recognized by one-way p-ultrametric nite
automaton with one head.
      </p>
      <p>Proof. We will construct 2-adic automaton that recognizes language Lb. For each
1 i b we will make set of states which will check equality of the corresponding
pair of fragments, that is, if wi = w2b+1 i. Fragment for one such pair is shown
on g. 1.</p>
      <p>In the states of bottom row on g. 1 there is a check for fragment length
equality. Beginning amplitude is 1. When automaton is reading fragment wi every
symbol of the fragment multiplies amplitude by 2. Then automaton goes further
on the row of states until it will reach fragment w2b+1 i. While reading this
fragment every symbol will divide amplitude by 2. Amplitude will be equal to 1
if and only if both fragments had same length. Then after reading whole input
word -1 will be added to amplitude, so amplitude of accepting state will be equal
to 0 if condition of fragment equality holds.</p>
      <p>Upper two rows on g. 1 ensure check for matching of symbol "1" positions
in corresponding fragments wi and w2b+1 i. In the rst row automaton walks
through states until it reaches fragment wi. Then in the next step symbols "1"
and their positions are counted, and amplitude after reading fragment gets equal
n 1
to P ai2i, where n is length of the fragment and ai equals to 1 if i-th symbol was
i=0
1, else ai equals to 0. After reading fragment sum is stored in the accepting state.
Second row of states in the similar way ensures nding of fragment w2b+1 i and
n 1
then from the accepting state P ai2i is being subtracted in the similar way. As
i=0
a result amplitude of accepting state will be equal to 0 if and only if positions of
symbol "1" in both fragments were the same.</p>
      <p>If both conditions hold after reading the input word (that means, if fragments
wi and w2b+1 i are equal), then both accepting states will have amplitude 0. So
p-norm sum of accepting states will be equal to 0 if and only if wi = w2b+1 i.
Else p-norm sum of accepting states will be equal to some positive number.</p>
      <p>For every fragment pair wi and w2b+1 i same checks for equality will be
made, but in the sets of states will be di erent amount of states that ensure
nding of the fragment that we are interested in. In the similar way p-norm sum
of accepting states will be equal to 0 if and only if fragments of pair are equal.
Else mentioned p-norm sum will be equal to some positive number. By counting
together p-norms of accepting states of all sets of that kind we will get 0 if and
only if input word belongs to Lb. In this way we can construct 2-adic automaton
to recognize language Lb for every positive integer b. By taking b too big (b &gt; k2
respectively) one-way deterministic or nondeterministic nite automaton with
k heads won't be able to recognize language Lb.</p>
      <p>To prove a theorem for all prime numbers p we can replace amplitude 2 with
p in all places where we were multiplying or dividing by 2. So the theorem holds
for every prime number p.</p>
      <p>In fact we can easily expand the set of the languages that can be recognized by
one-way ultrametric nite automaton with one head and cannot be recognized
by one-way deterministic or nondeterministic automaton with xed arbitrary
amount of heads. When de ning languages we can take as base language Lb,
but this time every fragment wi will consist of n letter alphabet instead of two
letter alphabet f0; 1g. Situation will be similar to language Lb, but this time
p-ultrametric automaton will have to check positions of n 1 symbols of input
alphabet instead of one symbol (in the example of language Lb such symbol was
"1"). This can result in the increase of number of states.</p>
      <p>Results obtained in this chapter and possibility to transform nondeterministic
automaton with k heads into p-ultrametric automaton with k heads for any prime
number p can give us another result about hierarchy of multihead automata.
Theorem 4. For every k 1 for every prime number p the set of languages
recognizable by one-way nondeterministic nite automata with k heads is a proper
subset of the set of languages recognizable by one-way p-ultrametric nite
automata with k heads.</p>
      <p>Proof. In the proof of Theorem 1 we can see that for every number of heads k 1
one-way ultrametric automata are at least as powerful, as one-way
nondeterministic automata. We can use Theorem 3 to say that for every prime number
p for every number of heads k 1 one-way p-ultrametric automaton will be able
to recognize some languages that cannot be recognized by one-way
nondeterministic automata.
7</p>
    </sec>
    <sec id="sec-4">
      <title>Summary</title>
      <p>Ultrametric automata can have better place in the hierarchy of multihead
automata than nondeterministic automata. All begins with the fact that one head
of ultrametric automaton can do more than one head of deterministic or
nondeterministic automaton. For any xed number of heads k one-way k-head
ultrametric automata are stronger than one-way k-head deterministic and
nondeterministic automata.</p>
      <p>In some cases ultrametric automata with one head can recognize languages
better than multihead deterministic and nondeterministic automata. The
research made shows potential of the heads of ultrametric automata and researches
will be continued to nd the place of ultrametric automata in the hierarchy of
multihead automata.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Freivalds</surname>
          </string-name>
          , R.:
          <article-title>Ultrametric automata and Turing machines</article-title>
          .
          <source>17th International Conference on Developments in Language Theory (DLT</source>
          <year>2013</year>
          ), Paris, France (
          <year>June 2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Khrennikov</surname>
          </string-name>
          , A.Y.:
          <source>NonArchimedean Analysis: Quantum Paradoxes, Dynamical Systems and Biological Models</source>
          . Kluwer Academic Publishers (
          <year>1997</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Dragovich</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Dragovich</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>A p-adic Model of DNA Sequence</article-title>
          and
          <article-title>Genetic Code. p-adic Numbers, Ultrametric Analysis</article-title>
          ,
          <source>and Applications</source>
          , vol.
          <volume>1</volume>
          , No 1,
          <fpage>34</fpage>
          -
          <lpage>41</lpage>
          (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Vladimirov</surname>
            ,
            <given-names>V.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Volovich</surname>
            ,
            <given-names>I.V.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Zelenov</surname>
            ,
            <given-names>E.I.:</given-names>
          </string-name>
          <article-title>p-Adic Analysis</article-title>
          and
          <source>Mathematical Physics</source>
          . World Scienti c (
          <year>1995</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Madore</surname>
            ,
            <given-names>D.A.</given-names>
          </string-name>
          :
          <article-title>A rst introduction to p-adic numbers</article-title>
          . http://www.madore.org/ david/math/padics.pdf (revised
          <year>2000</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Koblitz</surname>
          </string-name>
          , N.:
          <article-title>p-adic Numbers, p-adic Analysis</article-title>
          ,
          <source>and Zeta-Functions. Springer, 2nd edition</source>
          (
          <year>1984</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Holzer</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kutrib</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Malcher</surname>
          </string-name>
          , A.:
          <string-name>
            <surname>Multi-Head Finite</surname>
            Automata: Characterizations, Concepts and
            <given-names>Open</given-names>
          </string-name>
          <string-name>
            <surname>Problems</surname>
          </string-name>
          . Graduate Texts in Mathematics, vol.
          <volume>58</volume>
          . http://arxiv.org/pdf/0906.3051v1.
          <string-name>
            <surname>pdf</surname>
          </string-name>
          (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Dimitrijevs</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Scegulnaja</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Freivalds</surname>
          </string-name>
          , R.:
          <source>Complexity Advantages of Ultrametric Machines, 40th International Conference on Current Trends in Theory and Practice of Computer Science (SOFSEM</source>
          <year>2014</year>
          ), Novy Smokovec, Vysoke Tatry,
          <string-name>
            <surname>Slovakia</surname>
          </string-name>
          (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Yao</surname>
            ,
            <given-names>A.C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rivest</surname>
          </string-name>
          , R.L.
          <article-title>: k + 1 Heads are better than k</article-title>
          . Massachusetts Institute of Technology, Cambridge, Massachusetts (
          <year>1977</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>