The key here is to understand the question is asking about mean, or average value (sum of all values divided by the number of values).
On the first example, he has $9, as the average of 8 and 10 is 9.
On the second, he has 8.5.
The formula is half of the sum of Mr Padilla and Mr Brock's money, or the average of their money.