A bit of background - I had a phonecall appointment with the drs and it wasn't until a few hours after the appointment time that I received the call. I decided to try and model how much extra time I would expect to be waiting depending on how long on average "over run" the appointments were.
Drs opens at 8:30am, my appointment was at 4pm, each appointment slot takes 15mins and they have a 1 hour break at 12pm-1pm.
So I figured there is 3 and 1/2 hrs (210 minutes) between 8:30 and 12, and 3 hours from 1 to 4 (180mins).
So thats 210+180 = 390 work minutes or 390/15 = 26 people they could see in that time.
I know that even though they expect things to fit into a 15 minute slot it runs over, be it by the nurse writing down notes, or a particularly talkitive patiant. So lets assume that on average an appointment actually takes 20 minutes.
26*20 = 520 minutes to see all those patiants.
390 minutes of those are expected, but 520-390 = 130 minutes are over run.
So you would think I have to wait an extra 130 minutes until I finally get seen to. BUT that underestimates the problem. The reason being is during those 130 minutes of over run time other patients were waiting to get seen to, realistically
130 minutes/15 = 8.6666 patients (we are eating into 2/3 of another persons time, so lets count that person as being expect to be seen as well (and round up))
9 patients. Those 9 patients take 20 minutes instead of the 130 expected so they over run by 9*20-130 = 50 minutes.
or 50/15 = 3.333 patients (and round up)
4*20-50 = 30minutes
(30/15)*20 - 30 = 10minutes 10/15 = eating into 2/3s of a patients time, so lets see them
1*20 - 15 = 5m
all together thats 130 + 50 + 30 + 10 + 5 = 225 minutes.
Thats how long it should actually take me to be seen. Now if we covert the above into algebra, let $l_e$ = length expected = 15, $l_a$ = length actual = 20, m = total number of work minutes = 390 minutes
First iteration: $l_a \cdot \frac{m}{l_e} - m$ = $m \cdot (\frac{l_a}{l_e} - 1)$
Second iteration: $m \cdot (\frac{l_a}{l_e} - 1)(\frac{l_a}{l_e} - 1)$ = $m \cdot (\frac{l_a}{l_e} - 1)^{2}$
Third iteration: $m \cdot (\frac{l_a}{l_e} - 1)^{3}$
nth interation: $m \cdot (\frac{l_a}{l_e} - 1)^{n}$
We want to add all of these up to get the total over run time t
$t = m \cdot ((\frac{l_a}{l_e} - 1) + (\frac{l_a}{l_e} - 1)^{2} + ... + (\frac{l_a}{l_e} - 1)^{n})$
$s = (\frac{l_a}{l_e} - 1) + (\frac{l_a}{l_e} - 1)^{2} + ... + (\frac{l_a}{l_e} - 1)^{n}$
$(\frac{l_a}{l_e} - 1)s = (\frac{l_a}{l_e} - 1)^{2} + ... + (\frac{l_a}{l_e} - 1)^{n + 1}$
$s - (\frac{l_a}{l_e} - 1)s = (\frac{l_a}{l_e} - 1) - (\frac{l_a}{l_e} - 1)^{n + 1}$
$s = \frac{(\frac{l_a}{l_e} - 1) - (\frac{l_a}{l_e} - 1)^{n + 1}}{(1 - (\frac{l_a}{l_e} - 1))}$
If we take the limit as n tends towards infinity the contribution of $(\frac{l_a}{l_e} - 1)^{n + 1}$ will tend towards 0 assuming that $\frac{l_a}{l_e} - 1 < 1$
$s = \frac{(\frac{l_a}{l_e} - 1)}{(1 - (\frac{l_a}{l_e} - 1))}$
1 is the same as $\frac{l_e}{l_e}$
$s = \frac{(\frac{l_a}{l_e} - \frac{l_e}{l_e})}{(\frac{l_e}{l_e} - (\frac{l_a}{l_e} - \frac{l_e}{l_e}))} = \frac{\frac{l_a - l_e}{l_e}}{\frac{l_e - l_a + l_e}{l_e}} = \frac{l_a - l_e}{l_e - l_a + l_e} = \frac{l_a - l_e}{2l_e - l_a}$
Subbing this back in
$t = m \cdot (\frac{l_a - l_e}{2l_e - l_a})$
But if I plug in the numbers m = 390, $l_a$ = 20 and $l_e$ = 15 I get
$t = 390 \cdot (\frac{20 - 15}{2 \cdot 15 - 20})$
t = 195 minutes
So using the equation I get 195 minutes, but thinking through it logically I get 225 minutes. I know the extra 30 minutes came from counting the fraction as a whole, and taking them in. But it got me thinking is there a way to account for discrepancies in equations when using a continuous function verses descrete values? In this instance 30 minutes isn't that bad, but it would be nice if there is a way to deal with this (without having to compute by hand a concrete example). Thanks for your time
edit: for anyone who read my first comment to this question under this question and wondered what the right answer would be assuming we took myself out of the set of 9... here it is (accounting for the fact I am one of the 9 to be seen to)
First without algebra
20*(390/15) - 390 = 130m for the first batch
(130/15 - 1) = 7.666 people (not including myself, we will round up to 8
20*8 - 130 = 30m
30/15 = 2 people exactly
2*20 - 30 = 10m
total = 130m+30m+10m = 170m
And the equation...
1st iteration: $l_a \cdot \frac{m}{l_e} - m$ = $m \cdot (\frac{l_a}{l_e} - 1)$
2nd iteration: $-m \cdot (\frac{l_a}{l_e} - 1) \cdot (\frac{-l_a}{l_e} + 1) - l_a$
3rd iteration: $-m \cdot (\frac{l_a}{l_e} - 1)^{2} \cdot (\frac{-l_a}{l_e} + 1) - (l_a \cdot (\frac{l_a}{l_e} - 1))$
...
nth iteration: $-m \cdot (\frac{l_a}{l_e} - 1)^{n-1} \cdot (\frac{-l_a}{l_e} + 1) - (l_a \cdot (\frac{l_a}{l_e} - 1)^{n-2})$
$t = m \cdot (\frac{l_a}{l_e} - 1) + (-m \cdot (\frac{l_a}{l_e} - 1) \cdot (\frac{-l_a}{l_e} + 1) - l_a) + (-m \cdot (\frac{l_a}{l_e} - 1)^{2} \cdot (\frac{-l_a}{l_e} + 1) - (l_a \cdot (\frac{l_a}{l_e} - 1))) + ... + (-m \cdot (\frac{l_a}{l_e} - 1)^{n-1} \cdot (\frac{-l_a}{l_e} + 1) - (l_a \cdot (\frac{l_a}{l_e} - 1)^{n-2}))$
$s = (-m \cdot (\frac{l_a}{l_e} - 1) \cdot (\frac{-l_a}{l_e} + 1) - l_a) + (-m \cdot (\frac{l_a}{l_e} - 1)^{2} \cdot (\frac{-l_a}{l_e} + 1) - (l_a \cdot (\frac{l_a}{l_e} - 1))) + ... + (-m \cdot (\frac{l_a}{l_e} - 1)^{n-1} \cdot (\frac{-l_a}{l_e} + 1) - (l_a \cdot (\frac{l_a}{l_e} - 1)^{n-2}))$
$(\frac{l_a}{l_e} - 1)s = (-m \cdot (\frac{l_a}{l_e} - 1)^{2} \cdot (\frac{-l_a}{l_e} + 1) - (l_a \cdot (\frac{l_a}{l_e} - 1))) + ... + (-m \cdot (\frac{l_a}{l_e} - 1)^{n} \cdot (\frac{-l_a}{l_e} + 1) - (l_a \cdot (\frac{l_a}{l_e} - 1)^{n-1}))$
$s - (\frac{l_a}{l_e} - 1)s = (-m \cdot (\frac{l_a}{l_e} - 1) \cdot (\frac{-l_a}{l_e} + 1) - l_a) - (-m \cdot (\frac{l_a}{l_e} - 1)^{n} \cdot (\frac{-l_a}{l_e} + 1) - (l_a \cdot (\frac{l_a}{l_e} - 1)^{n-1}))$
as n tends to infinity $(\frac{l_a}{l_e} - 1)^{n}$ and $ (\frac{l_a}{l_e} - 1)^{n-1}$ will tend towards 0
$s \cdot(1 - (\frac{l_a}{l_e} - 1)) = (-m \cdot (\frac{l_a}{l_e} - 1) \cdot (\frac{-l_a}{l_e} + 1) - l_a))$
$s = \frac{(-m \cdot (\frac{l_a}{l_e} - 1) \cdot (\frac{-l_a}{l_e} + 1) - l_a))}{(1 - (\frac{l_a}{l_e} - 1))}$
Using the fact that $1 = \frac{l_e^{2}}{l_e^{2}} = \frac{l_e}{l_e}$ and ensuring common denominators we can simplify to
$ s = \frac{-m \cdot (l_a - l_e) \cdot (l_e - l_a) - l_a \cdot l_e^{2}}{2 \cdot l_e^{2}-l_a\cdot l_e}$
Subbing this s back into the orginal equation we end up with
$t = m \cdot (\frac{l_a}{l_e} - 1) + \frac{(-m \cdot (l_a - l_e) \cdot (l_e - l_a)) - (l_a \cdot l_e^{2})}{2 \cdot l_e^{2}-l_a\cdot l_e}$
More simplification leaves us with
$t = \frac{m \cdot (l_a-l_e) - l_a \cdot l_e}{2l_e - l_a}$
$t = \frac{390 \cdot (20-15) - 15 \cdot 20}{2 \cdot 15 - 20} = 165m$
So we are still off by 5 minutes using the equation this time.
edit 2:
I think I might have confused things by jumping off with an example that is pretty... well niche. So I'll give another example of the problem I'm trying to solve.
You have a 2D warehouse, it is 7m by 7m. You have 2D boxes 3m by 3m. How Many boxes can you fit in the warehouse?
Using an equation total area of warehouse/ total area of boxes = 7*7/3*3 = 5.4444 boxes.
Being dull and using excell: let # be a space A or B be a box
# # # # # # #
# A A A B B B
# A A A B B B
# A A A B B B
# B B B A A A
# B B B A A A
# B B B A A A
We can see we can only fit 4 in. There is a discrepency here too. Is there a practical, pragmatic way of ensuring that we get the correct answer using a derived equation when dealing with discrete values.