This might not be the right forum for this, so please feel free to point me in the right direction. I actually studied math and CS as an undergrad and as part of that took classes in operations research and this problem reminded me of that, so I thought of posting it here.
I am in charge of doing my household budget but there are some constraints that make this not as straightforward and I am not sure what the right technique is.
We are $N$ housemates, people spend $x_i$ per month, but also spend variable time at the house, say $d_i$ days, where $i \in \{1,\ldots,K\}$, $K$ is the number of housemates. There are a couple of additional complications.
- Kitty: we make a community breakfast that we make for our neighbors every Friday morning, and the neighbors contribute a variable amount to a kitty, which then gets divided in between the housemates proportionally to how long they were at home that month.
- However, since usually most of the groceries are purchased by 1 or 2 housemates, to make it easier for them, the other housemates want their kitty contribution to be used directly as part of the payment they owe. That way, all the kitty cash itself goes to the 1 or 2 housemates that spent the money, and the other housemates just need to pay for the rest.
Obviously, I am in charge of doing the calculations!!
This is an example from last month:
KITTY 130
Days Total
at home Spent Owe
Robert 27 39.83 99.63
Paula 30 516 -361.04
Josh 30 0 154.96
Amanda 22 5.58 108.05
Ana 30 0 154.96
Bob 24 280.52 -156.55
Where the amount owed is easily calculated as $\sum x_i \frac{d_i}{\sum d_i} - x_i$ (i.e. how much they are supposed to pay minus how much money they spent already)
And the kitty would be distributed like this:
Kitty
Robert 21.53
Paula 23.93
Josh 23.93
Amanda 17.55
Ana 23.93
Bob 19.14
Which is just the total kitty distributed proportionally according to how many each housemate was in the house.
I just don't know how to "analytically" deal with the constraints (1) and (2) above. The result I had was (obviously the kitty cash should go to Paula and Bob, but the kitty amount that each housemate is entitled to should be part of their payment):
Robert owes Paula 78.10
Josh owes Paula 131.03
Amanda owes Paul 90.51
Ana owes Bob 131.03
Kitty to Paula 86.93
Kitty to Bob 44.67
Which I calculated semi-manually. I am looking for a more mathematical way of doing this yet I am not sure how to frame this last part mathematically and what method to use for solving it. It seems like an optimization problem of some kind, any suggestions?