3 ms·
Actually, I'd say writing perfect code in the mathematical domain is extremely hard - floating point types are a minefield and infinite-precision arithmetic is
by joe_the_user 10y ago
Actually, I'd say writing perfect code in the mathematical domain is extremely hard - floating point types are a minefield and infinite-precision arithmetic is a minefield also if you consider the possibilities for running-times exploding. For example, code for the mean of a list of numbers is a hard problem when looked at in its full generality [1] - and that's using forgiving definition of "perfect" - alway correct and terminating, running at a reasonable speed.
[1] http://hypothesis.works/articles/calculating-the-mean/ http://hypothesis.works/articles/calculating-the-mean/
- skybrian 10y agoGreat link! But also, the mean is itself an imperfect summary of some distributions. Any single-number summary will be misleading in some cases.
- bradleyjg 10y agoAnscombe's quartet is a great illustration of that. https://en.wikipedia.org/wiki/Anscombe%27s_quartet https://en.wikipedia.org/wiki/Anscombe%27s_quartet
- fbonetti 10y agoThat's really cool! Btw, I'd love to drop that line into casual conversation some time. "Anscombe's quartet" has a nice flow to it.
- Retra 10y agoFloating point isn't really the baseline for great mathematical structure, it's just a pervasive hardware standard.