Of course..
Normally, when we talk about probability, we are talking about a future event. For e.g. if today is Monday, we can say that there is a 20% probability that it will rain on Tuesday. This could be conditional on seeing clouds. If the clouds have a 40% probability to show, then (R = Rain, C = Clouds), our equation becomes
(R given C) = 20%
We can further say that if there are no clouds on Monday, there is only a 5% chance of rain on Tuesday.
What Bayes formula does is, it goes into the FUTURE and makes assumptions about the past. So, now, it is already Tuesday and it has rained. Now, we want to know if there were clouds in the sky on Monday. We try to define in a probabilistic manner.
P(Rain and Clouds) = P(Rain given Clouds) * P (Clouds) - Multiplication rule
But P(Rain and Clouds) is also = P(Clouds given Rain) * P(Rain)
Replacing,
P(Clouds given rain) * P(Rain) = P(Rain given clouds) * P(Clouds)
Since we want to find out P(Clouds given rain), we rearrange to move P(Rain to the right) as
P(Clouds given rain) = (P(Rain given clouds) * P(clouds)) / P(rain)
Putting in all the values,
=(0.2 * 0.4) / (0.4 * 0.2 + 0.6 * 0.05) (total probability rule in the denominator)
= 72%
This should make sense. If we know that it rained. Seeing that it is VERY likely that it will rain when there are clouds, there should be a high probability that there were clouds when it rained.