3 ms·
Hm, I wonder what other examples of high-ROI math are?
by 0xDEAFBEAD 3y ago
Hm, I wonder what other examples of high-ROI math are?
- dlisboa 3y agoSet theory might seem almost mundane in many cases, but it's really powerful to express certain solutions in a very concise way. I've refactored code into much simpler code by just thinking about it in terms of set manipulation, vastly reducing the number of classes/tables necessary. Operations became self-explanatory (it's "just a set"). It also gives you a good foothold to realize whether the solution works or not into the future, a bit of a barebones formalism. You get to play with it in math terms before writing any code. This particular refactoring became the only thing in the codebase that didn't need to change as new requirements came along.
- hiAndrewQuinn 3y agoGood pick, I'm a big fan of using set() in Python. The fact that they're unordered and do not allow duplicates communicates a lot about the nature of the problem you're working with.
- kqr 3y agoSimple random sampling. You can do anything with meaningful precision -- often at a fraction of the cost. The key insight is you rarely need an exact number, just something in the right ballpark. And sometimes that ballpark is surprisingly big. (More advanced sampling methods are basically just variance-reducing techniques which give you better precision at cost or lower cost for the same precision, but the big leap in ROI is learning to sample in the first place.)