Log In

Your email is not your username

Register

If you were a member of the old Bodybuilding.com forums and would like to reuse your previous username, you can request it below. We use your email only for registration and do not store it. For more information, please see our Privacy Policy.

Confirm your email

A registration code was sent to your email. Enter it here.

Welcome

You have successfully setup your account.

Sign in

Quick Navigation Bottom Misc
Forum
» Need math help (srs) dividing expenses (DFS)
  1. Results 1 to 10 of 10
post 1661664783 05-21-2022, 10:21 AM
-
#1
  1. jreacher
  2. Registered User
  1. jreacher
  2. Registered User
  3. Join Date: Sep 2012
  4. Posts: 8,704
  5. 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)
post 1661664963 05-21-2022, 10:24 AM
-
#2
  1. JeffPesos
  2. Big Data
  1. JeffPesos
  2. Big Data
  3. Join Date: Sep 2021
  4. Posts: 4,905
  5. Rep Power: 42035
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
RIP Based Kevin Samuels

London Brah

Computer Science / IT Master Race
post 1661665033 05-21-2022, 10:26 AM
-
#3
  1. SipNPiz
  2. 2 B Tan is 2 B Glorious!
  1. SipNPiz
  2. 2 B Tan is 2 B Glorious!
  3. Join Date: Feb 2010
  4. Location: United States
  5. Posts: 11,178
  6. 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,
STEM Wagie Brah
Oil/commodity based trader
post 1661666203 05-21-2022, 10:54 AM
-
#4
  1. jreacher
  2. Registered User
  1. jreacher
  2. Registered User
  3. Join Date: Sep 2012
  4. Posts: 8,704
  5. Rep Power: 363348
Originally Posted By SipNPiz
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,
Thanks. Gonna rep all responses. Appreciate the help.

This is what I was thinking but wanted to make sure I was looking at it right.
post 1661666313 05-21-2022, 10:57 AM
-
#5
  1. Ayz33
  2. BB.com Iron Account
  1. Ayz33
  2. BB.com Iron Account
  3. Join Date: May 2012
  4. Location: Missouri, United States
  5. Posts: 8,361
  6. 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
post 1661667063 05-21-2022, 11:14 AM
-
#6
  1. jreacher
  2. Registered User
  1. jreacher
  2. Registered User
  3. Join Date: Sep 2012
  4. Posts: 8,704
  5. Rep Power: 363348
Thanks for the app suggestion.

I ended up usinghttps://billzer.comwhich I think is accurate
post 1661670143 05-21-2022, 12:34 PM
-
#7
  1. numberguy12
  2. Registered User
  1. numberguy12
  2. Registered User
  3. Join Date: Jan 2017
  4. Posts: 6,938
  5. 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:
-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.

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
post 1661672713 05-21-2022, 01:34 PM
-
#8
  1. jreacher
  2. Registered User
  1. jreacher
  2. Registered User
  3. Join Date: Sep 2012
  4. Posts: 8,704
  5. Rep Power: 363348
Originally Posted By numberguy12
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:



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
Hnggg. Strong username to post. This is why I misc. Will rep off recharge
post 1661673033 05-21-2022, 01:39 PM
-
#9
  1. tripod29
  1. tripod29
  2. Join Date: Oct 2017
  3. Posts: 26,123
  4. Rep Power: 452583
LOL @ sending any parents to anyone without itemized receipts. If those aren't being provided, OP say you spent 350,000.


Cheers
post 1661690173 05-21-2022, 08:20 PM
-
#10
  1. jreacher
  2. Registered User
  1. jreacher
  2. Registered User
  3. Join Date: Sep 2012
  4. Posts: 8,704
  5. Rep Power: 363348
I'm on spread with numberguy, but I'll do my best to get back to this thread soon to rep for that epic post above.

Thanks again to everyone.
Quick Navigation Top Misc
Bookmarks
Digg.com
Digg
del.icio.us
del.icio.us
Stumbleupon.com
StumbleUpon
Google.com
Google
Facebook.com
Facebook
Posting Permissions
  1. You may not post new threads
  2. You may not post replies
  3. You may not post attachments
  4. You may not edit your posts