Representation and simulating of extended Markov chains over a finite field with a predefined precision

A method is proposed for representing and simulating the extended Markov chains of a defined type by minimal polynomials over finite field GF(q). Simulation problem is being solved as a problem of constructing the minimal polynomial over field GF(q) using the Berlekamp-Massey algorithm. The polynomial produces a sequence of the length of N. A stochastic matrix relevant to that sequence approximates the given stochastic matrix of an extended Markov chain with a predefined precision proportional to the 1/N value. The polynomial constructed defines unambiguously the structure of a q-ary linear shift register for simulating extended Markov chains. The method allows constructing the implementations of this class of Markov sequences on linear q-ary shift registers with a pre-defined “linear complexity” defined by the value of N.


Introduction
This paper deals with the problem of modeling random discrete processes from the class of extended Markov chains (EMCs) [1] obtained based on simple Markov chains (MCs) [2]. Extending an MC allows gathering more information regarding the process under research. Random EMC-class sequences are characterized by the "tracked" (according to terms introduced by A.G. Postnikov [3]) daisy-chain links. In an EMC, the current state determines the future behavior of the system after r steps and can be used to forecast the system behavior.
Brunce-Markov chains [2] are a special case of EMC, which are defined by A.A. Markov as "nontrue" chains in [4]. The law (stochastic matrix) of a Markov-Brunce chain is defined in [2]. In [1], the problem of defining the stochastic EMC matrix is solved for a special case. In [5,6], algorithms are represented to build a stochastic EMC matrix sized m r ×m r , m ≥ 2, r ≥ 2. [5] shows that, with some limitations on defining the EMC, the stochastic EMC matrix can be considered as the law of a certain r-complicated MC [2], r ≥ 2. [6,7] represent a method of simulating EMCs on polynomial models described by polynomial functions over field GF (2 n ). Within such approach, the problem of constructing polynomial models is solved as a problem of computing polynomial coefficients over field GF(2 n ), based on the predefined stochastic matrices. A challenging task in presenting MCs over field GF (2 n ) is to reduce the field order.
In [6,8], an approach is proposed to simulate by the Berlekamp-Massey algorithm (BMA) [9] with minimal polynomials [10] over finite field GF(q), q ≥ 2, of a certain class [6] of nonuniform Markov chains defined by ergodic stochastic matrices [1] and lumped Markov chains [8] defined by regular Let us form from that initial chain, similarly to [1], a new, extended Markov chain as follows [5]. Compose all possible character strings s j  S with the length of r = v + κ, r ≥ 2, v ≥ 1, κ ≥ 1, , and represented as (s j 1 , s j 2 , …, s j v , s j v+1 , …, s j v+κ ). The adjacent strings contain κ = r -v common characters and v ("shift size") different characters.
Suppose the initial chain sequentially transfers within 2v + κ -1 steps from a certain state s j 1 into s j 2 , then from s j 2 into s j 3 , …, and from s j (2v+κ−1) into s j (2v+κ) . We will consider adjacent strings having the length of r as one step of transferring the new process from state (s j 1 , …, s j v , s j v+1 , …, s j v+κ ) into state (s j v+1 , …, s j 2v , s j 2v+1 , …, s j 2v+κ ). This new, extended process (extended Markov chain) is MC having m v+κ states (character strings s j with the length of r, We will further consider the EMC states ordered lexicographically: Denote by Q the stochastic matrix sized m v+κ ×m v+κ = t×t of that EMC. Define EMC-matrix Q through matrix P of the initial MC for v ≥ 2, κ ≥ 2 in accordance with [5]. For a special case, v = κ = 1, this problem was solved in [1]. Let us obtain EMC-matrix Q, based on the concept of "intermediary" stochastic matrix [5] sized m v+κ ×m v+κ =t×t, to be computed based on matrix P of the initial MC. We will denote the intermediary matrix by W = (w ij ), Suppose the matrix P = (p ij ), , is given. Then define the matrix W in accordance with [5] by formula (1) where E and ξ m are the unity matrix and the column vector sized m r-2 ×m r-2 and m respectively; - is the symbol of the operation of Kronecker (tensor) product [11] of matrices; -C = |B 0 B 1 … B m-1 | is a matrix sized m×m 2 that is a sequential concatenation of matrices B i = ( )    For r = 2 (v = κ = 1), we will obtain matrix P (2) shown in Figure 2. Non-zero elements of the matrix W are computed by formula [5,6]: where i is the current row number of matrix W and d is the current column number of matrix P. EMC-matrix Q is connected to the matrix W by relation [5,6] where (W) v is the v th power of matrix W, v ≥ 1, and κ ≥ 1.
Let us introduce the EMC definition based on matrix Q. Definition. We will name a Markov chain with the stochastic matrix Q indicated (3) and sized m v+κ ×m v+κ , v ≥ 1, κ ≥ 1, obtained by ergodic stochastic matrix P = (p ij ) sized m×m, Note the following properties of an EMC represented by matrix (3). Theorem 1 [5]. Suppose we are given matrix P = (p ij ), p ij > 0, , and EMC-matrix Q sized m r ×m r , r = v + κ ≥ 2, v ≥ 1, κ ≥ 1, is obtained based on it. Then this EMC is ergodic.
EMC ergodicity for r = v + κ = 2, v = 1, κ = 1, is shown in [1]. The limiting stochastic vector of EMC-matrix Q can be defined similarly to [1, p. 183] by relation Statement. Suppose we are given matrix P = (p ij ), p ij > 0, , and the EMC-matrix Q sized m r ×m r , r = v + κ ≥ 2, v = 1, κ ≥ 1, is obtained based on it. Then this matrix Q defines the stochastic matrix of an r-complicated MC with transition probabilities defined by the elements of matrix P.
The validity of the statement follows from the algorithm [5] of constructing matrix Q.

Problem statement for simulating a given EMC indicated (3) over field GF(q) by minimal polynomials
We will use the term of "sequence over field GF(q)" for any function u: Z → GF(q) defined within set Z of nonnegative integers and taking its values within field GF(q) [10]. The sequence u = (u i ), i  Z, is called an L-order linear recurrence sequence (LRS) over field GF(q), if there are constants b 0 , b 1 is called the characteristic polynomial of LRS [10].
The vector ũ = (u(0), …, u(L-1)) is the initial vector of LRS. Characteristic polynomial of LRS u, having the minimal power, is its minimal polynomial [10]. Let us denote LRS u of random length N by  [10], where the power of polynomial f(x) determines the number of q-ary bits of the register, while the coefficients are a form of feedback. We will consider the minimal polynomial indicated (4) and constructed over field GF(q) by the Berlekamp-Massey algorithm [9] as the characteristic polynomial of the LRS that can be obtained based on LSR.
The matrix Q indicated (3) can, in accordance with [12], be associated via algorithm [12] of approximating elements w ij , (5) and the limiting vector of matrix  P is Assume that: 1) The error of approximating matrix Q by matrix (8) 2) The value ε is associated with N linear relation [12] N ≥ N * , For assumption (7)-(9), the reachable precision of approximating the elements of matrix Q by elements ) ( ij p depends linearly on N. The problem being solved is stated 1) as a problem of constructing by the Berlekamp-Massey algorithm the minimal polynomial over field GF(q), describing sequence u N with the length of N, such that stochastic matrix , sized t×t and relevant to that sequence, must approximate the given stochastic matrix Q with a given precision proportional to the 1/N value; and 2) as constructing based on the obtained minimal polynomial of LSR, which allows reproducing sequence u N with the length of N.
3. Method representing and simulating extended Markov chains, based on the minimal polynomial Let us introduce value N ' satisfying condition while power L of polynomial f(x) satisfies condition 2L ≤ N ' + 1.
The proof of Theorem 2 can be constructed in accordance with the scheme of proving theorem 2 presented in [8] Based on matrix (α ij ), two vectors, 6. Binary matrix D = (d ij ), , is computed by algorithm [12]. Matrix D must meet the following conditions: (13) Existence of matrix D is proven in [12]. Algorithm [12] used to compute matrix D is similar to that of constructing the maximum matching in two-partite graph [13] (unities are re-distributed among lines and columns in accordance with the conditions (13)).
Elements of vectors k and r are changed in computing matrix D.
Assume matrix D to be a zero matrix in the beginning. It starts being filled with unities as follows. As long as 0   j r and 0   i k , for each i th line being searched through (starting from 0 to t1), , are searched through: -If conditions c ij = 1 and d ij = 0 are met (the unity has not been placed into a cell yet) and r j > 0 (r j unities can still be placed in the j th column), then we set d ij = 1, and the counters of the number of unities by columns (r j = r j -1) and lines (k i = k i -1) are decreased; -Otherwise, in the j th column, element d kj = 1, 1 , 0   i k (to which the unity has been assigned earlier) is searched for; if it exists, the following is replaced: d kj = 0 and d ij = 1.

Elements
, of the required matrix P φ are computed as Correctness of the algorithm used in constructing matrix P φ is confirmed in [12], while its computational complexity is O(t 4 ) [12].
, both satisfying conditions (5)- (11). Solving this problem is comprehensively described in [14], where sequence u N ' + 1 is constructed by the algorithm of isolating Euler's chains [13], including the probabilistic procedure [14] of choosing by matrix P φ an arc in each vertex. Stage 4. Let us code the characters of alphabet Y with the elements of field GF(q), where q ≥ t. Based on sequence u N ' + 1 , we will construct minimal L-power polynomial f(x) using the software implementation [15] of BMA, where L satisfies condition (12) of theorem 2. We keep initial vector ũ = (u(0), …, u(L-1)) of sequence u N ' + 1 in the memory.
It should be noted that Berlekamp-Massey algorithm construct, based on sequence u N+1 , the only minimal polynomial f(x) with the order of L satisfying condition (12), which follows from the theorem below.
Theorem 3 [9]. Suppose there is an N-long sequence u N consisting of the elements of field GF(q). Then, based on sequence u N , Berlecamp-Massey algorithm constructs the only minimal polynomial with order L satisfying condition 2L ≤ N.
The polynomial constructed unambiguously identifies matrix P φ . Stage 5. Based on the L-order polynomial f(x) obtained, we construct the software implementation of LSR [15] with the length of L and q-ary bits, where L is defined by expression It should be noted that Berlekamp-Massey algorithm constructs by sequences u N+1 the only Lorder minimal polynomial f(x) satisfying condition (12). Having defined u~ as the initial state of LSR, we obtain sequence u N ' + 1 with the length of N ' +1 and law P φ at the i th output, i 1, L , of the qary bit of the LSR program model.

Conclusion
The problem of simulating extended Markov chains and a certain type of complicated Markov chains by minimal polynomials over a finite field is solved in our study as a problem of constructing by Berlekamp-Massey algorithm a minimal polynomial over field GF(q), characteristics q ≥ 2. Polynomial is developing a sequence of a length, so that stochastic matrix P φ , relevant to that sequence and having a predefined precision proportional to the value of 1/N, approximates the initial ergodic stochastic matrix Q. The precision of representing stochastic matrices Q by minimal polynomials depends linearly on the polynomial order.
The solution proposed includes the following stages: 1) By the pre-defined ergodic stochastic matrix Р sized m×m, we will compute EMC-matrix Q sized m r ×m r . 2) By the pre-defined Q, ε, and N ≥ N * , we construct matrix