For understanding Bayes’ theorem better one should always know about conditional probability. Conditional probability is the probability of occurrence of an event with condition that some other event has already occurred.

It is denoted by $P (B|A)$ and is read as probability of B given that A has occurred. It may also be written as $P_B (A)$.

For example consider event X of taking a spade card out of a complete deck of cards. Next consider event Y of drawing a black color card from the deck. Then the probability of P (X|Y) will be the probability that a black color card is drawn and it is a spade.

Now when we talk about $P (Y|X)$, which is the probability that a spade is drawn and it is black, will always be 1 as spade is always black.

Bayes’ theorem is a relation that that is relating the current belief with original or prior belief. It can also be relating evidence just as belief. It is basically making it understand the way the probability of occurrence of an event gets affected by some new evidence discovered.

It is denoted by $P (B|A)$ and is read as probability of B given that A has occurred. It may also be written as $P_B (A)$.

For example consider event X of taking a spade card out of a complete deck of cards. Next consider event Y of drawing a black color card from the deck. Then the probability of P (X|Y) will be the probability that a black color card is drawn and it is a spade.

Now when we talk about $P (Y|X)$, which is the probability that a spade is drawn and it is black, will always be 1 as spade is always black.

Bayes’ theorem is a relation that that is relating the current belief with original or prior belief. It can also be relating evidence just as belief. It is basically making it understand the way the probability of occurrence of an event gets affected by some new evidence discovered.

Then according to conditional probability we have,

$P (X \cap Y_i)$ = $P (X) P (Y_i|X)$ (i)

[‘$\cap$’ implies intersection]

Also we will have,

$P (X \cap Y_i)$ = $P (Y_i \cap X)$ = $P (Y_i) P(X|Y_i)$ (ii)

From (i) and (ii) we get,

$P (X) P (Y_i|X)$ = $P (Y_i) P(X|Y_i)$

Finally,

$P (Y_i|X)$ = $\frac{[P (Y_i) P (X|Y_i)]}{P (X)}$

In general the Bayes’s theorem formula states that:

$P (X|Y)$ = $\frac{[P (X) P (Y|X)]}{P (Y)}$

Where: $X$ and $Y$ are two sets

$P (X)$ is the prior probability

$P (X|Y)$ is the conditional probability of $X$ given that $Y$ has occurred.

We can write $Y$ = $X \cap Y$ and $\overline{X} \cap Y$, so we get,

$P (Y)$ = $P (X) P (X|Y) + P (\overline{X}) P (\overline{X}|Y)$

Hence another version of Bayes’ formula can be:

$P (X|Y)$ = $\frac{[P (X) P (Y|X)]}{[P (X) P (X|Y) + P (\overline{X}) P (\overline{X}|Y)]}$

So we get, $P (X) = P (Y)$ = $\frac{1}{2}$.

According to question, the belief is, B: yellow candy from old bag and green candy from new bag.

$P (B|X)$ = (0.2) (0.2) = 0.04

$P (B|Y)$ = (0.1) (0.14) = 0.14

We need to find the probability that the green one came from the new bag that is,

$P (X|B)$ = $\frac{P (X) P (B|X)}{ P (B)}$ = 0.74 (appox.)

Let probability of selecting bucket A and bucket B is P(C) and P(D)

Then P(C) = P(D) = $\frac{1}{2}$

Let R be the event that the marble chosen from the selected bucket is red.

Then P(R|C) = $\frac{5}{9}$ and P(R|D) = $\frac{7}{12}$

By Baye's theorem P(C|R) = $\frac{P(C)P(R|C)}{P(C)P(R|C)+P(D)P(R|D)}$

= $\frac{\frac{1}{2} \times \frac{5}{9}}{\frac{1}{2} \times \frac{5}{9}+\frac{1}{2} \times \frac{7}{12}}$

= $\frac{\frac{5}{18}}{ \frac{5}{18} + \frac{7}{24}}$

= $\frac{\frac{5}{18}}{\frac{41}{72}}$

= $\frac{20}{41}$