Forum
»
Need math help (srs) dividing expenses (DFS)
- Results 1 to 10 of 10
-
Page 1 of 1
05-21-2022, 10:21 AM
-
#1
- jreacher
- Registered User
-
- jreacher
- Registered User
- Join Date: Sep 2012
- Posts: 8,704
- Rep Power: 363348
-
-
Need math help (srs) dividing expenses (DFS)
Having a hard time figuring the easiest way to calculate this.
4 people buying party supplies and food separately on their own credit cards. They want to divide everything evenly and "square up" via Venmo.
Person 1 spent $550
Person 2 spent $80
Person 3 spent $120
Person 4 spent $150
What's the easiest way to calculate this so there aren't a bunch of redundant Venmo transactions? Who pays who what amount?
(The numbers above aren't set in stone and might change IRL)
4 people buying party supplies and food separately on their own credit cards. They want to divide everything evenly and "square up" via Venmo.
Person 1 spent $550
Person 2 spent $80
Person 3 spent $120
Person 4 spent $150
What's the easiest way to calculate this so there aren't a bunch of redundant Venmo transactions? Who pays who what amount?
(The numbers above aren't set in stone and might change IRL)
05-21-2022, 10:24 AM
-
#2
550 + 80 + 120 + 150 = 900 / 4 = 225 per person
Person 1 pays (225 - what person X pays) to Person X
edit...
wait : fail lmao
person 2,3,4 pay the difference of what they paid and 225 to person 1
Person 1 pays (225 - what person X pays) to Person X
edit...
wait : fail lmao
person 2,3,4 pay the difference of what they paid and 225 to person 1
RIP Based Kevin Samuels
London Brah
Computer Science / IT Master Race
05-21-2022, 10:26 AM
-
#3
- SipNPiz
- 2 B Tan is 2 B Glorious!
-
- SipNPiz
- 2 B Tan is 2 B Glorious!
- Join Date: Feb 2010
- Location: United States
- Posts: 11,178
- Rep Power: 15442
-
-
225 each, person 1 should be only receiving payments, persons 2, 3 and 4 should be sending payments to person 1:
person 2 sends person 1 $145,
person 3 sends person 1 $105,
person 4 sends person 1 $75,
person 2 sends person 1 $145,
person 3 sends person 1 $105,
person 4 sends person 1 $75,
STEM Wagie Brah
Oil/commodity based trader
05-21-2022, 10:54 AM
-
#4
- jreacher
- Registered User
-
- jreacher
- Registered User
- Join Date: Sep 2012
- Posts: 8,704
- Rep Power: 363348
-
-
Originally Posted By SipNPiz⏩
Thanks. Gonna rep all responses. Appreciate the help.225 each, person 1 should be only receiving payments, persons 2, 3 and 4 should be sending payments to person 1:
person 2 sends person 1 $145,
person 3 sends person 1 $105,
person 4 sends person 1 $75,
person 2 sends person 1 $145,
person 3 sends person 1 $105,
person 4 sends person 1 $75,
This is what I was thinking but wanted to make sure I was looking at it right.
05-21-2022, 10:57 AM
-
#5
- Ayz33
- BB.com Iron Account
-
- Ayz33
- BB.com Iron Account
- Join Date: May 2012
- Location: Missouri, United States
- Posts: 8,361
- Rep Power: 27408
-
-
Try using an app called splitwise. Each person inputs how much they paid and whether it is to be split evenly or not. Makes group outings and trips super easy as it tells you how much you owe/are owed and takes you right to venmo with the amnt owed
Pilot
05-21-2022, 11:14 AM
-
#6
05-21-2022, 12:34 PM
-
#7
- numberguy12
- Registered User
-
- numberguy12
- Registered User
- Join Date: Jan 2017
- Posts: 6,938
- Rep Power: 51915
-
-
Problem as stated in OP is trivially solved, but the generalization is more interesting (OP said the numbers are subject to change).
With 4 people, you are basically going to have a situation where 3 payments are made, or the payment data is symmetric and the problem collapses into 2 payments. An example of this is if the original payments were
Person 1: $100
Person 2: $200
Person 3: $300
Person 4: $400
Mean is $250 and person 1 owes $150, person 2 owes $50, person 3 needs to gain $50, and person 4 needs to gain $150. This is a collapsed scenario in which only 2 payments are required: person 2 gives person 3 $50, and person 1 gives person 4 $150. That's a coincidence..it will usually require 3 payments.
With any number of people, say N people, the bill can be settled by at most N-1 Venmo transactions. Instead of doing it SipNPiz's way, which is fine, consider doing the OP problem as follows:
But there can always be collapses....so if OP is really looking to minimize, he'd have to see for any given data set if there are any collapses. It turns out this is an NP-Hard problem and here are all the gory combinatorics details:
https://math.stackexchange.com/quest...-among-friends
With 4 people, you are basically going to have a situation where 3 payments are made, or the payment data is symmetric and the problem collapses into 2 payments. An example of this is if the original payments were
Person 1: $100
Person 2: $200
Person 3: $300
Person 4: $400
Mean is $250 and person 1 owes $150, person 2 owes $50, person 3 needs to gain $50, and person 4 needs to gain $150. This is a collapsed scenario in which only 2 payments are required: person 2 gives person 3 $50, and person 1 gives person 4 $150. That's a coincidence..it will usually require 3 payments.
With any number of people, say N people, the bill can be settled by at most N-1 Venmo transactions. Instead of doing it SipNPiz's way, which is fine, consider doing the OP problem as follows:
-Person 1 deserves $325, so Person 2 Venmos him $325.
-Person 2 is then in the hole $405 ($80+$325), so Person 3 Venmos him $180 to make it so Person 2 correctly pays $225.
-Person 3 is then in the hole $300 ($120+$180), so Person 4 Venmos him $75 to make it so Person 3 correctly pas $225
-Person 4 then has paid $225 ($150+$75), it has to work out that way because of how the 225 mean is calculated.
So in this case, 3 transactions: 2 gives 1 $325, 3 gives 2 $180, and 4 gives 3 $75.
The above is a procedure that will work to make the bill even foranynumber of people and their payments, it can always be done in N-1 transactions.-Person 2 is then in the hole $405 ($80+$325), so Person 3 Venmos him $180 to make it so Person 2 correctly pays $225.
-Person 3 is then in the hole $300 ($120+$180), so Person 4 Venmos him $75 to make it so Person 3 correctly pas $225
-Person 4 then has paid $225 ($150+$75), it has to work out that way because of how the 225 mean is calculated.
So in this case, 3 transactions: 2 gives 1 $325, 3 gives 2 $180, and 4 gives 3 $75.
But there can always be collapses....so if OP is really looking to minimize, he'd have to see for any given data set if there are any collapses. It turns out this is an NP-Hard problem and here are all the gory combinatorics details:
https://math.stackexchange.com/quest...-among-friends
∫∫ Mathematics crew ∑∑
♫1:2:3:4 Pythagoras crew ♫ ♫ 🧮
Nullius in verba
05-21-2022, 01:34 PM
-
#8
- jreacher
- Registered User
-
- jreacher
- Registered User
- Join Date: Sep 2012
- Posts: 8,704
- Rep Power: 363348
-
-
Originally Posted By numberguy12⏩
Hnggg. Strong username to post. This is why I misc. Will rep off rechargeProblem as stated in OP is trivially solved, but the generalization is more interesting (OP said the numbers are subject to change).
With 4 people, you are basically going to have a situation where 3 payments are made, or the payment data is symmetric and the problem collapses into 2 payments. An example of this is if the original payments were
Person 1: $100
Person 2: $200
Person 3: $300
Person 4: $400
Mean is $250 and person 1 owes $150, person 2 owes $50, person 3 needs to gain $50, and person 4 needs to gain $150. This is a collapsed scenario in which only 2 payments are required: person 2 gives person 3 $50, and person 1 gives person 4 $150. That's a coincidence..it will usually require 3 payments.
With any number of people, say N people, the bill can be settled by at most N-1 Venmo transactions. Instead of doing it SipNPiz's way, which is fine, consider doing the OP problem as follows:
The above is a procedure that will work to make the bill even foranynumber of people and their payments, it can always be done in N-1 transactions.
But there can always be collapses....so if OP is really looking to minimize, he'd have to see for any given data set if there are any collapses. It turns out this is an NP-Hard problem and here are all the gory combinatorics details:
https://math.stackexchange.com/quest...-among-friends
With 4 people, you are basically going to have a situation where 3 payments are made, or the payment data is symmetric and the problem collapses into 2 payments. An example of this is if the original payments were
Person 1: $100
Person 2: $200
Person 3: $300
Person 4: $400
Mean is $250 and person 1 owes $150, person 2 owes $50, person 3 needs to gain $50, and person 4 needs to gain $150. This is a collapsed scenario in which only 2 payments are required: person 2 gives person 3 $50, and person 1 gives person 4 $150. That's a coincidence..it will usually require 3 payments.
With any number of people, say N people, the bill can be settled by at most N-1 Venmo transactions. Instead of doing it SipNPiz's way, which is fine, consider doing the OP problem as follows:
The above is a procedure that will work to make the bill even foranynumber of people and their payments, it can always be done in N-1 transactions.
But there can always be collapses....so if OP is really looking to minimize, he'd have to see for any given data set if there are any collapses. It turns out this is an NP-Hard problem and here are all the gory combinatorics details:
https://math.stackexchange.com/quest...-among-friends
05-21-2022, 01:39 PM
-
#9
Bookmarks
-
- Digg
-
- del.icio.us
-

- StumbleUpon
-
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts