### A Simple Example

This example is provided with iOmoney to demonstrate how useful and powerful the software is at solving
the sharing of expenses among a group of people.

Three singles, Helen, Richard and Jack, and a couple, Jane & Tim are sharing expenses for a trip together. The first expense is made by Jane & Tim for the entire group for an amount of 500. This means that everyone owes Jane & Tim the sum of 100 = 500 / 5 (3 singles + 1 couple). This is represented in the followin

g table:

 Owes -> Helen Jane Tim Richard Jack Helen X 100 Jane Tim X Richard 100 X Jack 100 X

The second expense is Jack paying 50 for Richard and himself. The table now also shows Richard owing 25 to Jack:

 Owes -> Helen Jane Tim Richard Jack Helen X 100 Jane Tim X Richard 100 X 25 Jack 100 X

The third and last payment in the example is Helen paying 150 for the three singles (Richard, Jack and herself). The table now shows Jack and Richard owing 50 to Helen:

 Owes -> Helen Jane Tim Richard Jack Helen X 100 Jane Tim X Richard 50 100 X 25 Jack 50 100 X

This simple example shows that 6 payments need to be made to clear all the debts. A simple way to reduce the number of payments is when two people owe each other money. But it is not the case in this example. However, we can see that Jack owes money to Helen and Jane & Tim and that Helen also owes money to Jane & Tim. Therefore we can reduce the number of payments to 5 with the following equivalent table:

 Owes -> Helen Jane Tim Richard Jack Helen X 50 Jane Tim X Richard 50 100 X 25 Jack 0 150 X

iOmoney will apply a similar set of rules to reach the best solution with only 2 payments to clear all the debts as shown in the following table:

 Owes -> Helen Jane Tim Richard Jack Helen X Jane Tim X Richard 175 X Jack 125 X