Paying back for shared costs among a group












2














After celebrating the new year, me and my pals wanted to split the costs of our mischief. I started wondering about the best way to toss money around, i.e. a way to systematically minimise the amount of transactions. So the problem is that everyone should pay equally, even though one or few have already payed for the bills.



The obvious worst case scenario is that for $p$ people out of $n$ that have payed for something, the other $n-1$ pay for their share, $p$ times. If a single person pays for everything, the solution is easy enough: everyone pays for their share. For 2 out of $n$ people my best guess is this. First we total the money spent. Then one of the two pays the other such that they only pay for their share. The others pay the first guy as previously. This can be generalised. For $p$ out of $n$ that do the spending, let's choose 1 that is the hub of all transactions. Again, let's combine the total costs of everything, and let the chosen hub equalise the loss or win of those that payed something. Finally $n-p$ people simply pay for their share.



Is this the optimal strategy?



In a special case, where for example the non-hub spender spent 16 € and the share is 8 €, one of the people can pay their share to the non-hub, eliminating a transaction with the hub. But any amount that doesn't exactly get the spending of a non-hub equal to the share doesn't help.



I know this is neither the trickiest of questions nor one of utmost importance, but I thought someone might enjoy giving it a go. Happy New Year!










share|cite|improve this question




















  • 1




    See also math.stackexchange.com/q/3046139/177399
    – Mike Earnest
    yesterday
















2














After celebrating the new year, me and my pals wanted to split the costs of our mischief. I started wondering about the best way to toss money around, i.e. a way to systematically minimise the amount of transactions. So the problem is that everyone should pay equally, even though one or few have already payed for the bills.



The obvious worst case scenario is that for $p$ people out of $n$ that have payed for something, the other $n-1$ pay for their share, $p$ times. If a single person pays for everything, the solution is easy enough: everyone pays for their share. For 2 out of $n$ people my best guess is this. First we total the money spent. Then one of the two pays the other such that they only pay for their share. The others pay the first guy as previously. This can be generalised. For $p$ out of $n$ that do the spending, let's choose 1 that is the hub of all transactions. Again, let's combine the total costs of everything, and let the chosen hub equalise the loss or win of those that payed something. Finally $n-p$ people simply pay for their share.



Is this the optimal strategy?



In a special case, where for example the non-hub spender spent 16 € and the share is 8 €, one of the people can pay their share to the non-hub, eliminating a transaction with the hub. But any amount that doesn't exactly get the spending of a non-hub equal to the share doesn't help.



I know this is neither the trickiest of questions nor one of utmost importance, but I thought someone might enjoy giving it a go. Happy New Year!










share|cite|improve this question




















  • 1




    See also math.stackexchange.com/q/3046139/177399
    – Mike Earnest
    yesterday














2












2








2


0





After celebrating the new year, me and my pals wanted to split the costs of our mischief. I started wondering about the best way to toss money around, i.e. a way to systematically minimise the amount of transactions. So the problem is that everyone should pay equally, even though one or few have already payed for the bills.



The obvious worst case scenario is that for $p$ people out of $n$ that have payed for something, the other $n-1$ pay for their share, $p$ times. If a single person pays for everything, the solution is easy enough: everyone pays for their share. For 2 out of $n$ people my best guess is this. First we total the money spent. Then one of the two pays the other such that they only pay for their share. The others pay the first guy as previously. This can be generalised. For $p$ out of $n$ that do the spending, let's choose 1 that is the hub of all transactions. Again, let's combine the total costs of everything, and let the chosen hub equalise the loss or win of those that payed something. Finally $n-p$ people simply pay for their share.



Is this the optimal strategy?



In a special case, where for example the non-hub spender spent 16 € and the share is 8 €, one of the people can pay their share to the non-hub, eliminating a transaction with the hub. But any amount that doesn't exactly get the spending of a non-hub equal to the share doesn't help.



I know this is neither the trickiest of questions nor one of utmost importance, but I thought someone might enjoy giving it a go. Happy New Year!










share|cite|improve this question















After celebrating the new year, me and my pals wanted to split the costs of our mischief. I started wondering about the best way to toss money around, i.e. a way to systematically minimise the amount of transactions. So the problem is that everyone should pay equally, even though one or few have already payed for the bills.



The obvious worst case scenario is that for $p$ people out of $n$ that have payed for something, the other $n-1$ pay for their share, $p$ times. If a single person pays for everything, the solution is easy enough: everyone pays for their share. For 2 out of $n$ people my best guess is this. First we total the money spent. Then one of the two pays the other such that they only pay for their share. The others pay the first guy as previously. This can be generalised. For $p$ out of $n$ that do the spending, let's choose 1 that is the hub of all transactions. Again, let's combine the total costs of everything, and let the chosen hub equalise the loss or win of those that payed something. Finally $n-p$ people simply pay for their share.



Is this the optimal strategy?



In a special case, where for example the non-hub spender spent 16 € and the share is 8 €, one of the people can pay their share to the non-hub, eliminating a transaction with the hub. But any amount that doesn't exactly get the spending of a non-hub equal to the share doesn't help.



I know this is neither the trickiest of questions nor one of utmost importance, but I thought someone might enjoy giving it a go. Happy New Year!







algorithms economics






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited 2 days ago

























asked 2 days ago









Felix

1679




1679








  • 1




    See also math.stackexchange.com/q/3046139/177399
    – Mike Earnest
    yesterday














  • 1




    See also math.stackexchange.com/q/3046139/177399
    – Mike Earnest
    yesterday








1




1




See also math.stackexchange.com/q/3046139/177399
– Mike Earnest
yesterday




See also math.stackexchange.com/q/3046139/177399
– Mike Earnest
yesterday










1 Answer
1






active

oldest

votes


















0














Your question is quite confusingly worded, but I think I know what you are asking.



Each person should end up paying the proper share, and there should be as few transactions as possible - that minimizes "tossing money around".



The problem seems to be that some people have already paid the full bill at some of the establishments you visited, and now you have to even up.



Figure out the amount owed (the total of the bills divided by the number of people).



Clearly you might need one transaction for each of the $n$ people who aren't even. Here's a way to do that. Among the people not even there must be at least one who has paid less than their fair share. Let one of those people hand the balance owed to anyone else. Now that payer is even (all paid up). If you're still not all even, do it again.



This will take at most $n$ transactions, fewer if by chance someone receiving money was evened up along the way. At each stage you can look for such a coincidence and take advantage of it.






share|cite|improve this answer























  • Thanks for the answer! I edited the question slightly to confirm your interpretation of the question, sorry. But to your answer. It takes at most $n$ transactions. I reckon the hub solution I proposed also takes that amount, and now looking at it, no less should be expected beyond the special cases. But this does have the advantage of not piling the transactions onto one hub. Cheers!
    – Felix
    2 days ago













Your Answer





StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3060674%2fpaying-back-for-shared-costs-among-a-group%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Your question is quite confusingly worded, but I think I know what you are asking.



Each person should end up paying the proper share, and there should be as few transactions as possible - that minimizes "tossing money around".



The problem seems to be that some people have already paid the full bill at some of the establishments you visited, and now you have to even up.



Figure out the amount owed (the total of the bills divided by the number of people).



Clearly you might need one transaction for each of the $n$ people who aren't even. Here's a way to do that. Among the people not even there must be at least one who has paid less than their fair share. Let one of those people hand the balance owed to anyone else. Now that payer is even (all paid up). If you're still not all even, do it again.



This will take at most $n$ transactions, fewer if by chance someone receiving money was evened up along the way. At each stage you can look for such a coincidence and take advantage of it.






share|cite|improve this answer























  • Thanks for the answer! I edited the question slightly to confirm your interpretation of the question, sorry. But to your answer. It takes at most $n$ transactions. I reckon the hub solution I proposed also takes that amount, and now looking at it, no less should be expected beyond the special cases. But this does have the advantage of not piling the transactions onto one hub. Cheers!
    – Felix
    2 days ago


















0














Your question is quite confusingly worded, but I think I know what you are asking.



Each person should end up paying the proper share, and there should be as few transactions as possible - that minimizes "tossing money around".



The problem seems to be that some people have already paid the full bill at some of the establishments you visited, and now you have to even up.



Figure out the amount owed (the total of the bills divided by the number of people).



Clearly you might need one transaction for each of the $n$ people who aren't even. Here's a way to do that. Among the people not even there must be at least one who has paid less than their fair share. Let one of those people hand the balance owed to anyone else. Now that payer is even (all paid up). If you're still not all even, do it again.



This will take at most $n$ transactions, fewer if by chance someone receiving money was evened up along the way. At each stage you can look for such a coincidence and take advantage of it.






share|cite|improve this answer























  • Thanks for the answer! I edited the question slightly to confirm your interpretation of the question, sorry. But to your answer. It takes at most $n$ transactions. I reckon the hub solution I proposed also takes that amount, and now looking at it, no less should be expected beyond the special cases. But this does have the advantage of not piling the transactions onto one hub. Cheers!
    – Felix
    2 days ago
















0












0








0






Your question is quite confusingly worded, but I think I know what you are asking.



Each person should end up paying the proper share, and there should be as few transactions as possible - that minimizes "tossing money around".



The problem seems to be that some people have already paid the full bill at some of the establishments you visited, and now you have to even up.



Figure out the amount owed (the total of the bills divided by the number of people).



Clearly you might need one transaction for each of the $n$ people who aren't even. Here's a way to do that. Among the people not even there must be at least one who has paid less than their fair share. Let one of those people hand the balance owed to anyone else. Now that payer is even (all paid up). If you're still not all even, do it again.



This will take at most $n$ transactions, fewer if by chance someone receiving money was evened up along the way. At each stage you can look for such a coincidence and take advantage of it.






share|cite|improve this answer














Your question is quite confusingly worded, but I think I know what you are asking.



Each person should end up paying the proper share, and there should be as few transactions as possible - that minimizes "tossing money around".



The problem seems to be that some people have already paid the full bill at some of the establishments you visited, and now you have to even up.



Figure out the amount owed (the total of the bills divided by the number of people).



Clearly you might need one transaction for each of the $n$ people who aren't even. Here's a way to do that. Among the people not even there must be at least one who has paid less than their fair share. Let one of those people hand the balance owed to anyone else. Now that payer is even (all paid up). If you're still not all even, do it again.



This will take at most $n$ transactions, fewer if by chance someone receiving money was evened up along the way. At each stage you can look for such a coincidence and take advantage of it.







share|cite|improve this answer














share|cite|improve this answer



share|cite|improve this answer








edited 2 days ago

























answered 2 days ago









Ethan Bolker

41.7k547110




41.7k547110












  • Thanks for the answer! I edited the question slightly to confirm your interpretation of the question, sorry. But to your answer. It takes at most $n$ transactions. I reckon the hub solution I proposed also takes that amount, and now looking at it, no less should be expected beyond the special cases. But this does have the advantage of not piling the transactions onto one hub. Cheers!
    – Felix
    2 days ago




















  • Thanks for the answer! I edited the question slightly to confirm your interpretation of the question, sorry. But to your answer. It takes at most $n$ transactions. I reckon the hub solution I proposed also takes that amount, and now looking at it, no less should be expected beyond the special cases. But this does have the advantage of not piling the transactions onto one hub. Cheers!
    – Felix
    2 days ago


















Thanks for the answer! I edited the question slightly to confirm your interpretation of the question, sorry. But to your answer. It takes at most $n$ transactions. I reckon the hub solution I proposed also takes that amount, and now looking at it, no less should be expected beyond the special cases. But this does have the advantage of not piling the transactions onto one hub. Cheers!
– Felix
2 days ago






Thanks for the answer! I edited the question slightly to confirm your interpretation of the question, sorry. But to your answer. It takes at most $n$ transactions. I reckon the hub solution I proposed also takes that amount, and now looking at it, no less should be expected beyond the special cases. But this does have the advantage of not piling the transactions onto one hub. Cheers!
– Felix
2 days ago




















draft saved

draft discarded




















































Thanks for contributing an answer to Mathematics Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3060674%2fpaying-back-for-shared-costs-among-a-group%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

1300-talet

1300-talet

Display a custom attribute below product name in the front-end Magento 1.9.3.8