economist puzzle for Mr. White and Mr. Black agreed on the plan 
to average the wealth by pairs of economic 
classes, but they differed on the order. 
Averaging means that the total wealth of the 
two classes is redistributed evenly to 
everyone in the two classes. Mr. White 
suggested that the plan is to average the 
wealth by pairs starting with classes 1 and 2, 
then 2 and 3, then 3 and 4, and finally 4 and 
5.
Mr. Black however, suggested that averaging 
should begin with the two richest classes (i.e. 
4 and 5), then proceed down the scale 
instead of up. 
Which plan of these two would the poorest 
class prefer? Which would the richest class 
prefer?  
What is the best solution for this puzzle? i think that the rich people will like the second program because their wealth will be distributed only within rich people.
 A: Let $w_1 \dots w_5$ be the respective wealths of economic classes 1, 2, 3, 4, 5.
Let $t_1 \dots t_5$ be the new wealths starting from the top, and $b_1 \dots b_5$ the new wealths starting from the bottom.
Assuming that each economic class contains the same number of people, then proceeding top to bottom we have:
$t_5 = \frac{w_4 + w_5}{2}$
$t_4 = \frac{w_3 + t_5}{2}$
$t_3 = \frac{w_2 + t_4}{2}$
$t_2 = \frac{w_1 + t_3}{2}$
$t_1 = \frac{w_1 + t_3}{2}$
On the other hand, proceeding bottom to top we have:
$b_1 = \frac{w_1 + w_2}{2}$
$b_2 = \frac{w_3 + b_1}{2}$
$b_3 = \frac{w_4 + b_2}{2}$
$b_4 = \frac{w_5 + b_3}{2}$
$b_5 = \frac{w_5 + b_3}{2}$
Now from $w_4 > w_2$ and $w_5 > w_2$, we have $w_4 + w_5 > 2w_2 \implies t_5 > w_2$. 
From $w_3 > w_2$ and $t_5 > w_2$, we have $w_3 + t_5 > 2w_2 \implies t_4 > w_2$. 
From that, we have $w_2 + t_4 > 2w_2 \implies t_3 > w_2$.
This tells us that $t_1 = \frac{w_1 + t_3}{2} > \frac{w_1 + w_2}{2} = b_1$, so $t_1 > b_1$, thus the poor would prefer to distribute top to bottom. A similar process determines that $b_3 < w_4 \implies b_5 < t_5$, so the rich would prefer to distribute top to bottom as well.
A: Python 3.4.0 (default, Apr 11 2014, 13:05:11) 
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> def redistribute(li_wealth, i_1, i_2):
...  average = (li_wealth[i_1]+li_wealth[i_2])/2
...  li_wealth[i_1] = li_wealth[i_2] = average
... 
>>> wealth_bottom_up = [0, 1, 2, 3, 4]
>>> redistribute(wealth_bottom_up, 0, 1)
>>> redistribute(wealth_bottom_up, 1, 2)
>>> redistribute(wealth_bottom_up, 2, 3)
>>> redistribute(wealth_bottom_up, 3, 4)
>>> wealth_top_down = [0, 1, 2, 3, 4]
>>> redistribute(wealth_top_down, 3, 4)
>>> redistribute(wealth_top_down, 2, 3)
>>> redistribute(wealth_top_down, 1, 2)
>>> redistribute(wealth_top_down, 0, 1)
>>> wealth_bottom_up
[0.5, 1.25, 2.125, 3.0625, 3.0625]
>>> wealth_top_down
[0.9375, 0.9375, 1.875, 2.75, 3.5]
>>> 

Your intuition is correct, and it applies equally well to the poorest class. Of course everyone in the middle gets the short end of the stick in the second scenario.
A: Going top->down will raise the average of group 2, which means more money for group 1, so they prefer that. The rich will also prefer top->down, because bottom->up would lower the 4's average, so they would have to give more money to them.
