Analytic Combinatorics – A Worked Example

by mathgeniuson 4/8/2025, 5:29 PMwith 54 comments

by anticson 4/8/2025, 6:09 PM

This is only tangentially related, but one thing that I am still kind of hopeful about is analytic combinatorics will free us from the tyranny of asymptotic analysis.

I suppose this is kind of a hot take, and in some ways less relevant than it was (say) 10 years ago, but I believe the theoretical CS community has spent a lot of time analyzing the performance of various algorithms over the years and kind of pointedly not inventing algorithms which accomplish some result at all, even if it is only known to be computable in a pathologically inefficient way. This means a lot of breakthroughs that could have been TCS breakthroughs have been invented, usually worse, by other communities.

I am not the only one who thinks so, here[1] is an obscure talk where Michael Mitzenmacher (a well-known CS theory prof at Harvard) makes more or less this specific complaint.

One of the nice things about Flajolet/Sedgewick[2] (mentioned in this post) is that it gives a nice set of combinators for (at least it seems to me, in theory) precisely enumerating how many "steps" an algorithm would take given some input. I optimistically imagine a world where we replace the relatively non-specific asymptotic bounds of an algorithm with a very specific quantification of the work an algorithm will take. And that this in turn would free TCS to focus on things that are more germane to the field as a whole.

With that all said I'm open to the argument that TCS has fundamentally changed and this is no longer such a big issue. But perusing the various TCS conferences I sense it isn't.

[1]: https://www.youtube.com/watch?v=p3anjSAnKBo

[2]: https://algo.inria.fr/flajolet/Publications/book.pdf

by PollardsRhoon 4/8/2025, 6:37 PM

Very cool!

What's meant by "it’s already too much to ask for a closed form for fibonacci numbers"? Binet's formula is usually called a closed form in my experience. Is "closed form" here supposed to mean "closed form we can evaluate without needing arbitrary-precision arithmetic"?

by paulpauperon 4/8/2025, 8:22 PM

This article gets things wrong and overcomplicates other things.

he confuses the characteristic equation for the generating function. This : T(z) = z + zT + zT^2 + zT^3 is the characteristic equation.

There is no simple generating function ,as it's not possible to easily invert a cubic closed in form.

Successive derivatives of the generating function are taken to find the coefficients of the infinite series that encodes the sought values. It's hard enough explaining this with a quadratic; a cubic so much more involved.

This so far beyond the scope of a blog post. You need to spend at least a few weeks working on this or take some college courses.

by thomasahleon 4/8/2025, 8:47 PM

There's an interesting extension to Analytic Combinatorics by Flajolet/Sedgewick called "Analytic Combinatorics in Several Variables" by Pemantle and Wilson: https://www2.math.upenn.edu/~pemantle/papers/ACSV.pdf and https://acsvproject.com/

It extends the original framework with a lot of useful new primitives, like Hadamard products. Super useful!

by WhitneyLandon 4/9/2025, 2:08 AM

What math lets you most easily be convinced you’ve come up with the right answer when you actually haven’t?

Seems like combinatorics comes in second only to statistics.

by vmchaleon 4/9/2025, 11:03 AM

in Haskell you can read off the generating function's coefficients directly from the functional equation T(z) = z + zT + zT² + zT²

ghci> ts=0:(1+ts+ts^2+ts^3) ghci> take 12 ts [0,1,1,2,5,13,36,104,309,939,2905,9118]

Using the Num instance for power series (very cute application of laziness expounded by Karczmarczuk and then McIlroy https://dl.acm.org/doi/abs/10.1017/s0956796899003299)

by 1minuspon 4/8/2025, 6:45 PM

I find this interesting but the nomenclature escapes me: How is T(z) = z + zT + zT^2 + ... ? I find the jump from the functional programming description of the tree to this recurrence relation not intuitive

by globnomulouson 4/8/2025, 11:22 PM

This article is technically way beyond me, but can anybody explain to me what on earth a "worked example" is? That expression is completely incoherent.

by DadBaseon 4/9/2025, 2:29 AM

The key is to always square the generating function—it doesn’t matter why, it just feels more correct. Learned that from a proof in an old cereal box puzzle.