A street vendor carries watermelons to sell. Half of the watermelons that had more half watermelon sold them to the first customer. Later he sold half of the watermelons that had more half watermelon left to another customer. At that time he had only one watermelon left.
How many watermelons did he have at the beginning?
Suppose the seller started with X watermelons
To the first client he sold half of those with more half watermelon:
(X / 2 + 1/2) = (X + 1) / 2
To the second client he sold half of the ones left with half a watermelon:
(X - (X + 1) / 2) / 2 + 1/2 = (X - 1) / 4 + 1/2 = (X - 1 + 2) / 4 = (X + 1) / 4
And finally he had a watermelon.
The sum of the three quantities will give us the total watermelons that I had at the beginning:
(X + 1) / 2 + (X + 1) / 4 + 1 = X
2X + 2 + X + 1 + 4 = 4X
where do we get that the number of watermelons I had at the beginning was X = 7
The total watermelons sold to the first customer were:
7 / 2 + 1 / 2 = 4
The total watermelons sold to the second customer was:
(7 - 4) / 2 + 1 / 2 = 2
Finally a watermelon was left over.