Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am developing a webpage where you can post questions, and other people can rate them. And the front page should have a list that is selected based on an algorithm that takes into account the time the question has been there and the number of votes it has gotten. This way, a high voted post will stay higher up on the list, and newly added questions don't need as many votes as an old question to get high on the list.

Overall rating: time rating + vote rating. The list will be sorted with the post highest rating sum at the top.

In addition, I want the time rating to stop pretty abruptly, so that after x hours, the post will not be able to compete on the list, even if it has 10 times more votes than all the others.

Right now, I am making a graph to show the time rating.

Screenshot from GeoGebra

You can download the GeoGebra file here:

It is the red graph I am going to use. It is inverted, so that when the post is first posted, it will have a time rating of 2.75 ($x=7$), after two hours, it will have a time rating of 0.89 ($x=5$). When the post has been posted for 6 hours ($x=1$), the post will disappear from the list in maximum one hour.

I think the function that makes up this graph is a bit too complicated. I want something like: $y=x^3$. The only problem with this function, is that the flat part of it (where the y doesn't increase much) is too short, and the slope increases too quickly. The end ($0<x<1$) should be more abrupt than the beginning ($5<x<7$), because the post should be forced to disappear after 6 hours, and new posts should have enough time to be voted up before they loose too much of the time rating.

Right now, I can change $10 000$ in $g(x)$ into a higher number if I want the time a post is on the list to be longer. (Actually I wrote $10^y$ where y is a number defined in my script.)

So my question is: What is a better function to use to make this time rating graph? It would be preferable to have the beginning at 0 instead of 7. (I just don't know how to invert it.) It should also be easy to change the life time of a post, and preferably how abrupt the in and out slope should be.

Thank you very much for your help!

share|cite|improve this question
up vote 1 down vote accepted

A good solution to this could be this:

$\log{\text{numberOfVotes}} + \frac{\text{aConstantTime}}{\text{time}}$ It is a simplified version of the Reddit algorithm. Take a look at it.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.