News for hackers. Stuff that matters.
Re:Ask HN: What are some important math topics every program... by baby on Thursday June 04, 2015 @05:37PM (#9662281)
I like this answer. But I also think that if you want to be a great programmer, knowing some math will help you tackle great problems.

For example reddit upvoting/downvoting system can't sort posts by (number of upvotes)/(number of downvotes) because new posts with just a few upvotes would get sorted on top. It can't sort posts by (number of upvotes) - (number of downvotes) because then only old posts would get in the frontpage.

You can try to hack your way through a better solution (and I believe that's what HN did with a dumb "gravity" system where time makes posts lose points). But the clever solution here is to use Confidence Intervals[1]. You choose a margin of error and you enter the values in the formula and tadaaa! You don't even have to comprehend every part of the concept here, but knowing that it exists already helps you creating better code.

[1]: http://en.wikipedia.org/wiki/Confidence_interval

There are no comments on this comment yet.