Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168731
Image: ubuntu2004
Definition of poset Q
Q=Poset((range(1,9),[[1,5],[1,6],[2,6],[3,7],[3,8],[4,7],[4,8],[5,7],[5,8],[6,7],[6,8]]),cover_relations=True)
Let us check that the definition of Q is correct (beware of the bad output given by sage)
Q.plot()
Number of linear extensions
len(Q.linear_extensions())
300
Definition of major index
def maj(w): w2=map(lambda i: int(i.n()),w) return Permutation(w2).major_index()
Computation of the left-hand side of the hook formula
var('q') LHS=sum([q^(maj(w)) for w in Q.linear_extensions()]);LHS
q^20 + 3*q^19 + 6*q^18 + 10*q^17 + 15*q^16 + 19*q^15 + 21*q^14 + 22*q^13 + 22*q^12 + 21*q^11 + 20*q^10 + 21*q^9 + 22*q^8 + 22*q^7 + 21*q^6 + 19*q^5 + 15*q^4 + 10*q^3 + 6*q^2 + 3*q + 1
Definition of q analogues of integers and factorials
def qint(k): return sum([q^i for i in range(k)]) def qfact(k): return prod([qint(i) for i in range(1,k+1)])
Checking our formula
N=qfact(8)*qint(5)*qint(14);N
(q + 1)*(q^2 + q + 1)*(q^3 + q^2 + q + 1)*(q^4 + q^3 + q^2 + q + 1)^2*(q^5 + q^4 + q^3 + q^2 + q + 1)*(q^6 + q^5 + q^4 + q^3 + q^2 + q + 1)*(q^7 + q^6 + q^5 + q^4 + q^3 + q^2 + q + 1)*(q^13 + q^12 + q^11 + q^10 + q^9 + q^8 + q^7 + q^6 + q^5 + q^4 + q^3 + q^2 + q + 1)
D=(qint(2)*qint(3)*qint(7)*qint(7)*qint(4)*qint(8));D
(q + 1)*(q^2 + q + 1)*(q^3 + q^2 + q + 1)*(q^6 + q^5 + q^4 + q^3 + q^2 + q + 1)^2*(q^7 + q^6 + q^5 + q^4 + q^3 + q^2 + q + 1)
expand(D*LHS)-expand(N)
0