For example: Total electricity bill is $19930 for 60 days (~i.e 2 months) for a particular house.
Now there are 7 people who lived in the home for different days.
- Alice: 60 days
- Bob: 60 days
- Catharine: 45 days
- Douglous: 45 days
- Eve: 45 days
- Frank: 15 days
- George: 15 days
How much amount each person have to pay for this total bill.
I tried dividing total bill of 19930/60 = 332.16 332.16 of single day. between 7 people. and
332.16/7 = 47.45 per person for single day.
Now George have to pay 47.45 * 15 (the days for which she lived in the house) = ~711
Same for Frank = ~711
For Catharine, Douglous and Eve the amount will be 47.45 * 45 = 2135.25
and for Alice and Bob it will be 47.45 * 60 = $ 2847
But when I add this amount of all persons 2847*2 + 2135 * 3 + 711*2 != ~19930
Why is this happening?
You could weight each person's contributions according to the length of their stay.
Find the total number $T$ of "people-days". For your example this is $60+60+...$.
Then a person who has lived in the house for $D$ days could be expected to pay $$\frac{Dx}{T}$$ out of a bill of amount $x$.