Combinatorial method of polynomial expansion of symmetric Boolean functions
CCOMBINATORIAL METHOD OF POLYNOMIAL EXPANSION OF SYMMETRIC BOOLEAN FUNCTIONS Danila A. Gorodecky The United Institute of Informatics Problems of National Academy of Sciences of Belarus, Minsk, 220012, Belarus, [email protected].
Abstract
A novel polynomial expansion method of symmetric Boolean functions is described. The method is efficient for symmetric Boolean function with small set of valued numbers and has the linear complexity for elementary symmetric Boolean functions, while the complexity of the known methods for this class of functions is quadratic. The proposed method is based on the consequence of the combinatorial Lucas theorem.
Keywords: polynomial expansion, symmetric Boolean function, carrier vector, reduced Zhegalkin spectrum, complexity
1. Introduction
The polynomial expansion is among the most complex tasks of the discrete mathematics. The polynomial expansion can be used to define the fifty-fifty distribution of 0 and 1 in the Steinhaus triangle, to synthesize modular summators, to find an algebraic immunity in cryptography and to solve various theoretical problems and practical applications. Because of high computational complexity of generation of the polynomial for an arbitrary Boolean function the universal methods of the polynomial expansion are not effective. Therefore the methods of generation of expansions for various classes of Boolean functions are more effective. One of these classes is symmetric Boolean functions (SBF). It is known many methods of the polynomial expansion of SBF. One of the most effective methods is the transeunt triangle method [1]. It has the complexity nO . The known methods have the redundant computations, i.e. the intermediate computations should be produced to generate the polynomial expansion. The article represents the method of the polynomial expansion with the complexity nO in particular cases. The method could be applied to solve the task of polynomial expansion, as well as the reverse task, i.e. representation of the function described by the polynomial. The method is based on the consequence of the combinatorial Lucas theorem, since it is referred as the combinatorial method.
2. Main definitions
An arbitrary Boolean function
XFF of the n variables, where n xxxX ...,,, , with unchanged value after swapping any couple of variables i x and j x , where ji and nji ,...,2,1, , is called SBF. SBF F of the n variables is characterised by the set of valued numbers r aaaFA ,...,, . The function F is equal 1 if and only if the set of variables n xxx ...,,, has exactly i a numbers of 1’s, where na i , ri and nr . These SBFs are referred as r aaan F ,...,, . If r , then a function XFF an is called elementary SBF (ESBF). There is one-to-one correspondence between SBF r aaan F ,...,, and n bits binary code n ...,,, – the carrier vector [2] (or the reduced truth vector [3]), where the i th entry is a value of the function F with the i numbers of 1’s, where ni . In other words, i if and only if the i is the valued number of the SBF F . The following formula is true for an arbitrary SBF F : XFXFXF ininiinini . (1) Positive polarity Reed-Muller polynomial (all variables are uncomplemented) is called as Zhegalkin polynomial and is referred as FP . SBF F of the n variables is called the polynomial-unate SBF (PUSBF or homogeneous SBF [4]), if the Zhegalkin polynomial form FP contains in i rank products with the i positive literals, where ni . This function referred as in EF . Hence it follows ,1 n E nn xxxE ... , nnnn xxxxxxE ...... , . . . nnn xxxE ... . In general case, the polynomial form FP of SBF XFF can be represented as: ,............ ... nnnnn n xxxxxxxxx xxxFP where n F ,...,,, is the reduced Zhegalkin (Reed-Muller) spectrum of SBF. It follows XEXE inini . (2) From the other hand PUSBF F of the n variables is characterised by the set of polynomial numbers q bbbEB ,...,, . The j th entry of the reduced Zhegalkin spectrum n E ,...,, is equal 1 if and only if j b , where qj and nq . If q , then a function bn E is called the elementary PUSBF (EPUSBF). The article provides the method of the transformation of the reduced truth vector F to the reduced spectrum F , i.e. q bbbn E ,...,, to q bbbn E ,...,, , and backwards, i.e. r aaan F ,...,, to r aaan F ,...,, .
3. Combinatorial method of generation of the carrier vector
The combinatorial method of the generating of the reduced truth vector q bbbn E ,...,, and the reduced spectrum r aaan F ,...,, is proposed below. bn E he process of the generating of the carrier vector bn E of the EPUSBF bn E could be demonstrated on the example. Example 1.
Let’s assume that it is necessary to get the carrier vector ...,,, for the PUSBF
XEXF . From the condition it follows that and
1 2 3 4 5 (3) E xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx . Note, that number of the column is equal to the number of factors in the column which are included in the polynomial of the function XE . The polynomial EP contains rank products. To generate the carrier vector ,,,,,, the i th entry i should be defined with the following arguments, where i : – assuming then E contains F . But it is impossible, because the polynomial (3) of XE doesn’t contain term 1. In this case E and therefore ; – assuming then E contains F . According to the definition of the ESBF F polynomial (3) is equal 1 for x and xxx . But it is impossible. In this case E and therefore ; – assuming then E contains F . According to the definition of the ESBF F polynomial (3) is equal 1 for xx and xxxx . Thus the only factor from the first column of the polynomial (3) is equal 1. In this case E and therefore ; – assuming then E contains FF . According to the definition of the ESBF F polynomial (3) is equal 1 for xxx and xxx . Thus the factors from the first and second columns of the polynomial (3) are equal 1. Since the number of the unity components is the odd number, then in this case E and therefore ; – assuming then E contains FFF . According to the definition of the ESBF F polynomial (3) is equal 1 for xxxx and xx . Since the factors from the first, second and third columns of the polynomial (3) are equal 1, then the number of the unity components is the even number. In this case E and therefore ; – assuming then E contains FFF . According to the definition of the ESBF F polynomial (3) is equal 1 for xxxxx and x . Since the factors from the first, second, third and fourth columns of the polynomial (3) are equal 1, then the number of the unity components is the even number. In this case E and therefore ; assuming then E contains FFF . According to the definition of the ESBF F polynomial (3) is equal 1 for xxxxxx . Since the factors from all columns of the polynomial (3) are equal 1, thrn the number of the unity components is the odd number. In this case E and therefore . As the result the carrier vector of the EPUSBF E is E and FFFEP . It is worth to pay attention to the fact that the value of the polynomial depends only on the parity number of unity factors. The reasoning used in the example 1 may be summarized with the theorem.
Theorem 1.
The i th entry i of the carrier vector n ,...,, of the PUSBF nbnbn xxxEE ,...,, is calculated by using the formula: ,0 ;2mod1,1 otherwisebiif i (4) where nbi , . Proof.
Let’s consider three cases of relations i and b . The first case where bi . Then the number of the unity terms i is less then the b rank products and bi E (see the first and second cases of the example 1). Therefore i . The second case where bi , i.e. b xxx and nbb xxx . Thus just one b rank term of the PUSBF bb E is equal 1 and bbb xxxEP (see the third case of the example 1). In this case i . The third case where bi , i.e. ib xxxx and ni xx . Thus the function bi E is represented by the polynomial i ibibiibbbbbi xxxxxxxxxxxxxxEP .................. . Since the value of bi EP is determined by even-odd of i . Thus .0 ;2mod1,1 otherwisebiifE bi In this case .0 ;2mod1,1 otherwisebiif i The statement of the theorem is proved. As a result of
Theorem 1 the carrier vector of the PUSBF bn E corresponds to the following form bn nbb ,...,,1,0...,,0,0 . (5) onsequence of the Lucas theorem is helpful for calculation using the formula (4). It determines the even-odd of the number bi and as follows. Theorem 2. (
Consequence of the Lucas theorem ) [5].
The number bn each bit of b is no more than the same bit of n , where bn in decimal representation. Note, that the binary length ,...,, nnnn and ,...,, bbbb is defined as n and b respectively. Example 2.
Let’s define even-odd of the number bn using Theorem 2 and assuming n and b for two cases a) b and b) b . The length of n is , then nnnnn , and a) , then bbb ; b) , then bbbb . For the case a) the binary representations b and n are comparable and satisfy the condition of Theorem 2, as pictured in Figure 1 a). For the case b) the binary representations of b and n are not comparable and do not satisfy the condition of Theorem 2, as pictured in Figure 1 b). As a result, in the case a) the number is the odd and thus ; in the case b) the number is the even and thus . Let's generate the carrier vector for the function in above example 1 using Theorem 1 and
Theorem 2 . Example 3.
Let’s assume that it is necessary to generate E . From the condition it follows E . According to the formula (5) , and ,,,,1,0,0 . Therefore, in order to find ,,, the even-odd order of the Binomial coefficients , , , respectively should be defined. From the Theorem 2 they could be defined as shown on figure 2. i i i i i b b b a) i i i i i b b b b) – not involved in the comparison – satisfied the condition of Theorem 2 – does not satisfy the condition of
Theorem 2 b Figure 1. Definition of even-odd of the numbers a) ; b) he figure 2 is analogous to representation as follows: ; ; ; . As the result the carrier vector is E and FFFEP . The procedure of calculating of the entries of the carrier vector using consequence of the Lucas theorem is called combinatorial methods. q bbbn E ,...,, The combinatorial method of generating of the carrier vector for the EPUSBF nbnbn xxxEE ,...,, can be generalized for an arbitrary PUSBF nbbbnbbbn xxxEE qq ,...,, with the following theorem. Theorem 3.
The i th entry i of the carrier vector nbbbn q E ...,,, of the PUSBF q bbbn E ,...,, is calculated with the following formula: ,0 ;2mod1...,1 otherwise bibibiif qi (6) where nbi ,1 . Note, that j bi for j bi is meaningless, where qj ,1 , therefore let’s assume j bi for j bi . The proof of Theorem 3 follows from
Theorem 1 . Example 4.
Let’s assume that it is necessary to generate E . From the condition it follows E . According to the formula (5) it follows and . Thus ,,,,,1,0,0,0,0,0 E . Figure 2. Definition of even-odd of the numbers , , , – not involved in the comparison – does not satisfy the condition of Theorem 2 – satisfy the condition of
Theorem 2 ccording to the formula (6) and Theorem 2 it is easy to define ,,, and as shown on the figure 3. The figure 3 is analogous to representation as follows: ; ; Figure 3. Calculating of the ,,,, for E – not involved in the comparison – does not satisfy the condition of Theorem 2 – satisfy the condition of
Theorem 2
1 1 E
1 1 E
1 1 E
0 1 E
0 1 E
0 0 E
1 1 1 1
0 1 E
0 1 E
0 0 E
1 1 1 1
0 1 E
0 1 E
0 0 E
1 1 1 1 ; ; . Thus and . As the result the carrier vector of the PUSBF E is E and FFFEP .
4. Generation of the reduced spectrum q bbbn E ,...,, The combinatorial method of the generation of the carrier vector r aaan F ,...,, can be applied to the generation of the reduced spectrum r aaan F ,...,, , where r aaan F ,...,, is the SBF. To solve the task of the generating of the reduced spectrum r aaan F ,...,, Theorem 1 and
Theorem 3 can be adapted to the two following forms.
Theorem 4.
The i th entry i of the reduced spectrum n ,...,, of the PUSBF nanan xxxFF ,...,, is calculated with the following formula: ,0 ;2mod1,1 otherwiseaiif i (7) where nai , . Theorem 5.
The i th entry i of the reduced spectrum naaan r F ,...,, of the SBF r aaan F ,...,, is calculated with the following formula: ,0 ;2mod1...,1 otherwise aiaiaiif ri (8) where nai ,1 . Note, that j ai for j ai is meaningless, where rj ,1 , therefore let’s assume r ai and j ai . According to Theorem 4 and
Theorem 5 the reduced spectrum n ,...,, of the SBF r aaan F ,...,, corresponds to the following form an naa ,...,,1,0...,,0,0 . (9) The example of the application of Theorem 5 will be considered.
Example 5.
Let’s generate the reduced spectrum F . From the condition it follows the carrier vector is E . According to the formula (9) it follows , and ,,,,,1,0,0 F . According to the formula (8) and Theorem 5 it is easy to define ,,, and as shown below: ; ; ; ; . As the result the reduced spectrum of the function F is F and EEEFP .
5. The complexity of the combinatorial method
The complexity of the proposed method can be defined as the number of the binary operations XOR (or OR) and is referred S for the EPUSBF bn E (or ESBF an F ) and S for the PUSBF q bbbn E ,...,, (or SBF r aaan F ,...,, ). The positive relationship of two binary vectors is ,...,,,...,, yyyxxx tttt , if ii yx , where ti ,1 . In this way to define the relationship ii yx the following condition should be satisfied ii yx . (10) Therefore according to the condition of Theorem 2 the complexity (the number of operations (10)) of the computation of the number bi is b . From Theorem 1 it follows the complexity of the computation of the carrier vector nbn E ,...,, is bnbS . (11) From Theorem 3 it follows the complexity of the computation of the carrier vector nbbbn q E ,...,, is ...11log11log1log bnbbnbbnbS qq bnbnbnbqnb qi iqi ii bnbnbbnb
22 2112 qi ii bnbbnb . (12) The complexity of the calculation of an F and r aaan F ,...,, can be calculated with (11) and (12) respectively.
6. Discussion
There are some effective methods to solve the task of polynomial expansion, i.e. generating of the reduced spectrum naaan r F ,...,, and the reverse task of generating of the carrier vector nbbbn r E ,...,, . One of these methods is the transeunt triangle method. It was originally proposed by V.P. Suprun for SBF [1]. Then the method was generalized for arbitrary Boolean functions [6]. The transeunt triangle method is the most effective method for polynomial expansion of the SBF n xxxFF ,...,, and has the complexity nO . The transeunt triangle form is generated from the upper base to the bottom using the XOR-operation (see example 6). Thus the number of XOR-operations defines the complexity T S of the transeunt triangle method and is 2 nnS T . (13) There is the example of the implementation of the transeunt triangle method for generating of the carrier vector nbn E ,...,, . Example 6.
Let’s assume the reduced spectrum E , i.e. n and b . In order to generate E the transeunt triangle method will be used. From the condition the upper base of the triangle will E and it takes the form as follow: 0 0 1 0 0 0 0 0 1 1 0 0 0 1 0 1 0 0 1 1 1 0 0 0 1 0 1 1 According to the transeunt triangle method the left side of the triangle corresponds to the reduced carrier vector and it is equal to E . Therefore FFFE . sing the formula (13) the complexity of the computation of the E with the transeunt triangle method is T S . On the other side, to complexity of performing the same task using the combinatorial method, according to the formula (11) and as shown in example 3, is S . Firstly let’s compare the complexity S (formula (11)) of the combinatorial method proposed in the article and the complexity T S (formula (13)) of the transeunt triangle method for SBF an E (or an F ). The illustration of the comparison of S and T S is shown on the Figure 4. As it can be seen at figure 4 the combinatorial method for EPUSBF has the linear complexity. The proposed method can provide ten times more efficiency for 80 variables in comparison with the transeunt triangle method. The complexity of the combinatorial method (formula (11)) is calculated for the worst case, i.e. for the EPUSBF bn E , where b . The complexity of the combinatorial method in comparison with the complexity of the transeunt triangle method for PUSBF r bbbn E ,...,, , where r , strongly depends on numbers included in the set of the polynomial numbers. As a result, the table demonstrates the threshold of the efficiency of the combinatorial method in comparison with the transeunt triangle method. The second column contains the power set of the polynomial numbers EB for which the complexity S and T S is approximately equal. The third column contains the set of the polynomial numbers EB for which the complexities of both methods are the same. Any other set of the polynomial numbers EB provides a lower complexity of the combinatorial method for the number of the variables specified in the first column. The fourth column shows the ratio of the set of the polynomial numbers to all variables specified in the first column. Two right columns show the comparable complexities of the combinatorial and the transeunt triangle methods. Figure 4.
The comparison of the complexity S of the combinatorial method and the complexity T S of the transeunt triangle method able The efficiency of the combinatorial method and the transeunt triangle method Number of the variables n that the function r bbbn E ,...,, depends on Number r of the polynomial numbers r bbb ,...,, for T SS Set of the polynomial numbers r bbbEB ,...,, Percentage of the number r of the variables n , % Complexity of the combinatorial method, S Complexity of the transeunt triangle method, T S
10 3 }4,3,2{
30 53 55 20 5 }8,...,4{
25 235 210 30 6 }9,...,4{
20 483 465 40 7 }14,...,8{
18 836 820 50 8 }18,...,11{
16 1266 1275 60 9 }24,...,16{
15 1840 1830 70 10 }25,...,16{
14 2520 2485 80 11 }26,...,16{
14 3295 3240 90 12 }27,...,16{
13 4765 4095 100 13 }28,...,16{
13 5130 5050 255 26 }57,...,32{
10 32988 32640 511 44 }107,...,64{
9 131355 130816 1023 76 }203,...,128{
7 521960 523776 2047 135 }390,...,256{
7 2095866 2096128 4095 242 }753,...,512{
6 8381660 8386560
7. Conclusions