To work out this question, you need to think of what ratio there is of white cars to yellow cars.
You know that there are 9 times as many white cars as yellow cars.
This means for every white car you have, you have 9 yellow. 1:9.
So for every 10 cars we have (9+1) we have 1 white car and 9 yellow cars.
Next, we take the total number of cars (40) and divide it by the total number of white+yellow cars we have (10)
40 / 10 = 4.
Now, we times 4 by the numbers in the ratio.
1 x 4 = 4.
9 x 4 = 36.
We can double check this by doing 36 / 4 = 9.
We know that Rafael counted 4 white cars.