Sharedsage_worksheets / Putnam_Lattice_extension.sagewsOpen in CoCalc
Author: Ken Levasseur
Description: Worksheets related to Applied Discrete Structures
%md <p> In the 2018 Putnam, problem A-2 can be extended to general finite lattices, asking for the value of the determinant of the "meet matrix." Are there interesting families of lattices for which the matrix is nonsingular? The diamond poset is somewhat interesting. Here is the calculation for the </p>

In the 2018 Putnam, problem A-2 can be extended to general finite lattices, asking for the value of the determinant of the "meet matrix." Are there interesting families of lattices for which the matrix is nonsingular?

p=Posets.DiamondPoset(6);p
Finite lattice containing 6 elements
p.show(vertex_color="orange")
q=filter(lambda k:not(k in p.minimal_elements()),p.list());q
[1, 2, 3, 4, 5]
def chi(p,i,j): if p.meet(i,j) in p.minimal_elements(): return 0 else: return 1
A=Matrix(map(lambda k: map(lambda j:chi(p,j,k),q),q));A
[1 0 0 0 1] [0 1 0 0 1] [0 0 1 0 1] [0 0 0 1 1] [1 1 1 1 1]
det(A)
-3
def poset_d(p): q=filter(lambda k:not(k in p.minimal_elements()),p.list()) A=Matrix(map(lambda k: map(lambda j:chi(p,j,k),q),q)) return Matrix(A)
poset_d(Posets.DiamondPoset(8)).det()
-5
poset_d(Posets.DiamondPoset(8))
[1 0 0 0 0 0 1] [0 1 0 0 0 0 1] [0 0 1 0 0 0 1] [0 0 0 1 0 0 1] [0 0 0 0 1 0 1] [0 0 0 0 0 1 1] [1 1 1 1 1 1 1]
n=5 A=Matrix([[i==j or i==n-1 or j==n-1 for i in range(n)] for j in range(n)] ) [A,det(A)]
[[1 0 0 0 1] [0 1 0 0 1] [0 0 1 0 1] [0 0 0 1 1] [1 1 1 1 1], -3]
map(lambda k:(k,poset_d(Posets.DivisorLattice(k)).det()),range(1,40))
[(1, 1), (2, 1), (3, 1), (4, 0), (5, 1), (6, -1), (7, 1), (8, 0), (9, 0), (10, -1), (11, 1), (12, 0), (13, 1), (14, -1), (15, -1), (16, 0), (17, 1), (18, 0), (19, 1), (20, 0), (21, -1), (22, -1), (23, 1), (24, 0), (25, 0), (26, -1), (27, 0), (28, 0), (29, 1), (30, -1), (31, 1), (32, 0), (33, -1), (34, -1), (35, -1), (36, 0), (37, 1), (38, -1), (39, -1)]
map(lambda k:(k,poset_d(Posets.DivisorLattice(k)).det()),range(40,80))
[(40, 0), (41, 1), (42, -1), (43, 1), (44, 0), (45, 0), (46, -1), (47, 1), (48, 0), (49, 0), (50, 0), (51, -1), (52, 0), (53, 1), (54, 0), (55, -1), (56, 0), (57, -1), (58, -1), (59, 1), (60, 0), (61, 1), (62, -1), (63, 0), (64, 0), (65, -1), (66, -1), (67, 1), (68, 0), (69, -1), (70, -1), (71, 1), (72, 0), (73, 1), (74, -1), (75, 0), (76, 0), (77, -1), (78, -1), (79, 1)]
map(lambda k:(k,poset_d(Posets.DivisorLattice(k)).det()),[2*3*5*7,2*3*5*7*11,2*3*5*7*7])
[(210, -1), (2310, -1), (1470, 0)]
Posets.YoungsLattice(6).show(vertex_color="orange")
poset_d(Posets.YoungsLattice(5)).det()
0
Posets.TamariLattice(4).show(vertex_color="orange")
poset_d(Posets.TamariLattice(4))
[1]
poset_d(Posets.IntegerCompositions(5))
Error in lines 0-1 Traceback (most recent call last): File "/cocalc/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 1188, in execute flags=compile_flags) in namespace, locals File "", line 1, in <module> File "", line 3, in poset_d File "", line 3, in <lambda> File "", line 3, in <lambda> File "", line 2, in chi File "sage/structure/category_object.pyx", line 853, in sage.structure.category_object.CategoryObject.__getattr__ (build/cythonized/sage/structure/category_object.c:7759) return self.getattr_from_category(name) File "sage/structure/category_object.pyx", line 868, in sage.structure.category_object.CategoryObject.getattr_from_category (build/cythonized/sage/structure/category_object.c:7922) attr = getattr_from_other_class(self, cls, name) File "sage/cpython/getattr.pyx", line 389, in sage.cpython.getattr.getattr_from_other_class (build/cythonized/sage/cpython/getattr.c:2469) raise AttributeError(dummy_error_message) AttributeError: 'FinitePoset_with_category' object has no attribute 'meet'
be989fb1-72b3-433f-b2d9-78f080d43cca