# rankGeneratingFunction -- computes the rank generating function of a ranked poset

## Synopsis

• Usage:
r = rankGeneratingFunction P
r = rankGeneratingFunction(P, VariableName => symbol)
• Inputs:
• P, an instance of the type Poset, a ranked poset
• Optional inputs:
• VariableName => , default value q
• Outputs:
• r, , the rank generating function of $P$

## Description

The rank generating function of $P$ is the polynomial with the coefficient of $q^i$ given by the number of vertices in rank $i$ of $P$.

The rank generating function of the $n$ chain is $q^{n-1} + \cdots + q + 1$.

 i1 : n = 5; i2 : rankGeneratingFunction chain n 4 3 2 o2 = q + q + q + q + 1 o2 : ZZ[q]

The rank generating function of the $n$ booleanLattice is $(q+1)^n$.

 i3 : factor rankGeneratingFunction booleanLattice n 5 o3 = (q + 1) o3 : Expression of class Product