Let's denote the original number of potatoes as ( x ).
- Alex gives away (\frac{1}{3}x) potatoes to his friend.
- Potatoes left after giving away = ( x - \frac{1}{3}x = \frac{2}{3}x ).
- Then Alex eats 3 potatoes, so potatoes left = (\frac{2}{3}x - 3).
- Given that after eating 3, he has 20 potatoes left:
[
\frac{2}{3}x - 3 = 20
]
Now solve for ( x ):
[
\frac{2}{3}x = 20 + 3 = 23
]
[
x = \frac{23 \times 3}{2} = \frac{69}{2} = 34.5
]
Since the number of potatoes must be whole, let's check the calculation.
Wait, the result is not a whole number. Let's re-express the equation carefully.
[
\frac{2}{3}x - 3 = 20
]
[
\frac{2}{3}x = 23
]
Multiply both sides by (\frac{3}{2}):
[
x = 23 \times \frac{3}{2} = 34.5
]
This suggests the original number of potatoes is 34.5, which is not possible since the potatoes can't be half.
Is there a misinterpretation? Possibly, Alex gives 1/3 potatoes to his friend, but maybe the friend gets whole potatoes, meaning ( x ) must be divisible by 3.
Let's try ( x = 35 ):
[
\frac{1}{3} \times 35 = 11.66... \rightarrow \text{Not whole}
]
Try ( x = 36 ):
[
\frac{1}{3} \times 36 = 12
]
Potatoes left after giving away: (36 - 12 = 24)
Alex eats 3: (24 - 3 = 21) potatoes left. But the problem says 20 left.
Try ( x = 33 ):
[
\frac{1}{3} \times 33 = 11
]
Left after giving away: (33 - 11 = 22)
After eating 3: (22 - 3 = 19), not 20.
Try ( x = 39 ):
[
\frac{1}{3} \times 39 = 13
]
Left after giving: (39 - 13 = 26)
After eating 3: (26 - 3 = 23), too many.
Try ( x = 30 ):
[
\frac{1}{3} \times 30 = 10
]
Left after giving: (30 - 10 = 20)
After eating 3: (20 - 3 = 17), too few.
Try ( x = 45 ):
[
\frac{1}{3} \times 45 = 15
]
Left after giving: (45 - 15 = 30)
After eating 3: (30 - 3 = 27), too many.
Try ( x = 27 ):
[
\frac{1}{3} \times 27 = 9
]
Left after giving: (27 - 9 = 18)
After eating 3: (18 - 3 = 15), too few.
None matches the 20 exactly.
Another approach is that Alex first eats 3 potatoes, then gives away 1/3 of the remainder.
But the problem says: "If he gives 1/3 of the potatoes to his friend, and then eats 3 potatoes..."
Hence, the first calculation should be correct.
Given fractional result, possibly the problem expects the answer to be 34.5 potatoes, but potatoes are discrete.
Alternatively, maybe Alex gives exactly 1/3 away, i.e., he gives away a whole number of potatoes equal to 1/3, meaning total potatoes divisible by 3.
But, the problem probably assumes fractional potatoes are allowed (or 'bags' of potatoes counted as units), or so.
Therefore, the best answer is:
There were originally 34.5 potatoes in the bag.
But since this is impossible, the problem might have a typo or expects rounding.
If we take ( x = 35 ) potatoes (round off 34.5 to 35):
Then potatoes given away: approx 11.67, not whole.
Alternatively, the problem expects the solution as 34.5.
Final answer:
[
\boxed{34.5}
]
If the number must be whole, then the problem setup might be inconsistent.