Structure Analysis on the $k$-error Linear Complexity for $2^n$-periodic Binary Sequences

In this paper, in order to characterize the critical error linear complexity spectrum (CELCS) for $2^n$-periodic binary sequences, we first propose a decomposition based on the cube theory. Based on the proposed $k$-error cube decomposition, and the famous inclusion-exclusion principle, we obtain the complete characterization of $i$th descent point (critical point) of the k-error linear complexity for $i=2,3$. Second, by using the sieve method and Games-Chan algorithm, we characterize the second descent point (critical point) distribution of the $k$-error linear complexity for $2^n$-periodic binary sequences. As a consequence, we obtain the complete counting functions on the $k$-error linear complexity of $2^n$-periodic binary sequences as the second descent point for $k=3,4$. This is the first time for the second and the third descent points to be completely characterized. In fact, the proposed constructive approach has the potential to be used for constructing $2^n$-periodic binary sequences with the given linear complexity and $k$-error linear complexity (or CELCS), which is a challenging problem to be deserved for further investigation in future.

1. Introduction. The linear complexity of a sequence s, denoted as L(s), is defined as the length of the shortest linear feedback shift register (LFSR) that can generate s. According to the Berlekamp-Massey algorithm [9], if the linear complexity of a sequence s is L(s), and 2L(s) consecutive elements of the sequence are known, then the whole sequence can be determined. So the linear complexity of a key sequence should be large enough to resist known plain text attack. As a measure on the stability of linear complexity for sequences, the weight complexity and sphere complexity were defined in the monograph by Ding, Xiao and Shan in 1991 [2]. Similarly, Stamp and Martin [13] introduced the k-error linear complexity, which is in essence the same as the sphere complexity. Specifically, suppose that s is a sequence with period N . For any k(0 ≤ k ≤ N ), the k-error linear complexity of s, 2010 Mathematics Subject Classification. Primary: 94A55, 94A60; Secondary: 11B50. Key words and phrases. Periodic sequence, linear complexity, k-error linear complexity, cube theory, k-error cube decomposition.
The research was partially supported by Anhui Natural Science Foundation (No.1208085MF106) and Provincial Natural Science Research Project of Anhui Colleges (No.KJ2013Z025).
The reviewing process of the paper was handled by Changzhi Wu as Guest Editor.
denoted as L k (s), is defined as the smallest linear complexity that can be obtained when any k or fewer elements of the sequence are changed within one period. The reason why people study the stability of linear complexity is that a small number of element changes may lead to a sharp decline of linear complexity. How many elements have to be changed to reduce the linear complexity? Kurosawa et al. in [7] introduced the concept of minimum error(s) to deal with the problem, and defined it as the minimum number k for which the k-error linear complexity is strictly less than the linear complexity of sequence s, which is determined by 2 W H (2 n −L(s)) , where W H (a) denotes the Hamming weight of the binary representation of an integer a. In [10], for the period length p n , where p is an odd prime and 2 is a primitive root modulo p 2 , a relationship is established between the linear complexity and the minimum value k for which the k-error linear complexity is strictly less than the linear complexity. In [14], for sequences over GF (q) with period 2p n , where p and q are odd primes, and q is a primitive root modulo p 2 , the minimum value k is presented for which the k-error linear complexity is strictly less than the linear complexity.
In another research direction, Rueppel [12] derived the number of 2 n -periodic binary sequences with given linear complexity L, 0 ≤ L ≤ 2 n . For k = 1, 2, Meidl [11] characterized the complete counting functions on the k-error linear complexity of 2 n -periodic binary sequences with linear complexity 2 n . For k = 2, 3, Zhu and Qi [18] further gave the complete counting functions on the k-error linear complexity of 2 n -periodic binary sequences with linear complexity 2 n − 1. By using algebraic and combinatorial methods, Fu et al. [4] characterized the 2 n -periodic binary sequences with the 1-error linear complexity and derived the counting function completely for the 1-error linear complexity of 2 n -periodic binary sequences. The complete counting functions for the number of 2 n -periodic binary sequences with the 3-error linear complexity are characterized recently in [15].
The CELCS (critical error linear complexity spectrum) is studied in [8,3]. The CELCS of a sequence s consists of the ordered set of points (k, L k (s)) satisfying L k (s) > L k (s), for k > k. In fact they are the points where a decrease occurs for the k-error linear complexity, and thus are called descent points.
Kurosawa et al. in [7] gave an important result about the first descent point of the k-error linear complexity. Due to its difficulty, the second descent point is rarely investigated in literature. In this paper, we propose a k-error cube decomposition for 2 n -periodic binary sequences to investigate the ith descent point of the k-error linear complexity. By applying the famous inclusion-exclusion principle in combinatorics, we obtain the complete characterization of the ith descent point of the k-error linear complexity for i = 2, 3.
One of our main results is that there exists a k-error cube decomposition for a given 2 n -periodic binary sequence. With a given series of linear complexity values L(c (0) ), L(c (1) ), L(c (2) ), · · · , L(c (m) ), our focus is how to construct a sequence s (n) with the right k-error cube decomposition s (n) = c (0) + c (1) + c (2) + · · · + c (m) , so that L(c (i) ) = L (i) (s (n) ), where L (i) (s (n) ) is the k-error linear complexity of the ith descent point for s (n) .
In previous research, investigators focus on the linear complexity and k-error complexity for a given sequence. In this paper, the motivation of this paper is to construct 2 n -periodic binary sequences with the given linear complexity and k-error linear complexity (or CELCS), and this is a more challenging problem with broad applications.
The rest of this paper is organized as follows. In Section II, we first give an outline about our main approach for characterizing CELCS for 2 n -periodic binary sequences. Also some preliminary results are presented. In Section III, the k-error cube decomposition for 2 n -periodic binary sequences is proposed to investigate the ith descent point of the k-error linear complexity. By applying the famous inclusionexclusion principle, the complete characterization of the ith descent point of the k-error linear complexity is presented for i = 2, 3. Concluding remarks are given in Section IV.
The Hamming weight of an N -periodic sequence s is defined as the number of nonzero elements in per period of s, denoted by W H (s). Let s N be one period of s. If N = 2 n , s N is also denoted as s (n) . The absolute distance of two elements is defined as the difference of their indexes.
The linear complexity of a 2 n -periodic binary sequence s can be recursively computed by the Games-Chan algorithm [5] stated as follows. Step 1. If Lef t(s) = Right(s), then deal with Lef t(s) recursively. Namely, L(s) = L(Lef t(s)).
Repeat Step 1 and Step 2 recursively until one element is left.
The following two lemmas are well known results on 2 n -periodic binary sequences. Please refer to [11,18,15] for details.  Suppose that the linear complexity of s can decrease when at least k elements of s are changed. By Lemma 2.2, the linear complexity of the binary sequence, in which elements at exactly those k positions are all nonzero, must be L(s). Therefore, for the computation of the k-error linear complexity, we only need to find the binary sequence whose Hamming weight is the minimum and its linear complexity is L(s).
Based on Games-Chan algorithm, the following lemma is given in [11].
Rueppel [12] presented the following preliminary result on the number of sequences with a given linear complexity.
Based on algebraic and combinatorial methods, Fu et al. [4] characterized the 2 n -periodic binary sequences with the 1-error linear complexity and derived the counting function completely for the 1-error linear complexity of 2 n -periodic binary sequences. Meidl [11] characterized the complete counting functions on the 1-error linear complexity of 2 n -periodic binary sequences with linear complexity 2 n . Zhu and Qi [18] gave the complete counting functions on the 2-error linear complexity of 2 n -periodic binary sequences with linear complexity 2 n − 1.
In this paper, in order to characterize CELCS (critical error linear complexity spectrum), we will use the Cube Theory recently introduced in [16,17]. Cube theory and some related results are presented next for completeness.
Suppose that the position difference of two non-zero elements of a sequence s is (2x + 1)2 y , where x and y are non-negative integers. From Algorithm 2.1, only in the (n − y)th step, the sequence length is 2 y+1 , so the two non-zero elements must be in the left and right half of the sequence respectively, thus they can be removed or reduce to one non-zero element in consequence operation. Therefore we have the following definitions.
Definition 2.5. ( [16,17]) Suppose that the position difference of two non-zero elements of a sequence s is (2x+1)2 y , where both x and y are non-negative integers. Then the distance between the two elements is defined as 2 y . Definition 2.6. ( [16,17]) A non-zero element of sequence s is called a vertex. Two vertexes can form an edge. If the distance between the two elements (vertices) is 2 y , then the length of the edge is defined as 2 y . Definition 2.7. ( [16,17]) Suppose that s is a binary sequence with period 2 n , and there are 2 m non-zero elements in s, and 0 ≤ i 1 < i 2 < · · · < i m < n. If m = 1, then there are 2 non-zero elements in s and the distance between the two elements is 2 i1 , so it is called as a 1-cube. If m = 2, then s has 4 non-zero elements which form a rectangle, the lengths of 4 edges are 2 i1 and 2 i2 respectively, so it is called as a 2-cube. In general, s has 2 m−1 pairs of non-zero elements, in which there are 2 m−1 non-zero elements which form a (m − 1)-cube, the other 2 m−1 non-zero elements also form a (m − 1)-cube, and the distance between each pair of elements are all 2 im , then the sequence s is called as an m-cube, and the linear complexity of s is called as the linear complexity of the cube as well.
As demonstrated in [16,17], the linear complexity of a 2 n -periodic binary sequence with only one cube has the following nice property.
Theorem 2.8. Suppose that s is a binary sequence with period 2 n , and non-zero elements of s form a m-cube. If lengths of edges are Proof. We give a proof based on Algorithm 2.1.
In the kth step, 1 ≤ k ≤ n, if and only if one period of the sequence can not be divided into two equal parts, then the linear complexity should be increased by half period. In the kth step, the linear complexity can be increased by maximum 2 n−k .
Suppose that non-zero elements of sequence s form a m-cube, lengths of edges are i 1 , i 2 , · · · , i m (0 ≤ i 1 < i 2 < · · · < i m < n) respectively. Then in the (n − i m )th step, one period of the sequence can be divided into two equal parts, then the linear complexity should not be increased by 2 im .
· · · · · · In the (n − i 2 )th step, one period of the sequence can be divided into two equal parts, then the linear complexity should not be increased by 2 i2 .
In the (n − i 1 )th step, one period of the sequence can be divided into two equal parts, then the linear complexity should not be increased by 2 i1 . Therefore, L(s) = 1 + 1 The proof is complete now.
Based on Algorithm 2.1, we may have a standard cube decomposition for any binary sequence with period 2 n . Algorithm 2.2 Input: s (n) is a binary sequence with period 2 n . Output: A cube decomposition of sequence s (n) .
Step 3. If Lef t(s (n) ) = Right(s (n) ), then we consider Lef t(s (n) ) Right(s (n) ). In this case, some nonzero elements of s may be removed.
Step 4. After above operation, we can obtain one nonzero element. Now by only restoring the nonzero elements in Right(s (n) ) removed in Step 2, so that Lef t(s (n) ) = Right(s (n) ). In this case, we obtain a cube c 1 with linear complexity L(s (n) ).
Step 5. With s (n) c 1 , run Step 1 to Step 4. We obtain a cube c 2 with linear complexity less than L(s (n) ).
Step 6. With these nonzero elements left in s (n) , run Step 1 to Step 5 recursively we will obtain a series of cubes in the descending order of linear complexity.
Obviously, this is a cube decomposition of sequence s (n) , and we define it as the standard cube decomposition. One can observe that cube decomposition of a sequence may not be unique in general and the standard cube decomposition of a sequence described above is unique.
Next we use a sequence {1101 1001 1000 0000} to illustrate the decomposition process.
As Lef t = Right, then we consider Lef t Right. Then the cube {1000 0000 1000 0000} is removed.

3.
A constructive approach for computing descent points of the k-error linear complexity. How many elements have to be changed to decrease the linear complexity? For a 2 n -periodic binary sequence s (n) , Kurosawa et al. in [7] showed that the first descent point of the k-error linear complexity is reached by k = 2 W H (2 n −L(s (n) )) , where W H (a) denotes the Hamming weight of the binary representation of an integer a.
In this section, first, the k-error cube decomposition of 2 n -periodic binary sequences is developed based on the proposed cube theory. Second we investigate the formula to determine the second descent point for the k-error linear complexity of 2 n -periodic binary sequences based on the linear complexity and the first descent points for the k-error linear complexity. Third we study the formula to determine the third descent points for the k-error linear complexity based on the linear complexity, the first and second descent points for the k-error linear complexity.
For clarity of presentation, we first introduce some definitions. Let k (i) denote the ith descent point of the k-error linear complexity, where i > 0. We define S(a) as the binary representation of an integer a, and W H (S(a)) denotes the Hamming weight of S(a). We further define L (i) (s (n) ) as the k-error linear complexity of the ith descent point for a 2 n -periodic binary sequence s (n) , and define S(s (n) ) = S(2 n − L(s (n) )) where i ≥ 0 and L(s (n) ) is also denoted as L (0) (s (n) ). For a given binary digit representation S 1 , one can prove easily that there exists only one linear complexity value L 1 = 2 n − (2 i1 + 2 i2 + · · · + 2 im ), where 0 ≤ i 1 < i 2 < · · · < i m < n, such that S 1 = S(2 n − L 1 ). In this case, we define To obtain our main results, we first present the following lemma.
Lemma 3.1. Let s (n) be a 2 n -periodic binary sequence. Assume that the second last decent point of k-error linear complexity of s (n) is (k (j) , L (j) (s (n) )). Then L (j) (s (n) ) is achieved by a cube c (j) exactly.
By the definition of k-error linear complexity, the smallest k-error linear complexity greater than 0 is achieved by a cube c (j) , which can be constructed by c m , some nonzero elements of c 1 , c 2 , · · · , c m−1 and adding some new nonzero elements to s (n) . Other nonzero elements of c 1 , c 2 , · · · , c m−1 will be changed to zero.
Suppose that there are x nonzero elements in c m , the number of nonzero elements of c 1 , c 2 , · · · , c m−1 used by c (j) is y, and the number of nonzero elements of c 1 , c 2 , · · · , c m−1 not used by c (j) is z, where x > y > 0, z ≥ 0. To construct c (j) , one has to add a 2 n -periodic binary sequence e (n) j to s (n) , where e (n) j has x − y + z nonzero elements. Note that the number of nonzero elements in s (n) is x + y + z. So x − y + z < x + y + z. Thus c (j) has the smallest k-error linear complexity greater than 0.
It is easy to see that c (j) is not unique for some 2 n -periodic binary sequences. For example, let Based on Lemma 3.1, next we present a very fundamental theorem regarding CELCS, followed by an important definition called the k-error cube decomposition.
Next we give some examples in different situations to illustrate Theorem 3.2.   16. This is the case of i).
From part one of Theorem 3.2, one can see that there exists a k-error cube decomposition for a given 2 n -periodic binary sequence. Next we will use part two of Theorem 3.2 to find the second and third descent points.
In fact, Chang and Wang proved this result in Theorem 3 of [1], with a much complicated approach.
Next we investigate the computation of the third descent point for the k-error linear complexity based on the linear complexity, the first and second descent points for the k-error linear complexity. Before present our main result, we first give a special result.
The above result is for the ith descent point computation in some special cases. Next we will investigate the third descent point in general. First, we give the the famous principle of inclusion-exclusion in combinatorics for finite sets A 1 , · · · , A n , which can be stated as follows.
Based on the principle of inclusion-exclusion, we give the following important theorem on the third descent point.
In this case, 2 × 2 W H (S(c (0) )∩S(c (1) )∩S(c (2) )) additional nonzero elements will be cancelled in c (0) + c (1) + c In other cases, if we move the first 2 W H (S(c (0) )∩S(c (1) )∩S(c (2) )) nonzero elements in c (2) similarly as above, one can find that nonzero elements will not be reduced after adding operation of these three sequences.