Template:Seal integer representations
Like Boolean functions in general, seals should be seen as periodic truth tables (corresponding to fractions).
For a given arity they can be seen as finite truth tables (corresponding to integers). But this approach shall be avoided here.
The integer values of the finite truth tables form the sequence Rose = 1, 3, 5, 9, 15... (A190939) An illustration can be seen here.
sequence Rose for arity 4 (adicities 0...4) |
---|
1, |
Hasse diagrams for arities 2 and 3 | |
---|---|
The gray numbers are the keys to sequence Rose. This is a consistent numbering only for a given arity, but not across arities. Seals with the same label are not equal. E.g. label 0 stands for on the left, but for on the right. Equal seals do not have the same label. E.g. the tautology is labeled 4 on the left, but 15 on the right. | |
Python program to calculate the integer sequence | ||
---|---|---|
This code uses the Python library discrete helpers. from discretehelpers.a import make_linear_binv
arity = 4
depth_to_seals = {depth: None for depth in range(arity)}
depth_to_seals[0] = [make_linear_binv(walsh=0, parity=1, arity=arity)] # tautology
depth_to_seals[1] = [make_linear_binv(walsh=i, parity=1, arity=arity) for i in range(1, 2 ** arity)] # negated Walsh functions
for new_depth in range(2, arity+1):
new_weight = 2 ** (arity - new_depth)
old_depth = new_depth - 1
old_seals = depth_to_seals[old_depth]
new_seals = set()
for key_a, seal_a in enumerate(old_seals):
for key_b in range(key_a + 1, len(old_seals)):
seal_b = old_seals[key_b]
candidate = seal_a & seal_b
if candidate.weight == new_weight:
new_seals.add(candidate)
depth_to_seals[new_depth] = sorted(new_seals)
lengths = []
sequence = []
for depth, seals in depth_to_seals.items():
rank = arity - depth
seal_integers = sorted([seal.intval for seal in seals])
print(f'{rank}: {seal_integers},')
lengths.append(len(seal_integers))
sequence += seal_integers
print('\n', lengths)
print('\n', sorted(sequence))
|
A better way to represent the seals by integers is with Zhegalkin indices. They form the sequence Tulip = 1, 3, 5, 7, 15...
sequence Tulip for arity 4 (adicities 0...4) |
---|
1, |
illustration: Zhegalkin indices and truth tables for arity 4 |
---|
The rows of the green matrix are the twins of those in the red matrix. |