4 ms·
This problem is a perfect example of better is the enemy of good enough. What's striking here is that the simple FP64 solution is for the most part more than go
by varelse 5y ago
This problem is a perfect example of better is the enemy of good enough. What's striking here is that the simple FP64 solution is for the most part more than good enough for any practical application you would find working in Tech. Anything beyond that is likely unnecessary gold plating.
If I were asked this on a job interview and they didn't accept that answer and started going on about me missing the pure math here that would be a great sign that such a place probably doesn't ship things very often. I would also bring up that no one can solve the traveling sales problem either but that approximately optimal solutions run the world of logistics on a daily basis.
Yet much like you can dedicate an entire supercomputer to calculating the energy of two hydrogen atoms to arbitrary precision, it's a really interesting problem with respect to the pure math. But come on, the guys most likely to bring this question up are relying on 16-bit floating point to train their neural networks.
Exponent.Mantissa.Boom. In practice, I know just about no one anymore who can tell me the format of 32-bit or 64-bit floating point because they're so used to abstracting that away.
- deleted 5y ago[deleted]
- zodiac 5y agoBut the article presents it as an interesting pure math problem, and doesn't claim that the FP64 solution isn't good enough. I should add that the people who write state of the art "practical" TSP solvers spend a lot of time thinking about the "theoretical" complexity of it too. Turns out it's a good way to engineer those "good enough" algorithms, provide bounds etc
- varelse 5y agoSure and there are a lot of simple ways to improve the accuracy of the simple approach before you go for the pure math sledgehammer here. It's all a question of how accurate the answer needs to be. For example, It's pretty easy to come up with an FP64 error bound on the sum. And if the difference between the two sums is greater than that error bound you don't need to do anything more complicated. Where this would get complicated IMO is if you were dealing with 128-bit or higher integers. Edit: I am learning so much about the mindset here and what triggers acute attacks of the heebie jeebies. This place has really changed in the past decade since I joined and not for the better. Yes good, good, more downvotes. Show your love with downvotes. I'm stuck at 2970 karma, only you can help me on the journey to zero. Can we beat -4? Let's find out.
- CJefferson 5y agoLooking at your original reply, you started bringing in "job interviews" and "companies that ship". I imagine that's why people downvoted you -- this post (and replies) are about maths, not worrying about really companies. The original post wasn't about practical software, or shipping products, or getting a "good enough answer". It was about an interesting (to many people) maths problem. If you want ycombinator to just be about companies and shipping products, then indeed it "has changed". But many people (myself included) like a good pure maths puzzle, and are interested in if there is a "true answer".
- varelse 5y agoAnd I admitted it's a cool pure math problem. The challenge in the tech industry is balancing the rigor of a pure but nearly intractable solution with using the theory to pump up an O(n) imperfect solution to acceptable reliability. I find the latter more interesting, YMMV. But if that isn't as interesting as the original problem, maybe stay in academia? AI itself is an example of tailoring activation and pooling functions to deliver imperfect solutions that are "good enough" to ship. It's unfortunate these two viewpoints are seen as contradictory rather than complementary, but that does echo our political balkanization so I guess I shouldn't be surprised.
- ogogmad 5y agoMaking things hard sometimes leads to insights down the line. For instance, the formula for solving cubic equations seems kind of silly from a numerical point of view -- you can just use a general-purpose numerical algorithm to solve cubics. But the research into solving cubics using restricted operations led to the discovery of the complex numbers, group theory, and the theory of fields, etc. So it was worth doing things the hard way and sticking to the letter of the problem. Likewise, the ideas people use to solve the problem in the article may have applications elsewhere. I do sometimes have doubts about whether this is the most efficient way of discovering scientific ideas: Posing puzzles and seeing what tools people throw at them. So I can see the criticisms coming...
- aliceryhl 5y agoNo, it's not a perfect example of better being the enemy of good enough. You're just missing the point. Nobody is using this as an interview question.
- pontifier 5y agoExactly! Write the best, simplest, acceptable working code you can, and then put a comment in there that if someone has an issue with it, they are welcome to improve it... if (.1 + .1 != .2): reason = "we can't have nice things."