Skip to content

QBinomial ​

The Gaussian (q-)binomial coefficient (nk)q\binom{n}{k}_q, the generating polynomial in qq for partitions fitting in a k×(n−k)k \times (n-k) box. Provided by @enumeratio/analytic.

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguageQBinomial✓
QBinomial(n, k, q)the Gaussian binomial coefficient (nk)q\binom{n}{k}_q.
SageMathq_binomial(n, k, q)
Typed signatures
TypePackageApplies
(complex, complex, complex) -> numberanalyticalways

Domain: Special functions

Details
  • Built by the Pascal-like recurrence (nk)q=(n−1k−1)q+qk(n−1k)q\binom{n}{k}_q = \binom{n-1}{k-1}_q + q^k \binom{n-1}{k}_q, with (n0)q=(nn)q=1\binom{n}{0}_q = \binom{n}{n}_q = 1 — pure addition and multiplication, never division, so it stays a genuine polynomial for symbolic qq that Expand can open up. The equivalent quotient [n]q!/([k]q![n−k]q!)[n]_q!/([k]_q![n-k]_q!) is exact numerically but Expand alone can't cancel it down to a polynomial when qq is symbolic, which is why the recurrence is used instead.
  • At q=1q = 1 it reduces to the ordinary (nk)\binom{n}{k} by the same recurrence Pascal's triangle uses.
  • A symbolic, non-integer or negative nn or kk is a held call (still canonical, so it sits in a sum or difference). At q=0q = 0 with a non-integer rational nn or kk, Series expands the product (qk+1;q)∞(qn−k+1;q)∞/((q;q)∞(qn+1;q)∞)(q^{k+1};q)_\infty (q^{n-k+1};q)_\infty / \big((q;q)_\infty (q^{n+1};q)_\infty\big) as a series in q1/dq^{1/d}, with Wolfram's truncation. A factor with a negative exponent contributes a leading negative power, so the series is a Laurent–Puiseux one; only a shape whose denominator reflects with no numerator doing so, or a pole, stays unevaluated. Where Wolfram itself falls back to Derivative coefficients (a family of non-integer shapes, and its order-0 1 + O(q)), ours is the exact expansion.

Plot

the complex plot cannot lower QBinomial

Examples

7 more kept as data, checked against the oracles
Basic #

(24−1)(23−1)(22−1)(2−1)=35\frac{(2^4-1)(2^3-1)}{(2^2-1)(2-1)} = 35

live ↗
InQBinomial(4,2,2)\mathrm{QBinomial}(4, 2, 2)Out3535
live ↗
InSeries⁡(QBinomial(12,1,x),x,0,2)\operatorname{Series}(\mathrm{QBinomial}(\frac{1}{2}, 1, x), x, 0, 2)Out−x−x3+1+x+x2+O(x5)-\sqrt{x}-\sqrt{x}^{3}+1+x+x^2+O\left(\sqrt{x}^{5}\right)
live ↗
InNormal⁡(Series⁡(QBinomial(12,2,x),x,∞,2))\operatorname{Normal}(\operatorname{Series}(\mathrm{QBinomial}(\frac{1}{2}, 2, x), x, ∞, 2))OutSeries⁡(QBinomial(12,2,x),x,∞,2)\operatorname{Series}(\mathrm{QBinomial}(\frac{1}{2}, 2, x), x, ∞, 2)
Scope #

A polynomial in q whose coefficients count partitions in a 2 × 2 box

live ↗
InExpand(QBinomial(4,2,q))\mathrm{Expand}(\mathrm{QBinomial}(4, 2, q))Outq4+q3+2q2+q+1q^4+q^3+2q^2+q+1
live ↗
InN(QBinomial(1517,5,1),50)N(\mathrm{QBinomial}(\frac{15}{17}, 5, 1), 50)Out0.006 383 037 165 010 279 204 173 378 023 279 809 163 880 587 974 704 50.006\,383\,037\,165\,010\,279\,204\,173\,378\,023\,279\,809\,163\,880\,587\,974\,704\,5
live ↗
InN(QBinomial(2347,5−i,2))N(\mathrm{QBinomial}(\frac{23}{47}, 5-i, 2))Out−0.000 071 801 621 838 786 11−0.000 065 724 259 755 274 13i-0.000\,071\,801\,621\,838\,786\,11-0.000\,065\,724\,259\,755\,274\,13i
live ↗
InFullSimplify(Normal⁡(Series⁡(QBinomial(n,x,q),x,0,2)))\mathrm{FullSimplify}(\operatorname{Normal}(\operatorname{Series}(\mathrm{QBinomial}(n, x, q), x, 0, 2)))Out12QBinomial(0,2,0)(n,0,q)x2+xQBinomial(0,1,0)(n,0,q)+QBinomial(n,0,q)\frac{1}{2}\mathrm{QBinomial}^{(0, 2, 0)}(n, 0, q)x^2+x\mathrm{QBinomial}^{(0, 1, 0)}(n, 0, q)+\mathrm{QBinomial}(n, 0, q)
live ↗
InFullSimplify(Normal⁡(Series⁡(QBinomial(n,x,q),x,x0,2)))\mathrm{FullSimplify}(\operatorname{Normal}(\operatorname{Series}(\mathrm{QBinomial}(n, x, q), x, \mathrm{x0}, 2)))Out12∂2∂x02QBinomial(n,x0,q)(x−x0)2+(x−x0)∂∂x0QBinomial(n,x0,q)+QBinomial(n,x0,q)\frac{1}{2}\frac{∂^{2}}{∂\mathrm{x0}^{2}} \mathrm{QBinomial}(n, \mathrm{x0}, q)(x-\mathrm{x0})^2+(x-\mathrm{x0})\frac{∂}{∂\mathrm{x0}} \mathrm{QBinomial}(n, \mathrm{x0}, q)+\mathrm{QBinomial}(n, \mathrm{x0}, q)
live ↗
InQBinomial(7,0,5)\mathrm{QBinomial}(7, 0, 5)Out11

Past the top there is nothing to choose

live ↗
InQBinomial(3,5,2)\mathrm{QBinomial}(3, 5, 2)Out00
Applications #

The number of 2-dimensional subspaces of F35\mathbb{F}_3^5

live ↗
InQBinomial(5,2,3)\mathrm{QBinomial}(5, 2, 3)Out1 2101\,210
Properties #

At q = 1 it is Binomial(6, 3)

live ↗
InQBinomial(6,3,1)\mathrm{QBinomial}(6, 3, 1)Out2020
live ↗
InSeries⁡(QBinomial(5,52,q),q,0,4)\operatorname{Series}(\mathrm{QBinomial}(5, \frac{5}{2}, q), q, 0, 4)Out−4q9−2q7+1+q+2q2+3q3+5q4+O(q5)-4\sqrt{q}^{9}-2\sqrt{q}^{7}+1+q+2q^2+3q^3+5q^4+O\left(q^5\right)

A negative exponent in the product starts the series below q0q^0

live ↗
InSeries⁡(QBinomial(0,32,q),q,0,3)\operatorname{Series}(\mathrm{QBinomial}(0, \frac{3}{2}, q), q, 0, 3)Out−9q3−3q−1q+2+5q+15q2+O(q5)-9\sqrt{q}^{3}-3\sqrt{q}-\frac{1}{\sqrt{q}}+2+5q+15q^2+O\left(\sqrt{q}^{5}\right)

(53)q=(52)q\binom{5}{3}_q=\binom{5}{2}_q, the same 1210 as above

live ↗
InQBinomial(5,3,3)\mathrm{QBinomial}(5, 3, 3)Out1 2101\,210
About
Examples22
Checked againstWolfram Language 21 agree1 unevaluatedSageMath 11 agree1 unevaluated10 error
CrosswalkWolfram LanguageSageMath

Implementation

primitive · kernela kernel — an algorithm over mutable state that would not be readable as a tree

nativeenginetypescriptpackages/symbols/analysis/analytic/src/q-series.ts

the Pascal-like recurrence, built at canonicalization time so Expand sees the tree.

mappedexternalwolframpackages/oracle/src/mappings.ts

QBinomial[n, k, q].

mappedsagepackages/oracle/src/mappings.ts

See also: QPochhammer, QFactorial, Binomial