I have been assigned a task to come up with an algorithm for evenly distributing prizes over a given time frame, I am looking for advice as I am a bit stumped on where to start.
Here are my requirements:
- Prize types are types of prizes which can be added by a user, there can be any number of prize types
- A prize type should last for a set period of time i.e 30 days
- A prize type has a limited quantity i.e 10
Scope: When a user signs on to our site, they have the opportunity to win a prize. You need to distribute prizes throughout the course of the time period randomly in a way that ensures the prizes never run out 3 days before the end period ends.
My Thoughts: I understand that I will need to factor in prize quantity over the time remaining from the initial period at the point in time a user registers, and generate a probability from these figures but I am stuck on finding a reliable way to do this that keeps the distribution random
Any suggestion appreciated