Returns the q-binomial coefficient.
If p is unspecified, then it defaults to using the generator q for a univariate polynomial ring over the integers.
EXAMPLES:
sage: import sage.combinat.q_analogues as q_analogues
sage: q_analogues.q_binomial(4,2)
q^4 + q^3 + 2*q^2 + q + 1
sage: p = ZZ['p'].0
sage: q_analogues.q_binomial(4,2,p)
p^4 + p^3 + 2*p^2 + p + 1
The q-analogue of binomial(n,k) is currently only defined for n a nonnegative integer, it is zero for negative k (trac #11411):
sage: q_analogues.q_binomial(5, -1)
0
Returns the q-Catalan number of index n.
If p is unspecified, then it defaults to using the generator q for a univariate polynomial ring over the integers.
There are several q-Catalan numbers. This procedure returns the one which can be written using the q-binomial coefficients.
EXAMPLES:
sage: import sage.combinat.q_analogues as q_analogues
sage: q_analogues.q_catalan_number(4)
q^12 + q^10 + q^9 + 2*q^8 + q^7 + 2*q^6 + q^5 + 2*q^4 + q^3 + q^2 + 1
sage: p = ZZ['p'].0
sage: q_analogues.q_catalan_number(4,p)
p^12 + p^10 + p^9 + 2*p^8 + p^7 + 2*p^6 + p^5 + 2*p^4 + p^3 + p^2 + 1
The q-Catalan number of index n is only defined for n a nonnegative integer (trac #11411):
sage: q_analogues.q_catalan_number(-2)
Traceback (most recent call last):
...
ValueError: Argument (-2) must be a nonnegative integer.
Returns the q-analogue of the factorial n!.
If p is unspecified, then it defaults to using the generator q for a univariate polynomial ring over the integers.
EXAMPLES:
sage: import sage.combinat.q_analogues as q_analogues
sage: q_analogues.q_factorial(3)
q^3 + 2*q^2 + 2*q + 1
sage: p = ZZ['p'].0
sage: q_analogues.q_factorial(3, p)
p^3 + 2*p^2 + 2*p + 1
The q-analogue of n! is only defined for n a nonnegative integer (trac #11411):
sage: q_analogues.q_factorial(-2)
Traceback (most recent call last):
...
ValueError: Argument (-2) must be a nonnegative integer.
Returns the q-analogue of the integer n.
If p is unspecified, then it defaults to using the generator q for a univariate polynomial ring over the integers.
EXAMPLES:
sage: import sage.combinat.q_analogues as q_analogues
sage: q_analogues.q_int(3)
q^2 + q + 1
sage: p = ZZ['p'].0
sage: q_analogues.q_int(3,p)
p^2 + p + 1
The q-analogue of n is only defined for n a nonnegative integer (trac #11411):
sage: q_analogues.q_int(-2)
Traceback (most recent call last):
...
ValueError: Argument (-2) must be a nonnegative integer.
Returns the q,t-Catalan number of index n.
EXAMPLES:
sage: import sage.combinat.q_analogues as q_analogues
sage: q_analogues.qt_catalan_number(1)
1
sage: q_analogues.qt_catalan_number(2)
q + t
sage: q_analogues.qt_catalan_number(3)
q^3 + q^2*t + q*t^2 + t^3 + q*t
sage: q_analogues.qt_catalan_number(4)
q^6 + q^5*t + q^4*t^2 + q^3*t^3 + q^2*t^4 + q*t^5 + t^6 + q^4*t + q^3*t^2 + q^2*t^3 + q*t^4 + q^3*t + q^2*t^2 + q*t^3
The q,t-Catalan number of index n is only defined for n a nonnegative integer (trac #11411):
sage: q_analogues.qt_catalan_number(-2)
Traceback (most recent call last):
...
ValueError: Argument (-2) must be a nonnegative integer.