4 ms·
I'm constantly amazed at the lengths some coders will go to in order to avoid doing a couple of lines of algebra. Have seen people code up complicated Monte Car
by smallnamespace 9y ago
I'm constantly amazed at the lengths some coders will go to in order to avoid doing a couple of lines of algebra. Have seen people code up complicated Monte Carlo simulations, with all the attendant estimation noise, when basic stats and algebra gives the exact answer, sometimes even as a one-liner.
Serious question: Is it simply a strong math phobia, or have people neglected the skill for so long that they've actually forgotten middle school level maths?
- mherrmann 9y agoI think it's that they don't have enough confidence in their mathematical ability to get to the correct answer. Programming lets you experiment and play around with the numbers more easily so you can convince yourself whether what you're doing is correct.
- pdkl95 9y agoI know I've had a few situations where the "play around with the numbers" part happened first. Usually once the actual goal was known the algebra (or similar details) would be obvious... but sometimes the inefficient/toy implementation was good enough. Sometimes half-assed is ok, if it's the the right half of the ass.[1] The wrong half becomes yet another type of technical debt to be refactored "someday". (this is not an excuse to ignore algebra or blindly assume the easiest/most-fun method is correct/useful/sane) [1] https://twitter.com/jimweirich/status/29662011323326464 https://twitter.com/jimweirich/status/29662011323326464 via https://www.youtube.com/watch?v=sCZJblyT_XM https://www.youtube.com/watch?v=sCZJblyT_XM
- dguest 9y agoI think it has as much to do with how math is taught as anything: it's easy to learn how to solve an equation, but convincing yourself that you didn't screw up without looking at the back of the textbook is another thing entirely. Of course there are a lot of softer tricks (like checking limiting cases) which would boost people's confidence, but for some reason this is only really taught in college level physics.
- fovc 9y agoI've seen both banking and consulting analysts try to solve this exact problem in excel. The ambitious ones will use circular references and let excel find the fixed point. In (good) excel, most formulas you write have a clear input => output relationship. Solving a system of equations (no matter how simple) breaks this relationship down. I suspect a similar thing happens when programming.
- Grustaf 9y agoSolving equations with circular references is a beautiful hack!
- preben 9y agoIt's not negligence. The hardest part about the above calculation is, as usual is, the first step. This is true in general in mathematics; the calculations of a proof are similiar to that of another proof, but the tricks are what makes them difficult to figure out the first time. Setting leavers = joiners is a trick. The rest is just arithmetics.
- Grustaf 9y agoI think it's just lack of basic algebra skills. If you have never been taught to think about math in an abstract way, you will naturally approach problems this way instead. In Ancient Egypt for example when they needed to explain things like the Pythagorean theorem they would give examples, because there was no concept of abstract variables yet. I think this is similar. In the same way, many people are comfortable working with vectors, transforming them with matrices etc but they have never been taught to think of transforms in an abstract way. So if they want to check if a certain matrix actually performs the transformation they want, they apply it to a bunch of random vectors to see if it's reasonable instead of just checking what it does to the base vectors, because they have no real concept of linear transforms, and only vague ideas about dimensionality and degrees of freedom. To some extent it IS phobia, because if you just want to rotate a vector 90 degrees you don't really need concepts of orthonormal transformations so you might be reluctant to look at it that way, but if on the other hand abstract algebra is very natural then the abstraction is trivial to do, it just makes things easier.
- sdiq 9y agoAny linear algebra book you would recommend for self study?
- TeMPOraL 9y agoI'd like to shift this question a bit - there are plenty of resources for "linear algebra for coders" (since they're in high-demand in gamedev circles). But what about recommended books for the abstract, general algebra? You know, all those rings and stuffs.
- padthai 9y agoAbstract algebra is an old field so plenty of good options.I would recommend Abstract Algebra by Dummit and Foote. Clear theory, great examples and good writing: http://eu.wiley.com/WileyCDA/WileyTitle/productCd-0471433349.html http://eu.wiley.com/WileyCDA/WileyTitle/productCd-0471433349...
- 9y ago
- falsedan 9y ago> I found that with a monthly cancel rate of 50% you need 500 new members each month to sustain 1000 subscribers aka I found out that 500 is half of 1000. I think it is tunnel-vision & familiarity: algebra requires different techniques than coding (API docs? REPL?)
- ssharp 9y agoI've done this exact thing before -- writing a Monte Carlo simulation where stats and algebra would have given me the same answer. I think it was less phobia and more that I'm completely out of practice with math and stats by hand, but spend enough time in code to be comfortable with it. I knew my code would give me the right answer and I lacked the confidence in math, where even if I did do it by hand, I would have written the code to check it. The less time-risk way won.
- corobo 9y ago> Serious question: Is it simply a strong math phobia, or have people neglected the skill for so long that they've actually forgotten middle school level maths? One bit of anecdata - I started using computers because I was terrible with maths and they did the numbers thing for me.