frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

What Every Programmer Should Know About Enumerative Combinatorics

https://leetarxiv.substack.com/p/counting-integer-compositions
45•muragekibicho•3d ago

Comments

pestatije•3d ago
why?
muragekibicho•3d ago
Algorithms like HyperLoglog are an exercise in Enumerative Combinatorics
jpgvm•4h ago
To add to this HyperLogLog, sketches and bloom filters are the magic that make most of modern distributed databases tick.
dgan•3h ago
that's not a helpful response. Congrats on knowing that, but the rest of us are still in the dark about the usage
discreteevent•4h ago
>Enumerative combinatorics is a branch of mathematics focused on counting the elements of a set.

These people are experts on sets but then they use the word "every" instead of "some" or "a subset of".

They just assume that everybody must be doing what they do. This is why Alan Kay said: “Point of View is worth 80 IQ points"

johnisgood•5h ago
What is the difference between integer compositions and integer partitions? It says a composition is just an ordered partition of an integer, but according to this article, number 4 can be partitioned into 5 parts, but apparently has 8 compositions. I find the 8 compositions much more accurate, but I do not get why it would not have 8 partitions.
tux3•4h ago
1 + 3 and 3 + 1 are the same partition of 4, because it's a sum with the same two numbers. The order of the 1 and the 3 doesn't matter for partitions.

But that's two compositions.

I think this article could really use more applied, concrete examples if it's intended for programmers.

It seems their idea for connecting math and programming was printing out a bunch of C code, without further motivation. But coding is an applied field, developpers will want a concrete idea of what they can do with it.

This is still too abstract.

johnisgood•3h ago
Thank you for the explanation, it definitely cleared things up for me.

> I think this article could really use more applied, concrete examples if it's intended for programmers.

> This is still too abstract.

I agree.

Etheryte•4h ago
Don't the title illustration and the actual content of the article mix up which is which?
qsort•4h ago
I find the presentation a bit confusing and I'm already very familiar with this material.

From a purely mathematical point of view, why this choice of topics? You correctly point out that counting partitions has no closed formula, but there are a lot of related problems (Sitrling numbers of the two kinds for example) which are of more practical utility (e.g. they are related to sums of powers formulas). If that's too advanced for your audience then why not present more standard tricks like combinations with replacement aka stars and bars?

From a programmer's point of view, you could have focused more on how to generate subsets, permutations, partitions etc. in a memory-efficient way, for example how the Python stdlib does it.

Also, the factorial number system and the binomial base of univariate polynomials are definitely not "alternatives to base 2 in computer architectures".

Don't take this the wrong way but I struggle to see who you are writing for.

FjordWarden•1h ago
I am just a simple web developer and I found this stuff interesting. Learning about array programming has taught me the importance of combinatorics and its possible application to GPU programming. It is just the first chapter in a series of articles, I'd say let the man cook.
giomasce•3h ago
What Every Programmer Should Know About Enumerative Combinatorics -> Nothing.

It can be interesting to know something (or even a lot) about enumerative combinatorics, and certainly there are some specific programming contexts in which that's a hard prerequisite, but it's not a topic that necessarily concerns every programmer.

OTOH I think it would greatly help programmers, especially beginners, to have fewer click baity titles around.

globalnode•2h ago
Yep, also with little in the way of motivating examples and a pile of mathematics to sift through, its hard to devote the time to this.
jillesvangurp•1h ago
This is easily verified by the notion that the overwhelmingly vast majority of programmers (myself included) probably know very little of the topic. Seemingly without that causing a lot of issues.

IMHO math in general is overrated for general purpose programming. I had plenty of math in college in the early nineties. I rarely need or use any of it. And when I do, I need to look up a lot of stuff for the simple reason that it's been decades since I last needed that knowledge. Very basic stuff even. Like highschool trigonometry (did some stuff with that a while back). Most programmers are just glorified plumbers that stick things together that others have built. They aren't designing new databases (for example) but simply using them. Which tends to be a lot easier. Though it helps to understand their general design and limitations. And if you are going to build a database, you might want to read up on a thing or two.

There is a wide range of esoteric topics you can dive into and learn a lot about. Diving into some of those in university is useful because it prepares you for a lifetime of needing to learn to wrap your head around random weird shit constantly that you need to understand to do the job. The point is not learning all that stuff upfront but simply learning enough that you can learn more when you need to. So, studying math and some other topics is a good preparation for that. You'll forget most of it if you don't use it. But when you need to, refreshing what you knew isn't that big of a deal.

The skill isn't in knowing that stuff but in being able to master that stuff.

cableshaft•1h ago
Certain fields need it more than others. Graphics and vide game development needs more math than web app development (well, usually. Sometimes you need to implement a formula), including trigonometry.

I used a bunch of trigonometry when I was making 2D action games, getting characters to move about the screen and move smoothly at all sorts of angles, for one example. I also used Sine functions a lot for UI animations, making things looks like they're hovering or oscillating up and down.

I think one of the benefits of these classes, though, and university classes in general, is that even if you don't use or really remember the specifics decades later, you're at least aware of how these problems can be solved, and can look up and verify potential solutions much quicker than if you hadn't ever been exposed to it at all.

donatj•43m ago
> IMHO math in general is overrated for general purpose programming. I had plenty of math in college in the early nineties. I rarely need or use any of it. And when I do, I need to look up a lot of stuff

The value isn't in knowing how to do math, it's in knowing when.

The value of a math class is far less in learning and remembering exactly how and, far more in learning what you can do with it so you can spot possible solutions when they arise. Expanding your mental toolkit.

odyssey7•1h ago
I don't know, I once messed up a Big Tech interview question that was about enumerative combinatorics.
relaxing•2h ago
Anyone else have the combinatorics song from Square One TV forever burned into their brain?

A Cyndi Lauper soundalike explains how many unique bands she can form by choosing from an expanding pool of musicians. Catchy!

https://youtu.be/w0i_ZFlGTVY?si=ThEcjtYvivMkBgcv

rck•1h ago
Just about everything that a non-specialist in combinatorics needs to know about counting can be found in Rota's twelvefold way, which lists the 12 counting problems that you can define for finite sets and shows how to solve them:

https://en.wikipedia.org/wiki/Twelvefold_way

This also takes care of most of discrete probability.

tmoertel•1h ago
What's the deal with this notice, presumably injected by GitHub into the hosted code samples in the article:

> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below.

barbazoo•3m ago
I didn’t quite get from the write up what it is that every programmer should know about enumerative combinatorics or why it’s a relevant topic for programmers at all honestly.

Spaced repetition systems have gotten way better

https://domenic.me/fsrs/
163•domenicd•2h ago•135 comments

Show HN: A web browser agent in your Chrome side panel

https://github.com/parsaghaffari/browserbee
23•parsabg•2h ago•10 comments

Coding without a laptop: Two weeks with AR glasses and Linux on Android

https://holdtherobot.com/blog/2025/05/11/linux-on-android-with-ar-glasses/
806•mikenew•3d ago•301 comments

AniSora: Open-source anime video generation model

https://komiko.app/video/AniSora
275•PaulineGar•14h ago•122 comments

How the Sun Enterprise 10000 was born (2007)

https://www.filibeto.org/aduritz/truetrue/e10000/how-e10k-wasborn.html
17•robin_reala•1h ago•3 comments

The Conquest of Hell Gate [pdf]

https://www.nan.usace.army.mil/portals/37/docs/history/hellgate.pdf
12•sklargh•2h ago•0 comments

Working with Git Patches in Apple Mail (2023)

https://btxx.org/posts/mail/
4•todsacerdoti•1h ago•0 comments

Project Verona: Fearless Concurrency for Python

https://microsoft.github.io/verona/pyrona.html
109•ptx•3d ago•69 comments

In Memoriam: John L. Young, Cryptome Co-Founder

https://www.eff.org/deeplinks/2025/05/memoriam-john-l-young-cryptome-co-founder
21•coloneltcb•2d ago•0 comments

Lessons from Mixing Rust and Java: Fast, Safe, and Practical

https://medium.com/@greptime/how-to-supercharge-your-java-project-with-rust-a-practical-guide-to-jni-integration-with-a-86f60e9708b8
79•killme2008•3d ago•19 comments

What Every Programmer Should Know About Enumerative Combinatorics

https://leetarxiv.substack.com/p/counting-integer-compositions
45•muragekibicho•3d ago•21 comments

Show HN: Hardtime.nvim – break bad habits and master Vim motions

https://github.com/m4xshen/hardtime.nvim
8•m4xshen•2h ago•1 comments

High Available Mosquitto MQTT on Kubernetes

https://raymii.org/s/tutorials/High_Available_Mosquitto_MQTT_Broker_on_Kubernetes.html
14•jandeboevrie•3d ago•6 comments

Experts have it easy (2024)

https://boydkane.com/essays/experts
128•veqq•12h ago•48 comments

Mystical

https://suberic.net/~dmm/projects/mystical/README.html
289•mmphosis•19h ago•34 comments

Show HN: Turn any workflow diagram into compilable, running and stateful code

https://workflows.diagrid.io/
69•yaronsc•3d ago•15 comments

Paper Mechanisms

https://cutfoldtemplates.com
11•downboots•3h ago•0 comments

Craft Basic (Windows 95 and up)

https://www.lucidapogee.com/?page=craftbasic
21•lintalist•5h ago•1 comments

Google Logo Ligature Bug

https://www.jefftk.com/p/google-logo-ligature-bug
44•cubefox•1h ago•3 comments

Why some friendships end after kids come into the picture

https://text.npr.org/nx-s1-5371490
16•mooreds•1h ago•14 comments

How to have the browser pick a contrasting color in CSS

https://webkit.org/blog/16929/contrast-color/
218•Kerrick•21h ago•66 comments

Dead Stars Don’t Radiate

https://johncarlosbaez.wordpress.com/2025/05/17/dead-stars-dont-radiate-and-shrink/
221•thechao•20h ago•113 comments

If nothing is curated, how do we find things

https://tadaima.bearblog.dev/if-nothing-is-curated-how-do-we-find-things/
272•nivethan•22h ago•191 comments

State of the Art PFAS [pdf]

https://iplo.nl/publish/pages/235260/state-of-the-art-pfas.pdf
3•paulmist•3h ago•0 comments

Palette lighting tricks on the Nintendo 64

https://30fps.net/pages/palette-lighting-tricks-n64/
203•ibobev•23h ago•46 comments

Mice grow bigger brains when given this stretch of human DNA

https://www.nature.com/articles/d41586-025-01515-z
52•pavel_lishin•3d ago•38 comments

Mexican Navy ship crashes into Brooklyn Bridge leaving two people dead

https://www.theguardian.com/us-news/2025/may/18/mexican-navy-ship-hits-brooklyn-bridge-during-promotional-tour
109•teleforce•7h ago•61 comments

Understanding Transformers via N-gram Statistics

https://arxiv.org/abs/2407.12034
103•pona-a•18h ago•11 comments

Show HN: Chat with 19 years of HN

https://app.camelai.com/log-in?next=/hn/
28•vercantez•10h ago•14 comments

O2 VoLTE: locating any customer with a phone call

https://mastdatabase.co.uk/blog/2025/05/o2-expose-customer-location-call-4g/
291•kragniz•1d ago•65 comments