Gender of Boolean functions

Studies of Boolean functions

gender ratio for arities 0...5

A Boolean function shall be called male, iff its root is sharp (i.e. iff its compressed truth table has odd weight).
(Equivalently, it is female, iff after removing all repetitions, the weight of the truth table is still even.)

For positive arities, there are more males than females. The imbalance peaks for arity 2. For higher arities, the ratio is almost balanced.
The ratio is balanced for the infinite set of all Boolean functions. Both sets are countable, so there is a trivial bijection. But is there a meaningful bijection?

The number triangles in the following boxes show the numbers of Boolean functions by arity/adicity and valency.
Row indices on the left (🌊) are the arity, on the right (💧) the adicity. Entries on the left are the sums of columns on the right.
These triangles are based on Pascals triangle, with columns multiplied by consecutive entries of a sequence, which becomes the diagonal.

diagonals and row sums

|  | name | OEIS | 0 | 1 | 2 | 3 | 4 | 5

|
|
|
|
|
|
|
|

♀  | diag.  | Violet | ~ 2*A007537 | 1 | 0 | 2 | 90 | 31826 | 2147158386
🌊  | Primula | A246537 | 1 | 1 | 3 | 97 | 32199 | 2147318437
💧  | PrimulaDrop |  | 1 | 0 | 2 | 94 | 32102 | 2147286238
♂  | diag.  | HalfGrass | ~A058891 | 1 | 2 | 8 | 128 | 32768 | 2147483648
🌊  | HalfCrocus | A246418 | 1 | 3 | 13 | 159 | 33337 | 2147648859
💧  | HalfCrocusDrop |  | 1 | 2 | 10 | 146 | 33178 | 2147615522
all  | diag.  | Lotus | A000371 | 2 | 2 | 10 | 218 | 64594 | 4294642034
🌊  | Grass | A001146 | 2 | 4 | 16 | 256 | 65536 | 4294967296
💧  | GrassDrop | ~A111403 | 2 | 2 | 12 | 240 | 65280 | 4294901760
♂ − ♀  | diag.  | NonLotus | A005530 | 0 | 2 | 6 | 38 | 942 | 325262
🌊  | Hyacinth | 2*A059301 | 0 | 2 | 10 | 62 | 1138 | 330422
💧  | HyacinthDrop |  | 0 | 2 | 8 | 52 | 1076 | 329284

Pascal with columns multiplied by Violet

| 🌊  triangle Robinia row sums Primula (A246537)

| 0 | 1 | 2 | 3 | 4 | 5 | sums
0  | 1 · 1 1  |  |  |  |  |  | 1
1  | 1 · 1 1  | 1 · 0 0  |  |  |  |  | 1
2  | 1 · 1 1  | 2 · 0 0  | 1 · 2 2  |  |  |  | 3
3  | 1 · 1 1  | 3 · 0 0  | 3 · 2 6  | 1 · 90 90  |  |  | 97
4  | 1 · 1 1  | 4 · 0 0  | 6 · 2 12  | 4 · 90 360  | 1 · 31826 31826  |  | 32199
5  | 1 · 1 1  | 5 · 0 0  | 10 · 2 20  | 10 · 90 900  | 5 · 31826 159130  | 1 · 2147158386 2147158386  | 2147318437

PascalDrop with columns multiplied by Violet

| 💧  triangle RobiniaDrop row sums PrimulaDrop

| 0 | 1 | 2 | 3 | 4 | 5 | sums
0  | 1 · 1 1  |  |  |  |  |  | 1
1  |  0  | 1 · 0 0  |  |  |  |  | 0
2  |  0  | 1 · 0 0  | 1 · 2 2  |  |  |  | 2
3  |  0  | 1 · 0 0  | 2 · 2 4  | 1 · 90 90  |  |  | 94
4  |  0  | 1 · 0 0  | 3 · 2 6  | 3 · 90 270  | 1 · 31826 31826  |  | 32102
5  |  0  | 1 · 0 0  | 4 · 2 8  | 6 · 90 540  | 4 · 31826 127304  | 1 · 2147158386 2147158386  | 2147286238
illustration

These images show the pink patterns also seen in the two 8×256 matrices.
They are ordered by adicity (vertical) and valency (horizontal).

| Zhegalkin indices | truth tables

|

Pascal with columns multiplied by HalfGrass

| 🌊  triangle HalfCedar row sums HalfCrocus (A246418)

| 0 | 1 | 2 | 3 | 4 | 5 | sums
0  | 1 · 1 1  |  |  |  |  |  | 1
1  | 1 · 1 1  | 1 · 2 2  |  |  |  |  | 3
2  | 1 · 1 1  | 2 · 2 4  | 1 · 8 8  |  |  |  | 13
3  | 1 · 1 1  | 3 · 2 6  | 3 · 8 24  | 1 · 128 128  |  |  | 159
4  | 1 · 1 1  | 4 · 2 8  | 6 · 8 48  | 4 · 128 512  | 1 · 32768 32768  |  | 33337
5  | 1 · 1 1  | 5 · 2 10  | 10 · 8 80  | 10 · 128 1280  | 5 · 32768 163840  | 1 · 2147483648 2147483648  | 2147648859

PascalDrop with columns multiplied by HalfGrass

| 💧  triangle HalfCedarDrop row sums HalfCrocusDrop

| 0 | 1 | 2 | 3 | 4 | 5 | sums
0  | 1 · 1 1  |  |  |  |  |  | 1
1  |  0  | 1 · 2 2  |  |  |  |  | 2
2  |  0  | 1 · 2 2  | 1 · 8 8  |  |  |  | 10
3  |  0  | 1 · 2 2  | 2 · 8 16  | 1 · 128 128  |  |  | 146
4  |  0  | 1 · 2 2  | 3 · 8 24  | 3 · 128 384  | 1 · 32768 32768  |  | 33178
5  |  0  | 1 · 2 2  | 4 · 8 32  | 6 · 128 768  | 4 · 32768 131072  | 1 · 2147483648 2147483648  | 2147615522
illustration

These images show the blue patterns also seen in the two 8×256 matrices.  (Only a few of the 128 on the right side of the matrix are shown.)
They are ordered by adicity (vertical) and valency (horizontal).

| Zhegalkin indices | truth tables

|

all

Pascal with columns multiplied by Lotus

| 🌊  triangle Willow row sums Grass (A001146)

| 0 | 1 | 2 | 3 | 4 | 5 | sums
0  | 1 · 2 2  |  |  |  |  |  | 2
1  | 1 · 2 2  | 1 · 2 2  |  |  |  |  | 4
2  | 1 · 2 2  | 2 · 2 4  | 1 · 10 10  |  |  |  | 16
3  | 1 · 2 2  | 3 · 2 6  | 3 · 10 30  | 1 · 218 218  |  |  | 256
4  | 1 · 2 2  | 4 · 2 8  | 6 · 10 60  | 4 · 218 872  | 1 · 64594 64594  |  | 65536
5  | 1 · 2 2  | 5 · 2 10  | 10 · 10 100  | 10 · 218 2180  | 5 · 64594 322970  | 1 · 4294642034 4294642034  | 4294967296

PascalDrop with columns multiplied by Lotus

| 💧  triangle WillowDrop row sums GrassDrop (~A111403)

| 0 | 1 | 2 | 3 | 4 | 5 | sums
0  | 1 · 2 2  |  |  |  |  |  | 2
1  |  0  | 1 · 2 2  |  |  |  |  | 2
2  |  0  | 1 · 2 2  | 1 · 10 10  |  |  |  | 12
3  |  0  | 1 · 2 2  | 2 · 10 20  | 1 · 218 218  |  |  | 240
4  |  0  | 1 · 2 2  | 3 · 10 30  | 3 · 218 654  | 1 · 64594 64594  |  | 65280
5  |  0  | 1 · 2 2  | 4 · 10 40  | 6 · 218 1308  | 4 · 64594 258376  | 1 · 4294642034 4294642034  | 4294901760
♂ − ♀

Pascal with columns multiplied by NonLotus

| 🌊  triangle Hickory row sums Hyacinth (2*A059301)

| 0 | 1 | 2 | 3 | 4 | 5 | sums
0  | 1 · 0 0  |  |  |  |  |  | 0
1  | 1 · 0 0  | 1 · 2 2  |  |  |  |  | 2
2  | 1 · 0 0  | 2 · 2 4  | 1 · 6 6  |  |  |  | 10
3  | 1 · 0 0  | 3 · 2 6  | 3 · 6 18  | 1 · 38 38  |  |  | 62
4  | 1 · 0 0  | 4 · 2 8  | 6 · 6 36  | 4 · 38 152  | 1 · 942 942  |  | 1138
5  | 1 · 0 0  | 5 · 2 10  | 10 · 6 60  | 10 · 38 380  | 5 · 942 4710  | 1 · 325262 325262  | 330422

PascalDrop with columns multiplied by NonLotus

| 💧  triangle HickoryDrop row sums HyacinthDrop

| 0 | 1 | 2 | 3 | 4 | 5 | sums
0  | 1 · 0 0  |  |  |  |  |  | 0
1  |  0  | 1 · 2 2  |  |  |  |  | 2
2  |  0  | 1 · 2 2  | 1 · 6 6  |  |  |  | 8
3  |  0  | 1 · 2 2  | 2 · 6 12  | 1 · 38 38  |  |  | 52
4  |  0  | 1 · 2 2  | 3 · 6 18  | 3 · 38 114  | 1 · 942 942  |  | 1076
5  |  0  | 1 · 2 2  | 4 · 6 24  | 6 · 38 228  | 4 · 942 3768  | 1 · 325262 325262  | 329284
Pascal's triangle

|  | 🌊  Pascal

| 0 | 1 | 2 | 3 | 4 | 5 | sums
0  | 1  |  |  |  |  |  | 1
1  | 1  | 1  |  |  |  |  | 2
2  | 1  | 2  | 1  |  |  |  | 4
3  | 1  | 3  | 3  | 1  |  |  | 8
4  | 1  | 4  | 6  | 4  | 1  |  | 16
5  | 1  | 5  | 10  | 10  | 5  | 1  | 32
| 💧  PascalDrop

| 0 | 1 | 2 | 3 | 4 | 5 | sums
0  | 1  |  |  |  |  |  | 1
1  | 0  | 1  |  |  |  |  | 1
2  | 0  | 1  | 1  |  |  |  | 2
3  | 0  | 1  | 2  | 1  |  |  | 4
4  | 0  | 1  | 3  | 3  | 1  |  | 8
5  | 0  | 1  | 4  | 6  | 4  | 1  | 16

* * *

truth tables  (Zhegalkin matrix)

These matrices show the 97 females and 159 males among the first 256 Boolean functions.
The matrix above shows the Zhegalkin indices. The Zhegalkin matrix below shows the truth tables.
The male truth tables on the left side of the matrix contain repetitions, i.e. their pattern can be described by a shorter truth table.

atomvals  (bitwise OR)

The upper matrix shows the Zhegalkin indices. The one below shows atomvals of the corresponding Boolean functions.
This is sequence A327041, the bitwise ORs of the binary exponents seen above.

* * *

sequences of Zhegalkin indices

The counting sequences are: Primula, Petunia, SmallCrocus, SmallHibiscus, Grass, Moss

| a | ♀  | ♂  | all

|
|
|

🌊  | 💧  | Ж  | 🌊  | 💧  | Ж  | 🌊  | 💧
0  | 1 | 1  | 0,  | 1 | 1  | 1, | 2 | 2
1  | 1 | 0  |  | 3 | 2  | 2, 3, | 4 | 2
2  | 3 | 2  | 6, 7,  | 13 | 10  | 4, 5, 8, 9, 10, 11, 12, 13, 14, 15, | 16 | 12
3  | 97 | 94  | 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 66, 67, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 82, 83, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,  | 159 | 146  | 16, 17, 32, 33, 34, 35, 48, 49, 50, 51, 64, 65, 68, 69, 80, 81, 84, 85, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, | 256 | 240
4  | 32199 | 32102  | 258, 259, 260, 261  ...  32764, 32765, 32766, 32767  | 33337 | 33178  | 256, 257, 512, 513  ...  21840, 21841, 21844, 21845, 32768, 32769, 32770, 32771  ...  65532, 65533, 65534, 65535 | 65536 | 65280

females = [0, 6, 7, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 66, 67, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 82, 83, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127]

males = [1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 32, 33, 34, 35, 48, 49, 50, 51, 64, 65, 68, 69, 80, 81, 84, 85, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255]

4-ary females on Pastebin The male Zhegalkin indices are not to be confused with A359527.

## honesty and gender

[edit | edit source]

The XOR of all members of a family is either the tautology or the contradiction. Where it is the tautology, the BF shall be called honest.
Apparently there are no dishonest males. So every dishonest BF is female, and every male BF is honest. (It should be kept in mind, that these are statements about Boolean functions. Generally, it is discouraged to assume, that all males are honest.)

sequences

| 0 | 1 | 2 | 3 | 4
female  | 1 | 1 | 3 | 97 | 32199
dishonest female | 1 | 1 | 1 | 57 | 30537
honest female  | 0 | 0 | 2 | 40 | 1662
honest male  | 1 | 3 | 13 | 159 | 33337
honest  | 1 | 3 | 15 | 199 | 34999
all  | 2 | 4 | 16 | 256 | 65536

See triangles by weight, e.g. male, honest.

The following images show 3-ary Boolean functions.  See also: Boolf prop/3-ary/honesty and gender, Boolf prop/3-ary/honesty, gender, sharpness, introversion
The pattern of Zhegalkin indices for dishonest BF is similar to a Walsh matrix (with columns 3 and 7 exchanged). But that is specific to arity 3. So is the fact, that all non-trivial dishonest BF are balanced.

blunt (128)

female (97)

dishonest (57)

balanced (70)

These are the BF whose truth table has weight 4. Almost all dishonest BF are balanced. Only the contradiction is not.
(This is not the case for other arities. See triangle by weight.)

honest female (40)

sharp (128)

male (159)

honest (199)

*[a]: 🌊 arity    💧 adicity