Hacker Newsnew | past | comments | ask | show | jobs | submit | giomasce's commentslogin

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.


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.


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.


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.


There's value in "being able to master that stuff," and there's value in "having mastered that stuff." The latter lets you trim a lot of possible designs from your search space nearly instantly, letting you focus on routes which are actually viable. The former is only of similar power when you know the design in advance or there aren't many possible solutions.

For a simple example, suppose you need to operate on `n` permutations of an enormous collection of data (far more than fits in RAM or disk), and you need those permutations to be re-usable.

One simple solution is to shuffle the indices `n` times and store the results in your cluster, but even the shuffle process is slow with normal techniques because of inter-machine random-access bandwidth issues. When using those shuffled indices for anything, you're again bandwidth-limited if the task doesn't require access of every index.

With just a tiny bit of a math background, you'll recognize that an O(1)-state shuffle is possible, where you can create some `Permutation` object with a `permute()` method, taking in an index and outputting the corresponding index in your hypothetical shuffle. That permutation will be CPU-bound rather than bandwidth-bound.

The problem with "being able to master stuff" is that your search process in the design space is slow. If I went and told you that an O(1)-state shuffle existed and would be good for the problem, sure, you'd be able to go code that up without issues. What's the chance that you'd even know to try though?

> wide range of esoteric topics ... prepares you for a lifetime of learning

That's part of it, but each of those esoteric topics also give new ideas something to latch onto. Our brains are associative, and being able to look at a new thing and tie it to a few esoteric concepts is a bit of a superpower, even if the association is weak. The difference between knowing nothing other than how to learn and knowing what's vaguely potentially possible or not is weeks or months of research. It's the difference between having to do the dumb, slow thing and being the person promoted for saving $1m/yr fixing whatever you wrote. You can get by for a long time, maybe your entire career, just making shit work, but if you're looking for more money or prestige then there are better routes.


> What's the chance that you'd even know to try though?

> [...] esoteric topics also give new ideas something to latch onto. Our brains are associative, and being able to look at a new thing and tie it to a few esoteric concepts is a bit of a superpower, even if the association is weak. The difference between knowing nothing other than how to learn and knowing what's vaguely potentially possible or not is weeks or months of research.

The only point I'd add to your paragraph is that this applies to every domain when you're on the job, not just math. I live in constant terror of discovering that other disciplines solved my problem like a hundred years ago.


What "O(1)-state shuffle" could you possibly be talking about? It takes `O(nlogn)` space to store a permutation of list of length n. Any smaller and some permutations will be unrepresentable. I am very aware of this because shuffling a deck of cards correctly on a computer requires at least 200 random bits.

If the requirements are softer than "n random permutations", there might be a lot of potential solutions. It is very easy to come up with "n permutations" if you have no requirements on the randomness of them. Pick the lowest `k` such that `n < k!`, permute the first k elements leaving the rest in place, and now you have n distinct permutations storeable in `O(log(n)` (still not O(1) but close).

I know this is not really your point, but misusing `O(1)` is a huge pet peeve of mine.


It's O(1) if you don't need access to every permutation (common in various monte carlo applications). 64-128 bits of entropy is good enough for a lot of applications, and that's all you get from any stdlib prng, so that's what I was comparing it to.

Those sorts of applications would tend to not work well with a solution leaving most elements in the same place or with the same relative ordering.


> 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.


There are lots of things that we should collectively be doing as an industry but, largely, aren't.


Falsehoods Programmers Believe About Enumerative Combinatorics

Enumerative Combinatorics Considered Harmful


Enumerative Combinatorics Is All You Need


Lambda: The Ultimate Enumerative Combinator


The unreasonable effectiveness of Enumerative Combinatorics


I don't know, I once messed up a Big Tech interview question that was about enumerative combinatorics.


Yeah, that's the theory, and by any mean we definitely need to pursue that as well. I wish we had the luxury of making it work on its own. But since we do not, we need to pull all the levers we have, not just one.

> Expecting each individual person to be their own EPA and research how every single item they consume is produced idiotic and doomed to failure.

That's a false dichotomy. There are many middle grounds between researching every single item you buy and dropping the problem as a whole. You can focus on items which are most likely to bring negative impact, you can draw information from journalistic reports and material produced from dedicated associations. There are many ways to be sensitive to economic externalities of the things you buy without getting insane and without considering the whole problem moot on general phylosophycal principles.


Sure, I am responsible for my own actions, and buying something is an action I (can) make. Therefore I bear responsibility for the side effects of my buying actions. Not the same kind of direct responsibility of those that directly make bad actions, and I don't think I should become insane over evaluating the impact of every single thing I buy, but there's a middle ground between that and ignoring the side effect of anything you buy.

There's a better viewpoint on that, though: ignore moral responsibility, think in terms of agency. Choosing from whom you buy is one of the few ways you (as an ordinary citizen) have to make the world a little steer towards a better form of itself. My own choice alone won't change much (which is correct, otherwise we'd be in an economic dictatorship), but if many people consistently care about that capitalism will work its magic and make wonders happen.


Giving up something you'd otherwise enjoy or find convenient because it would indirectly bring harm to other people feels a very virtuous action to me. I wish more people (including me) had the ability to do that more.


Would he? There seems to be a tradition of illuminations of the Quran (see e.g. https://www.islamicity.org/77800/illumination-of-the-quran/, first result of an internet search). The style is quite different, since Islam forbids making representations of animated beings, but that didn't prevent the development of a rather exquisite craftmanship.


AFAIU it is essentially mass-produced (pun intended?). The master is carefully handwritten, all the others are copies taken with an industrial (if high quality) process.

EDIT: That's not meant to be dismissive of it. It looks like a very beautifut book, and I'll probably buy one.


Suppose I want to do this with my laptop, and dump my drive to the cloud (say accessible via SSH) to reinstall another operating system overwriting it. It's likely that the new operating system won't touch most of the blocks in my drive, so when restoring after having passed the boundary I don't want to transfer those unchanged blocks. Is there a good tool to do that easily?


If you use a SSD or above, you do not have any control over these "blocks" (called cells in these technologies). You cannot access them at all once they are unliked (i.e. the slack source you had with HDD which you could access does not exist anymore).


Nice thing! I use it to let my kids play with the educational games I used to play when I was their age (mostly Sammy's Science House).


By my experience, it helps a lot to have a handful of patches in Wine already. Doesn't have to be anything especially great, but showing that you can work with the conformance tests (both write them and fix them), create good commits, go through the patch review process, interact constructively with the maintainers can get you a lot of points and make up for a not necessarily perfect interview test.

Do not look for the super-core stuff like user32.dll and ntdll.dll. There is already a lot of folks working there and it's hard to make an improvement if that's your first contribution. But there are a plethora of random forgotten libraries in dlls/ which usually nobody cares about until some application depends on those, and they are quite likely to have a good amount of low hanging fruits. Look for the todos in the tests, for example.

Disclosure: I work for CodeWeavers, but I am not involved in the hiring process.


You mean Full Self Security?


Full SS by 2028 :(


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: