Puzzling Asked on September 29, 2021
There are people A,D,G,P
"A" needs $2.50 from D,G,P
"P" needs $2.50 from A,D,G
As far as who paid "A" what.
"D" paid "A" $5 (So "A" owes D $2.50)
"G" hasn’t paid "A" yet.
I don’t know if "P" paid anything.
As far as who paid "P" what
"D" told "P" he can pay him $2.50
"G" hasn’t paid "P" yet
I don’t know if "A" paid anything.
"A" then works out that "G" should pay "P" $5 and then we are all even.
How does that work?
I am guessing that "A" did some calculations and worked out that him and P don’t have to exchange any money, because they each owe each other the same amount ($2.50).
And "A" has been paid $2.50 more by "D" So "A" has the total amount of money he should have. So then G should pay P for himself and for D.
I sort of understand this, but I wouldn’t have been able to calculate what "A" calculated. Can this be put into a simple mathematical form, where these kinds of things can be easily tracked (who owes who, what to do when one person pays more than they should)? How are these things are worked out?
Assuming by "needs" at the start you mean "is owed", then:
Also:
So:
You could work out
But it's easier to just work out
In this case
Or another way of looking at it
Answered by Mohirl on September 29, 2021
At the beginning:
The only official payment that has happened is D paying 5.00 to A, so the updated transactions are:
Now then:
Answered by user69943 on September 29, 2021
Hey there this is my first time so I don't know how to use the system exactly, pardon me.
Let's make some diagrams.
To represent A needs 2.5 from D, use the text A<---2.5---D
. Then we can represent the needed transactions as:
A<---2.5----D
A<---2.5----G
A<---2.5----P
P<---2.5----A
P<---2.5----D
P<---2.5----G
First observe that there need be no transaction between P and A.
Now we know P needs to net a total of 5$ = 7.5$(taken) - 2.5$(given)
. Also we know G must pay 5$ and receives nothing. So since P only needs 5$ which G needs to pay, we can have G give 5$ to P with no involvement from A or D.
Now the solution is like this:
D gave A 5$ so A---2.5--->D.
Now see G---2.5--->A---2.5--->D---2.5--->P
so this can be written G--2.5-->P equivalently.
This 2.5 is net flow indirect and G has to pay P 2.5 for direct debt
so if G pays 5 to P it is all clear.
Answered by Aakash Mathur on September 29, 2021
Graphs are your friends!
1: Set Up: To make matters simple, let's just assume that at one point, A loaned the other three $2.50 and P did the same. Let a directed edge represent $2.50.
Our starting graph represents the cash flow state after both sets of loans are made. Note that the A-P Edges cancel.
2: D pays a $5.00. Draw two edges (green, to represent two payments of $2.50) Cancel accordingly.
3: Notice that A has one in and one out edge. A is at 0 balance, as is D. G has two in edges, meaning G has $5 he shouldn't, and similarly, P has paid $5 he shouldn't. In other words, G owes the collective $5, and the collective owes P $5. So G should pay P $5.00
4: As an exercise, draw two lines representing G paying P, and cancel appropriately. The entire graph will become a loop.
Answered by Chris Cudmore on September 29, 2021
The initial state of who owes whom what, before any payments are made, looks like this:
Owes
║ A │ D │ G │ P Total
O ═╬═══╪═══╪═══╪═══ ═════
w A║ X │250│250│250 750
e ─╫───┼───┼───┼─── ─────
d D║ 0 │ X │ 0 │ 0 0
─╫───┼───┼───┼─── ─────
T G║ 0 │ 0 │ X │ 0 0
o ─╫───┼───┼───┼─── ─────
P║250│250│250│ X 750
Total║250│500│500│250
This tells us we are looking to get to a final state of this:
After D makes their payment, we are in this state:
As such, the easiest way to get to the correct amounts is for G to pay P $5.00, unless you need a proper accounting trail. In which case:
An alternate way to think about it:
Answered by Chronocidal on September 29, 2021
If you add a "hub" node to your graph, you can reduce the number of possible connections. If you allow 2 arrows to represent "owed" and "owes", it takes the number of possible relationships down from (n-1)n to 2n (so equal at 3 nodes and smaller thereafter).
You invoke the money kitty!
You can consider your scenario as a $10 activity, where A paid for everyone the first time, and P paid for everyone the second. When you think of it like this, the sequence of events is:
The total kitty is $20, and each person should pay $5.
The kitty owes A and P $5 each (as they've both paid $10). D and G each owe the kitty $5 as they have paid nothing.
Next, D pays $5 to the kitty and therefore D is now square.
A takes $5 from the kitty and is therefore all square.
We are left with G owing $5 to the kitty, and P owed $5 by the kitty, so it can be settled with that payments from G to P.
Answered by seumasmac on September 29, 2021
Let's say
A pays £10 for court for four people including himself (So £2.50 each) P pays £10 for a court for four people including himself. (So £2.50 each)
That’s equivalent to A lending £2.50 to three people. And P lending £2.50 to three people.
So that leads to what is mentioned at the beginning of the question
"A" needs $2.50 from D,G,P
"P" needs $2.50 from A,D,G
If you’re not A or P, you owe £5 If you’re A or P, you owe £2.50 (and others owe you 3*£2.50)
Everybody ends up paying £5 . i.e. -£5
A -£10
P -£10
D 0
G 0
D pays £5 to A (which actually makes it easier, it could have been unintentional e.g. D thought "A" was going to book both courts, or it could have been intentional, just paying all that is owed and let the others figure it out, he's done his bit)
D only owes A £5 so it was too much , to A, but actually made it much easier
A -£5
P -£10
D -£5
G 0
Then if G pays P £5
A -£5
P -£5
D -£5
G -£5
Or to put it another way, a in table all in one go. and one can add a middle column showing how much needs to be added or subtracted..
A -10 | +5 | -5 P -10 | +5 | -5 D 0 | -5 | -5 G 0 | -5 | -5
It shows that D pays 5 and G pays 5. It doesn't show who D paid (whether it was A or P), or who G paid (whether A or P), but that's fine, it doesn't matter. It works regardless
So that table does it in one.
The other route seems to be long.. and didn't make it obvious that D or G should pay £5 to one person to make things easier.
D-----2.50-------A G-----2.50-------A P-----2.50-------A A-----2.50------P G-----2.50-----P D-----2.50----P simplify it.. e.g. identify chains or ones that can cancel out. D-----2.50-------A A-----2.50------P P-----2.50-------A G-----2.50-------A G-----2.50-----P D-----2.50----P becomes D-----2.50------A G-----2.50-------A G-----2.50-----P D-----2.50----P suppose D pays £5 to A A----2.50-----D G-----2.50-------A G-----2.50-----P D-----2.50----P simplify A----2.50-----D D-----2.50----P G-----2.50-------A G-----2.50-----P becomes A--2.50---P G-----2.50-------A G-----2.50-----P becomes G-----2.50-------A A--2.50---P G-----2.50-----P becomes G----2.50---P G---2.50--P becomes G---£5---P So G must pay P £5
Answered by barlop on September 29, 2021
Just keep a running total of what each is owed (positive) or owes (negative). It doesn't matter to whom:
There are people A,D,G,P
"A" needs $2.50 from D,G,P
"P" needs $2.50 from A,D,G
As far as who paid "A" what. "D", paid "A" $5 (So "A" owes D $2.50)
"G", hasn't paid "A" yet.
"P", i don't know if he paid anything.
As far as who paid "P" what "D" told "P" he can pay him $2.50
"G" hasn't paid "P" yet
"A" I don't know if he paid anything.
"A" then works out that "G" should pay "P" $5 and then we are all even.
Answered by Briguy37 on September 29, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP