Let's assume you want to buy a blueberry muffin at your local bakery.
But, there are a few things that complicate the matter:
- The bakery is open from 6am - 1pm.
- Blueberry muffins are in high demand and they are only made one time per day. They sell out fast.
- You do not know the exact time that the muffins are made. However, you know at which times the bakery made them historically for the last 5 previous days. Let's say, those times are t1 = 6:45am, t2=8:00am, t3=8:45am, t4=7:10am and t5=11:30am.
- You have good reason to assume that there is some consistency in those times. But there might be outliers (such as t5).
- You really like blueberry muffins. But you think you should not walk to the bakery to check if the muffins are available more than 10 times per day.
A quick graphic to illustrate the issue: Illustration
Now my question is: How can I mathematically optimise the time for my 10 visits to the bakery, based on the 5 historic data points? Goal is to optimise my overall chances to go home with some delicious muffins.
Use the historical times to estimate a probability distribution function - then integrate this probability distribution function to interpolate regions with high probabilities corresponding to availability of muffins. Then visit the bakery around those times.