Algebraic normal form: Difference between revisions

From testwiki
Jump to navigation Jump to search
imported>Watchduck
No edit summary
 
(No difference)

Latest revision as of 23:24, 16 May 2024

Template:Boolf header Template:Zhegalkin stuff

Template:Multiple image

Template:Multiple image

Template:Multiple image

The Template:W (ANF) is a Template:W of a Boolean function.

It is a Template:W formula of Template:W formulas, like this:

ab(ab)(abc)

Here it shall be abbreviated like this:

[(a),(b),(a,b),(a,b,c)]

Both operators are Template:W, i.e. they can have any number of arguments, including none or one.
XOR without arguments is false (Template:W 0). AND without arguments is true (Template:W 1).

The empty XOR is false:

[]0

XOR containing empty AND is true:

[()]1

XOR containing unary AND is an atomic statement:

[(a)]a

The presence of empty AND works as a Template:W:

[(),(a)]¬a

So the negation of the introductory example is this:

[(),(a),(b),(a,b),(a,b,c)]

Each AND formula corresponds to a set of integers, which can be interpreted as a binary number.
Thus each XOR formula also corresponds to a set of integers, which can also be interpreted as a binary number.

0 [] {} {} empty sum 0 0
1 [()] {{}} {0} 20 1
a [(a)] {{0}} {1} 21 2
¬a [(),(a)] {{},{0}} {0,1} 20+21 3
b [(b)] {{1}} {2} 22 4
¬b [(),(b)] {{},{1}} {0,2} 20+22 5
ab [(a),(b)] {{0},{1}} {1,2} 21+22 6
ab [(),(a),(b)] {{},{0},{1}} {0,1,2} 20+21+22 7
ab [(a,b)] {{0,1}} {3} 23 8
¬a¬b [(),(a,b)] {{},{0,1}} {0,3} 20+23 9
a¬b [(a),(a,b)] {{0},{0,1}} {1,3} 21+23 10
¬ab [(),(a),(a,b)] {{},{0},{0,1}} {0,1,3} 20+21+23 11
¬ab [(b),(a,b)] {{1},{0,1}} {2,3} 22+23 12
a¬b [(),(b),(a,b)] {{},{1},{0,1}} {0,2,3} 20+22+23 13
ab [(a),(b),(a,b)] {{0},{1},{0,1}} {1,2,3} 21+22+23 14
¬a¬b [(),(a),(b),(a,b)] {{},{0},{1},{0,1}} {0,1,2,3} 20+21+22+23 15
(¬a¬b¬c)(ab) [(a),(b),(a,b),(a,b,c)] {{0},{1},{0,1},{0,1,2}} {1,2,3,7} 21+22+23+27 142
(abc)(¬a¬b) [(),(a),(b),(a,b),(a,b,c)] {{},{0},{1},{0,1},{0,1,2}} {0,1,2,3,7} 20+21+22+23+27 143


In short, there is a bijection between the non-negative integers and algebraic normal forms.
While the truth tables for a given arity can be interpreted as integers, truth tables in general can only be assigned Template:W values between 0 and 1.
The ANF allows to assign every Boolean function (regardless of its arity) a unique integer, which shall be called its Zhegalkin index.

It has the interesting property, that its parity corresponds to the just mentioned fraction:
Boolean functions with an even (odd) Zhegalkin index have a rational value below (above) 12.
Here is a list of examples: v:Studies of Euler diagrams/list

The Zhegalkin indices of Boolean functions in the same permutation equivalence class have the same binary weight.

For a specific arity each Boolean function can be interpreted as an integer.
So the map from integers to Boolean functions becomes a map from integers to integers, which is the Zhegalkin permutation.

See also: Zhegalkin matrix