Onlyme,
It's a logical fallacy brain twister... developing a specific train of thought, then depending on the natural unwillingness of people to abandon/re-evaluate the initially developed model when back-engineering the problem.
Each guy pays $10... that's $30 between them.
The gym owner returns $5... now each guy has payed 25/3 dollars (that's $8.33 for a total of $25 between them).
Each guy now contributes 2/3 ($0.66) of a dollar towards the guys tip.
Now add it up properly:
Each guy payed $8.33 to work out... that's a total of $25
Each guy contributed $0.66 towards the desk clerks tip.... that's $2 between them for a total of $27.
So, as a group the guys have payed $25 towards working out, $2 towards the tip... making a total of $27 between them. The $27 payed out, plus the net $3 the gym refunded them (refund minus the tip) equals the $30 originally payed out.
Paying out $27 ($25 plus $2 tip) is the same as paying out $30 and getting $3 back (a dollar each refund).
The total payed out ($30) is equal to:
The total amount each payed (cost plus tip) combined with the refund...
NOT
The total amount each payed plus the tip... that way you're just adding the total payed ($25 plus $2) and the tip. Adding the tip twice to $25 will always give you $29 no matter which way you add it up.
The wording of the brain teaser and the use of an intermediary to confuse the transaction encourages people to think in terms of adding the net cost (cost plus tip) to the tip... getting $29. You should add the net cost (cost plus tip) to the refund ($3)... thereby arriving at the amount originally handed over ($30).
Hope this helps,
The Luke