
It has been suggested that this article be merged with Reed-Muller expansion to Algebraic normal form. (Discuss) Proposed since July 2024. |
Zhegalkin (also Žegalkin, Gégalkine or Shegalkin) polynomials (Russian: полиномы Жегалкина), also known as algebraic normal form, are a representation of functions in Boolean algebra. Introduced by the Russian mathematician Ivan Ivanovich Zhegalkin in 1927, they are the polynomial ring over the integers modulo 2. The resulting degeneracies of modular arithmetic result in Zhegalkin polynomials being simpler than ordinary polynomials, requiring neither coefficients nor exponents. Coefficients are redundant because 1 is the only nonzero coefficient. Exponents are redundant because in arithmetic mod 2, x2 = x. Hence a polynomial such as 3x2y5z is congruent to, and can therefore be rewritten as, xyz.
Boolean equivalent
Prior to 1927, Boolean algebra had been considered a calculus of logical values with logical operations of conjunction, disjunction, negation, and so on. Zhegalkin showed that all Boolean operations could be written as ordinary numeric polynomials, representing the false and true values as 0 and 1, the integers mod 2. Logical conjunction is written as xy, and logical exclusive-or as arithmetic addition mod 2, (written here as x⊕y to avoid confusion with the common use of + as a synonym for inclusive-or ∨). The logical complement ¬x is then x⊕1. Since ∧ and ¬ form a basis for Boolean algebra, all other logical operations are compositions of these basic operations, and so the polynomials of ordinary algebra can represent all Boolean operations, allowing Boolean reasoning to be performed using elementary algebra.
For example, the Boolean 2-out-of-3 threshold or median operation is written as the Zhegalkin polynomial xy⊕yz⊕zx.
Formal properties
Formally a Zhegalkin monomial is the product of a finite set of distinct variables (hence square-free), including the empty set whose product is denoted 1. There are 2n possible Zhegalkin monomials in n variables, since each monomial is fully specified by the presence or absence of each variable. A Zhegalkin polynomial is the sum (exclusive-or) of a set of Zhegalkin monomials, with the empty set denoted by 0. A given monomial's presence or absence in a polynomial corresponds to that monomial's coefficient being 1 or 0 respectively. The Zhegalkin monomials, being linearly independent, span a 2n-dimensional vector space over the Galois field GF(2) (NB: not GF(2n), whose multiplication is quite different). The 22n vectors of this space, i.e. the linear combinations of those monomials as unit vectors, constitute the Zhegalkin polynomials. The exact agreement with the number of Boolean operations on n variables, which exhaust the n-ary operations on {0,1}, furnishes a direct counting argument for completeness of the Zhegalkin polynomials as a Boolean basis.
This vector space is not equivalent to the free Boolean algebra on n generators because it lacks complementation (bitwise logical negation) as an operation (equivalently, because it lacks the top element as a constant). This is not to say that the space is not closed under complementation or lacks top (the all-ones vector) as an element, but rather that the linear transformations of this and similarly constructed spaces need not preserve complement and top. Those that do preserve them correspond to the Boolean homomorphisms, e.g. there are four linear transformations from the vector space of Zhegalkin polynomials over one variable to that over none, only two of which are Boolean homomorphisms.
Method of computation
There are various known methods generally used for the computation of the Zhegalkin polynomial:
- Using the method of indeterminate coefficients
- By constructing the canonical disjunctive normal form
- By using tables
- Pascal method
- Summation method
- Using a Karnaugh map
The method of indeterminate coefficients
Using the method of indeterminate coefficients, a linear system consisting of all the tuples of the function and their values is generated. Solving the linear system gives the coefficients of the Zhegalkin polynomial.
Example
Given the Boolean function , express it as a Zhegalkin polynomial. This function can be expressed as a column vector
This vector should be the output of left-multiplying a vector of undetermined coefficients by an 8x8 logical matrix which represents the possible values that all the possible conjunctions of A, B, C can take. These possible values are given in the following truth table:
A | B | C | 1 | C | B | BC | A | AC | AB | ABC | |
---|---|---|---|---|---|---|---|---|---|---|---|
0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | |
0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | |
0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | |
1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | |
1 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | |
1 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | |
1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
The information in the above truth table can be encoded in the following logical matrix: where the 'S' here stands for "Sierpiński", as in Sierpiński triangle, and the subscript 3 gives the exponents of its size:
.
It can be proven through mathematical induction and block-matrix multiplication that any such "Sierpiński matrix" is its own inverse.
Then the linear system is which can be solved for
:[clarification needed]
and the Zhegalkin polynomial corresponding to
is
.
Using the canonical disjunctive normal form
Using this method, the canonical disjunctive normal form (a fully expanded disjunctive normal form) is computed first. Then the negations in this expression are replaced by an equivalent expression using the mod 2 sum of the variable and 1. The disjunction signs are changed to addition mod 2, the brackets are opened, and the resulting Boolean expression is simplified. This simplification results in the Zhegalkin polynomial.
Using tables

Let be the outputs of a truth table for the function P of n variables, such that the index of the
's corresponds to the binary indexing of the minterms. Define a function ζ recursively by:
Note that
where
is the binomial coefficient reduced modulo 2.
Then is the i th coefficient of a Zhegalkin polynomial whose literals in the i th monomial are the same as the literals in the i th minterm, except that the negative literals are removed (or replaced by 1).
The ζ-transformation is its own inverse, so the same kind of table can be used to compute the coefficients given the coefficients
. Just let
In terms of the table in the figure, copy the outputs of the truth table (in the column labeled P) into the leftmost column of the triangular table. Then successively compute columns from left to right by applying XOR to each pair of vertically adjacent cells in order to fill the cell immediately to the right of the top cell of each pair. When the entire triangular table is filled in then the top row reads out the coefficients of a linear combination which, when simplified (removing the zeroes), yields the Zhegalkin polynomial.
To go from a Zhegalkin polynomial to a truth-table, it is possible to fill out the top row of the triangular table with the coefficients of the Zhegalkin polynomial (putting in zeroes for any combinations of positive literals not in the polynomial). Then successively compute rows from top to bottom by applying XOR to each pair of horizontally adjacent cells in order to fill the cell immediately to the bottom of the leftmost cell of each pair. When the entire triangular table is filled then the leftmost column of it can be copied to column P of the truth table.
As an aside, this method of calculation corresponds to the method of operation of the elementary cellular automaton called Rule 102. For example, start such a cellular automaton with eight cells set up with the outputs of the truth table (or the coefficients of the canonical disjunctive normal form) of the Boolean expression: 10101001. Then run the cellular automaton for seven more generations while keeping a record of the state of the leftmost cell. The history of this cell then turns out to be: 11000010, which shows the coefficients of the corresponding Zhegalkin polynomial.
The Pascal method
The most economical in terms of the amount of computation and expedient for constructing the Zhegalkin polynomial manually is the Pascal method.
We build a table consisting of columns and
rows, where N is the number of variables in the function. In the top row of the table we place the vector of function values, that is, the last column of the truth table.
Each row of the resulting table is divided into blocks (black lines in the figure). In the first line, the block occupies one cell, in the second line — two, in the third — four, in the fourth — eight, and so on. Each block in a certain line, which we will call "lower block", always corresponds to exactly two blocks in the previous line. We will call them "left upper block" and "right upper block".
The construction starts from the second line. The contents of the left upper blocks are transferred without change into the corresponding cells of the lower block (green arrows in the figure). Then, the operation "addition modulo two" is performed bitwise over the right upper and left upper blocks and the result is transferred to the corresponding cells of the right side of the lower block (red arrows in the figure). This operation is performed with all lines from top to bottom and with all blocks in each line. After the construction is completed, the bottom line contains a string of numbers, which are the coefficients of the Zhegalkin polynomial, written in the same sequence as in the triangle method described above.
The summation method
According to the truth table, it is easy to calculate the individual coefficients of the Zhegalkin polynomial. To do this, sum up modulo 2 the values of the function in those rows of the truth table where variables that are not in the conjunction (that corresponds to the coefficient being calculated) take zero values.
Suppose, for example, that we need to find the coefficient of the xz conjunction for the function of three variables . There is no variable y in this conjunction. Find the input sets in which the variable y takes a zero value. These are the sets 0, 1, 4, 5 (000, 001, 100, 101). Then the coefficient at conjunction xz is
Since there are no variables with the constant term,
For a term which includes all variables, the sum includes all values of the function:
Let us graphically represent the coefficients of the Zhegalkin polynomial as sums modulo 2 of values of functions at certain points. To do this, we construct a square table, where each column represents the value of the function at one of the points, and the row is the coefficient of the Zhegalkin polynomial. The point at the intersection of some column and row means that the value of the function at this point is included in the sum for the given coefficient of the polynomial (see figure). We call this table , where N is the number of variables of the function.
There is a pattern that allows you to get a table for a function of N variables, having a table for a function of variables. The new table
is arranged as a 2 × 2 matrix of
tables, and the right upper block of the matrix is cleared.
Lattice-theoretic interpretation
Consider the columns of a table as corresponding to elements of a Boolean lattice of size
. For each column
express number M as a binary number
, then
if and only if
, where
denotes bitwise OR.
If the rows of table are numbered, from top to bottom, with the numbers from 0 to
, then the tabular content of row number R is the ideal generated by element
of the lattice.
Note incidentally that the overall pattern of a table is that of a logical matrix Sierpiński triangle. Also, the pattern corresponds to an elementary cellular automaton called Rule 60, starting with the leftmost cell set to 1 and all other cells cleared.
Using a Karnaugh map

The figure shows a function of three variables, P(A, B, C) represented as a Karnaugh map, which the reader may consider as an example of how to convert such maps into Zhegalkin polynomials; the general procedure is given in the following steps:
- We consider all the cells of the Karnaugh map in ascending order of the number of units in their codes. For the function of three variables, the sequence of cells will be 000–100–010–001–110–101–011–111. Each cell of the Karnaugh map is associated with a member of the Zhegalkin polynomial depending on the positions of the code in which there are ones. For example, cell 111 corresponds to the member ABC, cell 101 corresponds to the member AC, cell 010 corresponds to the member B, and cell 000 corresponds to member 1.
- If the cell in question is 0, go to the next cell.
- If the cell in question is 1, add the corresponding term to the Zhegalkin polynomial, then invert all cells in the Karnaugh map where this term is 1 (or belonging to the ideal generated by this term, in a Boolean lattice of monomials) and go to the next cell. For example, if, when examining cell 110, a one appears in it, then the term AB is added to the Zhegalkin polynomial and all cells of the Karnaugh map are inverted, for which A = 1 and B = 1. If unit is in cell 000, then a term 1 is added to the Zhegalkin polynomial and the entire Karnaugh map is inverted.
- The transformation process can be considered complete when, after the next inversion, all cells of the Karnaugh map become zero, or a don't care condition.
Möbius transformation
The Möbius inversion formula relates the coefficients of a Boolean sum-of-minterms expression and a Zhegalkin polynomial. This is the partial order version of the Möbius formula, not the number theoretic. The Möbius inversion formula for partial orders is: where
, |x| being the Hamming distance of x from 0. Since
in the Zhegalkin algebra, the Möbius function collapses to being the constant 1.
The set of divisors of a given number x is also the order ideal generated by that number: . Since summation is modulo 2, the formula can be restated as
Example
As an example, consider the three-variable case. The following table shows the divisibility relation:
x | divisors of x |
---|---|
000 | 000 |
001 | 000, 001 |
010 | 000, 010 |
011 | 000, 001, 010, 011 |
100 | 000, 100 |
101 | 000, 001, 100, 101 |
110 | 000, 010, 100, 110 |
111 | 000, 001, 010, 011, 100, 101, 110, 111 |
Then
The above system of equations can be solved for f, and the result can be summarized as being obtainable by exchanging g and f throughout the above system.
The table below shows the binary numbers along with their associated Zhegalkin monomials and Boolean minterms:
Boolean minterm | ABC | Zhegalkin monomial |
---|---|---|
000 | 1 | |
001 | C | |
010 | B | |
011 | BC | |
100 | A | |
101 | AC | |
110 | AB | |
111 | ABC |
The Zhegalkin monomials are naturally ordered by divisibility, whereas the Boolean minterms do not so naturally order themselves; each one represents an exclusive eighth of the three-variable Venn diagram. The ordering of the monomials transfers to the bit strings as follows: given and
, a pair of bit triplets, then
.
The correspondence between a three-variable Boolean sum-of-minterms and a Zhegalkin polynomial is then:
The system of equations above may be summarized as a logical matrix equation:
which N. J. Wildberger calls a Boole–Möbius transformation.
Below is shown the “XOR spreadsheet” form of the transformation, going in the direction of g to f:
Related work
In 1927, in the same year as Zhegalkin's paper, the American mathematician Eric Temple Bell published a sophisticated arithmetization of Boolean algebra based on Richard Dedekind's ideal theory and general modular arithmetic (as opposed to arithmetic mod 2). The much simpler arithmetic character of Zhegalkin polynomials was first noticed in the west (independently, communication between Soviet and Western mathematicians being very limited in that era) by the American mathematician Marshall Stone in 1936 when he observed while writing up his celebrated Stone duality theorem that the supposedly loose analogy between Boolean algebras and rings could in fact be formulated as an exact equivalence holding for both finite and infinite algebras, leading him to substantially reorganize his paper over the next few years.
See also
- Algebraic normal form (ANF)
- Reed-Muller expansion
- Boolean domain
- Boolean-valued function
- Zhegalkin algebra
Notes
- As base case,
where
is here taken to denote the identity matrix of size
. The inductive assumption is
Then the inductive step is:
where
denotes the Kronecker product,
or, in terms of the Kronecker product:
Q.E.D.
- A minterm is the Boolean counterpart of a Zhegalkin monomial. For an n-variable context, there are
Zhegalkin monomials and
Boolean minterms as well. A minterm for an n-variable context consists of an AND-product of n literals, each literal either being a variable in the context or the NOT-negation of such a variable. Moreover, for each variable in the context there must appear exactly once in each minterm a corresponding literal (either the assertion or negation of that variable). A truth table for a Boolean function of n variables has exactly
rows, the inputs of each row corresponding naturally to a minterm whose context is the set of independent variables of that Boolean function. (Each 0-input corresponds to a negated variable; each 1-input corresponds to an asserted variable.)
Any Boolean expression may be converted to sum-of-minterms form by repeatedly distributing AND with respect to OR, NOT with respect to AND or OR (through the De Morgan identities), cancelling out double negations (cf. negation normal form); and then, when a sum-of-products has been obtained, multiply products with missing literals with instances of the law of excluded middle that contain the missing literals; then — lastly — distribute AND with respect to OR again.
Note that there is a formal correspondence, for a given context, between Zhegalkin monomials and Boolean minterms. However, the correspondence is not logical equivalence. For example, for the context {A, B, C}, there is a formal correspondence between the Zhegalkin monomial AB and the Boolean minterm, but they are not logically equivalent. (For more of this example, see the second table in the section "Möbius transformation". The same set of bitstrings is used to index both the set of Boolean minterms and the set of Zhegalkin monomials.)
References
- Steinbach, Bernd [in German]; Posthoff, Christian (2009). "Preface". Written at Freiberg, Germany. Logic Functions and Equations - Examples and Exercises (1st ed.). Dordrecht, Netherlands: Springer Science + Business Media B. V. p. xv. ISBN 978-1-4020-9594-8. LCCN 2008941076.
- Жега́лкин [Zhegalkin], Ива́н Ива́нович [Ivan Ivanovich] (1927). "O Tekhnyke Vychyslenyi Predlozhenyi v Symbolytscheskoi Logykye" О технике вычислений предложений в символической логике [On the technique of calculating propositions in symbolic logic (Sur le calcul des propositions dans la logique symbolique)]. Matematicheskii Sbornik (in Russian and French). 34 (1). Moscow, Russia: 9–28. Mi msb7433. Archived from the original on 2017-10-12. Retrieved 2017-10-12.
- Suprun [Супрун], Valeriy P. [Валерий Павлович] (1987). "Tablichnyy metod polinomial'nogo razlozheniya bulevykh funktsiy" Табличный метод полиномиального разложения булевых функций [The tabular method of polynomial decomposition of Boolean functions]. Kibernetika [Кибернетика] (Cybernetics) (in Russian) (1): 116–117.
- Suprun [Супрун], Valeriy P. [Валерий Павлович] (2017). "Osnovy teorii bulevykh funktsiy" Основы теории булевых функций [Fundamentals of the theory of Boolean functions]. М.: Lenand [Ленанд] / URSS (in Russian): 208.
- "Möbius inversion". Encyclopedia of Mathematics. 2021-02-17 [2011-02-07]. Archived from the original on 2020-07-16. Retrieved 2021-03-27.
- Bell, Eric Temple (1927). "Arithmetic of Logic". Transactions of the American Mathematical Society. 29 (3): 597–611. doi:10.2307/1989098. JSTOR 1989098.
- Stone, Marshall (1936). "The Theory of Representations for Boolean Algebras". Transactions of the American Mathematical Society. 40 (1): 37–111. doi:10.2307/1989664. ISSN 0002-9947. JSTOR 1989664.
Further reading
- Gindikin [Гиндикин], Semen Grigorʹevich [Семен Г.] (1972). Algebraic logic алгебра логики в задачах [Algebraic Logic] (in Russian) (1 ed.). Moscow, Russia: Наука [Nauka]. ISBN 0-387-96179-8. (288 pages) (NB. Translation: Springer-Verlag, 1985.[1])
- Perkowski, Marek A.; Grygiel, Stanislaw (1995-11-20). "6. Historical Overview of the Research on Decomposition". A Survey of Literature on Function Decomposition. Version IV. Functional Decomposition Group, Department of Electrical Engineering, Portland University, Portland, Oregon, USA. pp. 21–22. CiteSeerX 10.1.1.64.1129. (188 pages)
It has been suggested that this article be merged with Reed Muller expansion to Algebraic normal form Discuss Proposed since July 2024 Zhegalkin also Zegalkin Gegalkine or Shegalkin polynomials Russian polinomy Zhegalkina also known as algebraic normal form are a representation of functions in Boolean algebra Introduced by the Russian mathematician Ivan Ivanovich Zhegalkin in 1927 they are the polynomial ring over the integers modulo 2 The resulting degeneracies of modular arithmetic result in Zhegalkin polynomials being simpler than ordinary polynomials requiring neither coefficients nor exponents Coefficients are redundant because 1 is the only nonzero coefficient Exponents are redundant because in arithmetic mod 2 x2 x Hence a polynomial such as 3x2y5z is congruent to and can therefore be rewritten as xyz Boolean equivalentPrior to 1927 Boolean algebra had been considered a calculus of logical values with logical operations of conjunction disjunction negation and so on Zhegalkin showed that all Boolean operations could be written as ordinary numeric polynomials representing the false and true values as 0 and 1 the integers mod 2 Logical conjunction is written as xy and logical exclusive or as arithmetic addition mod 2 written here as x y to avoid confusion with the common use of as a synonym for inclusive or The logical complement x is then x 1 Since and form a basis for Boolean algebra all other logical operations are compositions of these basic operations and so the polynomials of ordinary algebra can represent all Boolean operations allowing Boolean reasoning to be performed using elementary algebra For example the Boolean 2 out of 3 threshold or median operation is written as the Zhegalkin polynomial xy yz zx Formal propertiesFormally a Zhegalkin monomial is the product of a finite set of distinct variables hence square free including the empty set whose product is denoted 1 There are 2n possible Zhegalkin monomials in n variables since each monomial is fully specified by the presence or absence of each variable A Zhegalkin polynomial is the sum exclusive or of a set of Zhegalkin monomials with the empty set denoted by 0 A given monomial s presence or absence in a polynomial corresponds to that monomial s coefficient being 1 or 0 respectively The Zhegalkin monomials being linearly independent span a 2n dimensional vector space over the Galois field GF 2 NB not GF 2n whose multiplication is quite different The 22n vectors of this space i e the linear combinations of those monomials as unit vectors constitute the Zhegalkin polynomials The exact agreement with the number of Boolean operations on n variables which exhaust the n ary operations on 0 1 furnishes a direct counting argument for completeness of the Zhegalkin polynomials as a Boolean basis This vector space is not equivalent to the free Boolean algebra on n generators because it lacks complementation bitwise logical negation as an operation equivalently because it lacks the top element as a constant This is not to say that the space is not closed under complementation or lacks top the all ones vector as an element but rather that the linear transformations of this and similarly constructed spaces need not preserve complement and top Those that do preserve them correspond to the Boolean homomorphisms e g there are four linear transformations from the vector space of Zhegalkin polynomials over one variable to that over none only two of which are Boolean homomorphisms Method of computationThere are various known methods generally used for the computation of the Zhegalkin polynomial Using the method of indeterminate coefficients By constructing the canonical disjunctive normal form By using tables Pascal method Summation method Using a Karnaugh mapThe method of indeterminate coefficients Using the method of indeterminate coefficients a linear system consisting of all the tuples of the function and their values is generated Solving the linear system gives the coefficients of the Zhegalkin polynomial Example Given the Boolean function f A B C A B C A BC AB C ABC displaystyle f A B C bar A bar B bar C bar A B bar C A bar B bar C ABC express it as a Zhegalkin polynomial This function can be expressed as a column vector f 10101001 displaystyle vec f begin pmatrix 1 0 1 0 1 0 0 1 end pmatrix This vector should be the output of left multiplying a vector of undetermined coefficients c c0c1c2c3c4c5c6c7 displaystyle vec c begin pmatrix c 0 c 1 c 2 c 3 c 4 c 5 c 6 c 7 end pmatrix by an 8x8 logical matrix which represents the possible values that all the possible conjunctions of A B C can take These possible values are given in the following truth table A B C 1 C B BC A AC AB ABC0 0 0 1 0 0 0 0 0 0 00 0 1 1 1 0 0 0 0 0 00 1 0 1 0 1 0 0 0 0 00 1 1 1 1 1 1 0 0 0 01 0 0 1 0 0 0 1 0 0 01 0 1 1 1 0 0 1 1 0 01 1 0 1 0 1 0 1 0 1 01 1 1 1 1 1 1 1 1 1 1 The information in the above truth table can be encoded in the following logical matrix S3 1000000011000000101000001111000010001000110011001010101011111111 displaystyle S 3 begin pmatrix 1 amp 0 amp 0 amp 0 amp 0 amp 0 amp 0 amp 0 1 amp 1 amp 0 amp 0 amp 0 amp 0 amp 0 amp 0 1 amp 0 amp 1 amp 0 amp 0 amp 0 amp 0 amp 0 1 amp 1 amp 1 amp 1 amp 0 amp 0 amp 0 amp 0 1 amp 0 amp 0 amp 0 amp 1 amp 0 amp 0 amp 0 1 amp 1 amp 0 amp 0 amp 1 amp 1 amp 0 amp 0 1 amp 0 amp 1 amp 0 amp 1 amp 0 amp 1 amp 0 1 amp 1 amp 1 amp 1 amp 1 amp 1 amp 1 amp 1 end pmatrix where the S here stands for Sierpinski as in Sierpinski triangle and the subscript 3 gives the exponents of its size 23 23 displaystyle 2 3 times 2 3 It can be proven through mathematical induction and block matrix multiplication that any such Sierpinski matrix Sn displaystyle S n is its own inverse Then the linear system is S3c f displaystyle S 3 vec c vec f which can be solved for c displaystyle vec c clarification needed c S3 1f S3f 1000000011000000101000001111000010001000110011001010101011111111 10101001 111 11 11 11 11 1 11 1 1 1 11000010 displaystyle vec c S 3 1 vec f S 3 vec f begin pmatrix 1 amp 0 amp 0 amp 0 amp 0 amp 0 amp 0 amp 0 1 amp 1 amp 0 amp 0 amp 0 amp 0 amp 0 amp 0 1 amp 0 amp 1 amp 0 amp 0 amp 0 amp 0 amp 0 1 amp 1 amp 1 amp 1 amp 0 amp 0 amp 0 amp 0 1 amp 0 amp 0 amp 0 amp 1 amp 0 amp 0 amp 0 1 amp 1 amp 0 amp 0 amp 1 amp 1 amp 0 amp 0 1 amp 0 amp 1 amp 0 amp 1 amp 0 amp 1 amp 0 1 amp 1 amp 1 amp 1 amp 1 amp 1 amp 1 amp 1 end pmatrix begin pmatrix 1 0 1 0 1 0 0 1 end pmatrix begin pmatrix 1 1 1 oplus 1 1 oplus 1 1 oplus 1 1 oplus 1 1 oplus 1 oplus 1 1 oplus 1 oplus 1 oplus 1 end pmatrix begin pmatrix 1 1 0 0 0 0 1 0 end pmatrix and the Zhegalkin polynomial corresponding to c displaystyle vec c is 1 C AB displaystyle 1 oplus C oplus AB Using the canonical disjunctive normal form Using this method the canonical disjunctive normal form a fully expanded disjunctive normal form is computed first Then the negations in this expression are replaced by an equivalent expression using the mod 2 sum of the variable and 1 The disjunction signs are changed to addition mod 2 the brackets are opened and the resulting Boolean expression is simplified This simplification results in the Zhegalkin polynomial Using tables Computing the Zhegalkin polynomial for an example function P by the table method Let c0 c2n 1 displaystyle c 0 dots c 2 n 1 be the outputs of a truth table for the function P of n variables such that the index of the ci displaystyle c i s corresponds to the binary indexing of the minterms Define a function z recursively by z ci ci displaystyle zeta c i c i z c0 ck z c0 ck 1 z c1 ck displaystyle zeta c 0 dots c k zeta c 0 dots c k 1 oplus zeta c 1 dots c k Note that z c0 cm k 0m mk 2ck displaystyle zeta c 0 dots c m bigoplus k 0 m m choose k 2 c k where mk 2 textstyle m choose k 2 is the binomial coefficient reduced modulo 2 Then gi z c0 ci displaystyle g i zeta c 0 dots c i is the ith coefficient of a Zhegalkin polynomial whose literals in the ith monomial are the same as the literals in the ith minterm except that the negative literals are removed or replaced by 1 The z transformation is its own inverse so the same kind of table can be used to compute the coefficients c0 c2n 1 displaystyle c 0 dots c 2 n 1 given the coefficients g0 g2n 1 displaystyle g 0 dots g 2 n 1 Just let ci z g0 gi displaystyle c i zeta g 0 dots g i In terms of the table in the figure copy the outputs of the truth table in the column labeled P into the leftmost column of the triangular table Then successively compute columns from left to right by applying XOR to each pair of vertically adjacent cells in order to fill the cell immediately to the right of the top cell of each pair When the entire triangular table is filled in then the top row reads out the coefficients of a linear combination which when simplified removing the zeroes yields the Zhegalkin polynomial To go from a Zhegalkin polynomial to a truth table it is possible to fill out the top row of the triangular table with the coefficients of the Zhegalkin polynomial putting in zeroes for any combinations of positive literals not in the polynomial Then successively compute rows from top to bottom by applying XOR to each pair of horizontally adjacent cells in order to fill the cell immediately to the bottom of the leftmost cell of each pair When the entire triangular table is filled then the leftmost column of it can be copied to column P of the truth table As an aside this method of calculation corresponds to the method of operation of the elementary cellular automaton called Rule 102 For example start such a cellular automaton with eight cells set up with the outputs of the truth table or the coefficients of the canonical disjunctive normal form of the Boolean expression 10101001 Then run the cellular automaton for seven more generations while keeping a record of the state of the leftmost cell The history of this cell then turns out to be 11000010 which shows the coefficients of the corresponding Zhegalkin polynomial The Pascal method Using the Pascal method to compute the Zhegalkin polynomial for the Boolean function a b c a bc a bc abc displaystyle bar a bar b bar c bar a b bar c bar a bc ab bar c The line in Russian at the bottom says displaystyle oplus bitwise operation Exclusive OR The most economical in terms of the amount of computation and expedient for constructing the Zhegalkin polynomial manually is the Pascal method We build a table consisting of 2N displaystyle 2 N columns and N 1 displaystyle N 1 rows where N is the number of variables in the function In the top row of the table we place the vector of function values that is the last column of the truth table Each row of the resulting table is divided into blocks black lines in the figure In the first line the block occupies one cell in the second line two in the third four in the fourth eight and so on Each block in a certain line which we will call lower block always corresponds to exactly two blocks in the previous line We will call them left upper block and right upper block The construction starts from the second line The contents of the left upper blocks are transferred without change into the corresponding cells of the lower block green arrows in the figure Then the operation addition modulo two is performed bitwise over the right upper and left upper blocks and the result is transferred to the corresponding cells of the right side of the lower block red arrows in the figure This operation is performed with all lines from top to bottom and with all blocks in each line After the construction is completed the bottom line contains a string of numbers which are the coefficients of the Zhegalkin polynomial written in the same sequence as in the triangle method described above The summation method Graphic representation of the coefficients of the Zhegalkin polynomial for functions with different numbers of variables According to the truth table it is easy to calculate the individual coefficients of the Zhegalkin polynomial To do this sum up modulo 2 the values of the function in those rows of the truth table where variables that are not in the conjunction that corresponds to the coefficient being calculated take zero values Suppose for example that we need to find the coefficient of the xz conjunction for the function of three variables f x y z displaystyle f x y z There is no variable y in this conjunction Find the input sets in which the variable y takes a zero value These are the sets 0 1 4 5 000 001 100 101 Then the coefficient at conjunction xz is a5 f0 f1 f4 f5 f 0 0 0 f 0 0 1 f 1 0 0 f 1 0 1 displaystyle a 5 f 0 oplus f 1 oplus f 4 oplus f 5 f 0 0 0 oplus f 0 0 1 oplus f 1 0 0 oplus f 1 0 1 Since there are no variables with the constant term a0 f0 displaystyle a 0 f 0 For a term which includes all variables the sum includes all values of the function aN 1 f0 f1 f2 fN 2 fN 1 displaystyle a N 1 f 0 oplus f 1 oplus f 2 oplus dots oplus f N 2 oplus f N 1 Let us graphically represent the coefficients of the Zhegalkin polynomial as sums modulo 2 of values of functions at certain points To do this we construct a square table where each column represents the value of the function at one of the points and the row is the coefficient of the Zhegalkin polynomial The point at the intersection of some column and row means that the value of the function at this point is included in the sum for the given coefficient of the polynomial see figure We call this table TN displaystyle T N where N is the number of variables of the function There is a pattern that allows you to get a table for a function of N variables having a table for a function of N 1 displaystyle N 1 variables The new table TN 1 displaystyle T N 1 is arranged as a 2 2 matrix of TN displaystyle T N tables and the right upper block of the matrix is cleared Lattice theoretic interpretation Consider the columns of a table TN displaystyle T N as corresponding to elements of a Boolean lattice of size 2N displaystyle 2 N For each column fM displaystyle f M express number M as a binary number M2 displaystyle M 2 then fM fK displaystyle f M leq f K if and only if M2 K2 K2 displaystyle M 2 vee K 2 K 2 where displaystyle vee denotes bitwise OR If the rows of table TN displaystyle T N are numbered from top to bottom with the numbers from 0 to 2N 1 displaystyle 2 N 1 then the tabular content of row number R is the ideal generated by element fR displaystyle f R of the lattice Note incidentally that the overall pattern of a table TN displaystyle T N is that of a logical matrix Sierpinski triangle Also the pattern corresponds to an elementary cellular automaton called Rule 60 starting with the leftmost cell set to 1 and all other cells cleared Using a Karnaugh map Converting a Karnaugh map to a Zhegalkin polynomial The figure shows a function of three variables P A B C represented as a Karnaugh map which the reader may consider as an example of how to convert such maps into Zhegalkin polynomials the general procedure is given in the following steps We consider all the cells of the Karnaugh map in ascending order of the number of units in their codes For the function of three variables the sequence of cells will be 000 100 010 001 110 101 011 111 Each cell of the Karnaugh map is associated with a member of the Zhegalkin polynomial depending on the positions of the code in which there are ones For example cell 111 corresponds to the member ABC cell 101 corresponds to the member AC cell 010 corresponds to the member B and cell 000 corresponds to member 1 If the cell in question is 0 go to the next cell If the cell in question is 1 add the corresponding term to the Zhegalkin polynomial then invert all cells in the Karnaugh map where this term is 1 or belonging to the ideal generated by this term in a Boolean lattice of monomials and go to the next cell For example if when examining cell 110 a one appears in it then the term AB is added to the Zhegalkin polynomial and all cells of the Karnaugh map are inverted for which A 1 and B 1 If unit is in cell 000 then a term 1 is added to the Zhegalkin polynomial and the entire Karnaugh map is inverted The transformation process can be considered complete when after the next inversion all cells of the Karnaugh map become zero or a don t care condition Mobius transformationThe Mobius inversion formula relates the coefficients of a Boolean sum of minterms expression and a Zhegalkin polynomial This is the partial order version of the Mobius formula not the number theoretic The Mobius inversion formula for partial orders is g x y y xf y f x y y xg y m y x displaystyle g x sum y y leq x f y leftrightarrow f x sum y y leq x g y mu y x where m y x 1 x y displaystyle mu y x 1 x y x being the Hamming distance of x from 0 Since 1 1 displaystyle 1 equiv 1 in the Zhegalkin algebra the Mobius function collapses to being the constant 1 The set of divisors of a given number x is also the order ideal generated by that number x displaystyle langle x rangle Since summation is modulo 2 the formula can be restated as g x y y x f y f x y y x g y displaystyle g x bigoplus y y in langle x rangle f y leftrightarrow f x bigoplus y y in langle x rangle g y Example As an example consider the three variable case The following table shows the divisibility relation x divisors of x000 000001 000 001010 000 010011 000 001 010 011100 000 100101 000 001 100 101110 000 010 100 110111 000 001 010 011 100 101 110 111 Then g 000 f 000 g 001 f 000 f 001 g 010 f 000 f 010 g 011 f 000 f 001 f 010 f 011 g 100 f 000 f 100 g 101 f 000 f 001 f 100 101 g 110 f 000 f 010 f 100 f 110 g 111 f 000 f 001 f 010 f 011 f 100 f 101 f 110 f 111 displaystyle begin aligned g 000 amp f 000 1ex g 001 amp f 000 oplus f 001 1ex g 010 amp f 000 oplus f 010 1ex g 011 amp f 000 oplus f 001 oplus f 010 oplus f 011 1ex g 100 amp f 000 oplus f 100 1ex g 101 amp f 000 oplus f 001 oplus f 100 oplus 101 1ex g 110 amp f 000 oplus f 010 oplus f 100 oplus f 110 1ex g 111 amp f 000 oplus f 001 oplus f 010 oplus f 011 oplus f 100 oplus f 101 oplus f 110 oplus f 111 end aligned The above system of equations can be solved for f and the result can be summarized as being obtainable by exchanging g and f throughout the above system The table below shows the binary numbers along with their associated Zhegalkin monomials and Boolean minterms Boolean minterm ABC Zhegalkin monomialA B C displaystyle bar A bar B bar C 000 1A B C displaystyle bar A bar B C 001 CA BC displaystyle bar A B bar C 010 BA BC displaystyle bar A BC 011 BCAB C displaystyle A bar B bar C 100 AAB C displaystyle A bar B C 101 ACABC displaystyle AB bar C 110 ABABC displaystyle ABC 111 ABC The Zhegalkin monomials are naturally ordered by divisibility whereas the Boolean minterms do not so naturally order themselves each one represents an exclusive eighth of the three variable Venn diagram The ordering of the monomials transfers to the bit strings as follows given a1a2a3 displaystyle a 1 a 2 a 3 and b1b2b3 displaystyle b 1 b 2 b 3 a pair of bit triplets then a1a2a3 b1b2b3 a1 b1 a2 b2 a3 b3 displaystyle a 1 a 2 a 3 leq b 1 b 2 b 3 leftrightarrow a 1 leq b 1 wedge a 2 leq b 2 wedge a 3 leq b 3 The correspondence between a three variable Boolean sum of minterms and a Zhegalkin polynomial is then f 000 A B C f 001 A B C f 010 A BC f 011 A BC f 100 AB C f 101 AB C f 110 ABC f 111 ABC g 000 g 001 C g 010 B g 011 BC g 100 A g 101 AC g 110 AB g 111 ABC displaystyle begin aligned amp f 000 bar A bar B bar C vee f 001 bar A bar B C vee f 010 bar A B bar C vee f 011 bar A BC vee f 100 A bar B bar C vee f 101 A bar B C vee f 110 AB bar C vee f 111 ABC 1ex amp qquad equiv g 000 oplus g 001 C oplus g 010 B oplus g 011 BC oplus g 100 A oplus g 101 AC oplus g 110 AB oplus g 111 ABC end aligned The system of equations above may be summarized as a logical matrix equation g 000 g 001 g 010 g 011 g 100 g 101 g 110 g 111 1000000011000000101000001111000010001000110011001010101011111111 f 000 f 001 f 010 f 011 f 100 f 101 f 110 f 111 displaystyle begin pmatrix g 000 g 001 g 010 g 011 g 100 g 101 g 110 g 111 end pmatrix begin pmatrix 1 amp amp 0 amp amp 0 amp amp 0 amp amp 0 amp amp 0 amp amp 0 amp amp 0 1 amp amp 1 amp amp 0 amp amp 0 amp amp 0 amp amp 0 amp amp 0 amp amp 0 1 amp amp 0 amp amp 1 amp amp 0 amp amp 0 amp amp 0 amp amp 0 amp amp 0 1 amp amp 1 amp amp 1 amp amp 1 amp amp 0 amp amp 0 amp amp 0 amp amp 0 1 amp amp 0 amp amp 0 amp amp 0 amp amp 1 amp amp 0 amp amp 0 amp amp 0 1 amp amp 1 amp amp 0 amp amp 0 amp amp 1 amp amp 1 amp amp 0 amp amp 0 1 amp amp 0 amp amp 1 amp amp 0 amp amp 1 amp amp 0 amp amp 1 amp amp 0 1 amp amp 1 amp amp 1 amp amp 1 amp amp 1 amp amp 1 amp amp 1 amp amp 1 end pmatrix begin pmatrix f 000 f 001 f 010 f 011 f 100 f 101 f 110 f 111 end pmatrix which N J Wildberger calls a Boole Mobius transformation Below is shown the XOR spreadsheet form of the transformation going in the direction of g to f f000 displaystyle f 000 f001 displaystyle f 001 f010 displaystyle f 010 f011 displaystyle f 011 f100 displaystyle f 100 f101 displaystyle f 101 f110 displaystyle f 110 f111 displaystyle f 111 g000 displaystyle g 000 g000 g001 displaystyle g 000 oplus g 001 g000 g010 displaystyle g 000 oplus g 010 g000 g010 g001 g011 displaystyle g 000 oplus g 010 oplus g 001 oplus g 011 g000 g100 displaystyle g 000 oplus g 100 g000 g100 g001 g101 displaystyle g 000 oplus g 100 oplus g 001 oplus g 101 g000 g100 g010 g110 displaystyle g 000 oplus g 100 oplus g 010 oplus g 110 g000 g100 g010 g110 g001 g101 g011 g111 displaystyle g 000 oplus g 100 oplus g 010 oplus g 110 oplus g 001 oplus g 101 oplus g 011 oplus g 111 g001 displaystyle g 001 g001 g010 displaystyle g 001 oplus g 010 g001 g011 displaystyle g 001 oplus g 011 g001 g011 g010 g100 displaystyle g 001 oplus g 011 oplus g 010 oplus g 100 g001 g101 displaystyle g 001 oplus g 101 g001 g101 g010 g110 displaystyle g 001 oplus g 101 oplus g 010 oplus g 110 g001 g101 g011 g111 displaystyle g 001 oplus g 101 oplus g 011 oplus g 111 g010 displaystyle g 010 g010 g011 displaystyle g 010 oplus g 011 g010 g100 displaystyle g 010 oplus g 100 g010 g100 g011 g101 displaystyle g 010 oplus g 100 oplus g 011 oplus g 101 g010 g110 displaystyle g 010 oplus g 110 g010 g110 g011 g111 displaystyle g 010 oplus g 110 oplus g 011 oplus g 111 g011 displaystyle g 011 g011 g100 displaystyle g 011 oplus g 100 g011 g101 displaystyle g 011 oplus g 101 g011 g101 g100 g110 displaystyle g 011 oplus g 101 oplus g 100 oplus g 110 g011 g111 displaystyle g 011 oplus g 111 g100 displaystyle g 100 g100 g101 displaystyle g 100 oplus g 101 g100 g110 displaystyle g 100 oplus g 110 g100 g110 g101 g111 displaystyle g 100 oplus g 110 oplus g 101 oplus g 111 g101 displaystyle g 101 g101 g110 displaystyle g 101 oplus g 110 g101 g111 displaystyle g 101 oplus g 111 g110 displaystyle g 110 g110 g111 displaystyle g 110 oplus g 111 g111 displaystyle g 111 Related workIn 1927 in the same year as Zhegalkin s paper the American mathematician Eric Temple Bell published a sophisticated arithmetization of Boolean algebra based on Richard Dedekind s ideal theory and general modular arithmetic as opposed to arithmetic mod 2 The much simpler arithmetic character of Zhegalkin polynomials was first noticed in the west independently communication between Soviet and Western mathematicians being very limited in that era by the American mathematician Marshall Stone in 1936 when he observed while writing up his celebrated Stone duality theorem that the supposedly loose analogy between Boolean algebras and rings could in fact be formulated as an exact equivalence holding for both finite and infinite algebras leading him to substantially reorganize his paper over the next few years See alsoAlgebraic normal form ANF Reed Muller expansion Boolean domain Boolean valued function Zhegalkin algebraNotesAs base case S0 1 displaystyle S 0 begin pmatrix 1 end pmatrix S0 2 1 I0 displaystyle S 0 2 begin pmatrix 1 end pmatrix I 0 where In displaystyle I n is here taken to denote the identity matrix of size 2n 2n displaystyle 2 n times 2 n The inductive assumption is Sn 2 In displaystyle S n 2 I n Then the inductive step is Sn 1 SnOSnSn 1011 Sn displaystyle S n 1 begin pmatrix S n amp O S n amp S n end pmatrix equiv begin pmatrix 1 amp 0 1 amp 1 end pmatrix otimes S n where displaystyle otimes denotes the Kronecker product Sn 1 2 SnOSnSn SnOSnSn SnSn OSnSnO OSnSnSn SnSnSnO SnSn InOIn InIn InOOIn In 1 displaystyle S n 1 2 begin pmatrix S n amp O S n amp S n end pmatrix begin pmatrix S n amp O S n amp S n end pmatrix begin pmatrix S n S n oplus OS n amp S n O oplus OS n S n S n oplus S n S n amp S n O oplus S n S n end pmatrix begin pmatrix I n amp O I n oplus I n amp I n end pmatrix begin pmatrix I n amp O O amp I n end pmatrix I n 1 or in terms of the Kronecker product Sn 12 S1 Sn S1 Sn S12 Sn2 I1 In In 1 displaystyle S n 1 2 S 1 otimes S n S 1 otimes S n S 1 2 otimes S n 2 I 1 otimes I n I n 1 Q E D A minterm is the Boolean counterpart of a Zhegalkin monomial For an n variable context there are 2n displaystyle 2 n Zhegalkin monomials and 2n displaystyle 2 n Boolean minterms as well A minterm for an n variable context consists of an AND product of n literals each literal either being a variable in the context or the NOT negation of such a variable Moreover for each variable in the context there must appear exactly once in each minterm a corresponding literal either the assertion or negation of that variable A truth table for a Boolean function of n variables has exactly 2n displaystyle 2 n rows the inputs of each row corresponding naturally to a minterm whose context is the set of independent variables of that Boolean function Each 0 input corresponds to a negated variable each 1 input corresponds to an asserted variable Any Boolean expression may be converted to sum of minterms form by repeatedly distributing AND with respect to OR NOT with respect to AND or OR through the De Morgan identities cancelling out double negations cf negation normal form and then when a sum of products has been obtained multiply products with missing literals with instances of the law of excluded middle that contain the missing literals then lastly distribute AND with respect to OR again Note that there is a formal correspondence for a given context between Zhegalkin monomials and Boolean minterms However the correspondence is not logical equivalence For example for the context A B C there is a formal correspondence between the Zhegalkin monomial AB and the Boolean minterm ABC displaystyle AB bar C but they are not logically equivalent For more of this example see the second table in the section Mobius transformation The same set of bitstrings is used to index both the set of Boolean minterms and the set of Zhegalkin monomials ReferencesSteinbach Bernd in German Posthoff Christian 2009 Preface Written at Freiberg Germany Logic Functions and Equations Examples and Exercises 1st ed Dordrecht Netherlands Springer Science Business Media B V p xv ISBN 978 1 4020 9594 8 LCCN 2008941076 Zhega lkin Zhegalkin Iva n Iva novich Ivan Ivanovich 1927 O Tekhnyke Vychyslenyi Predlozhenyi v Symbolytscheskoi Logykye O tehnike vychislenij predlozhenij v simvolicheskoj logike On the technique of calculating propositions in symbolic logic Sur le calcul des propositions dans la logique symbolique Matematicheskii Sbornik in Russian and French 34 1 Moscow Russia 9 28 Mi msb7433 Archived from the original on 2017 10 12 Retrieved 2017 10 12 Suprun Suprun Valeriy P Valerij Pavlovich 1987 Tablichnyy metod polinomial nogo razlozheniya bulevykh funktsiy Tablichnyj metod polinomialnogo razlozheniya bulevyh funkcij The tabular method of polynomial decomposition of Boolean functions Kibernetika Kibernetika Cybernetics in Russian 1 116 117 Suprun Suprun Valeriy P Valerij Pavlovich 2017 Osnovy teorii bulevykh funktsiy Osnovy teorii bulevyh funkcij Fundamentals of the theory of Boolean functions M Lenand Lenand URSS in Russian 208 Mobius inversion Encyclopedia of Mathematics 2021 02 17 2011 02 07 Archived from the original on 2020 07 16 Retrieved 2021 03 27 Bell Eric Temple 1927 Arithmetic of Logic Transactions of the American Mathematical Society 29 3 597 611 doi 10 2307 1989098 JSTOR 1989098 Stone Marshall 1936 The Theory of Representations for Boolean Algebras Transactions of the American Mathematical Society 40 1 37 111 doi 10 2307 1989664 ISSN 0002 9947 JSTOR 1989664 Further readingGindikin Gindikin Semen Grigorʹevich Semen G 1972 Algebraic logic algebra logiki v zadachah Algebraic Logic in Russian 1 ed Moscow Russia Nauka Nauka ISBN 0 387 96179 8 288 pages NB Translation Springer Verlag 1985 1 Perkowski Marek A Grygiel Stanislaw 1995 11 20 6 Historical Overview of the Research on Decomposition A Survey of Literature on Function Decomposition Version IV Functional Decomposition Group Department of Electrical Engineering Portland University Portland Oregon USA pp 21 22 CiteSeerX 10 1 1 64 1129 188 pages