Just five times, and then you get the red ball the fifth time, but you can't get the red ball the first four times, and you have to get the basketball and the yellow ball.
Then the first four times, I got a basketball once, a yellow ball once and a red ball twice.
Finally, it is 4 *1/3 * 3 *1/3 * 2/3 *1/3 = 8/27.
Because there are three situations, we have to multiply by 3.
The answer is 8/9.