#14496: unify the three implementations of gaussian q-binomial coefficients
-------------------------------------+--------------------------------------
Reporter: chapoton | Owner: tbd
Type: task | Status: needs_info
Priority: major | Milestone: sage-5.10
Component: combinatorics | Resolution:
Keywords: gaussian binomial | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Frédéric Chapoton | Merged in:
Dependencies: | Stopgaps:
-------------------------------------+--------------------------------------
Comment (by fwclarke):
Replying to [comment:10 chapoton]:
> According to my own timings, it seems that for n <= ~ 78 the naive
algorithm is faster than the cyclotomic algorithm for computing the
gaussian polynomial.
I get much the same. For `gaussian_binomial(2*k, k)` I found the naive
method faster for `k < 30`, and the cyclotomic method faster for `k > 30'.
One point about the naive method:
{{{
sage: %timeit gaussian_binomial(50, 4)
1000 loops, best of 3: 287 µs per loop
sage: %timeit gaussian_binomial(50, 46)
100 loops, best of 3: 3.41 ms per loop
}}}
Since the code contains two loops of length `k`, it's obviously better to
evaluate `gaussian_binomial(n, k)` as `gaussian_binomial(n, n-k)` if `k >
n/2`.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14496#comment:11>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.