You choose one of two identical looking bags at random. One bag has three black marbles and one white marble. The other has three white marbles and one black marble.
After choosing a bag you draw one marble out at random. You notice it is black. You then put it back and draw another marble out of the same bag at random.
What is the probability that the second marble drawn is black?
5/8
The probability that the second marble drawn is black is an expected value; it's equal to Pr(bag 1 was selected)Pr(a black marble will be drawn from bag 1) plus Pr(bag 2 was selected)Pr(a black marble will be drawn from bag 2).
Let f(x)= Pr(bag x was selected) and g(x)= Pr(a black marble will be drawn from bag x). Then:
g(1)=.75
g(2)=.25
Now, f(x) is also equal to [Pr(bag x would be selected AND a black marble drawn)/ Pr(a black marble would be drawn)]. The top part of this equation is (.5)(g(x)), and the bottom is ∑(.5)(g(x)) for all values of x. Thus:
∑(.5)(g(x)) = (.5)(.75) + (.5)(.25) = .5
(.5)(g(1)) = (.5)(.75) = .375
(.5)(g(2)) = (.5)(.25) = .125
f(1) = (.375)/(.5) = .75
f(2) = (.125)/(.5) = .25
The final probability is given by ∑f(x)g(x) for all values of x, or simply f(1)g(1) + f(2)g(2). Thus:
Pr(second marble is black) = (.75)(.75) + (.25)(.25) = 9/16 + 1/16 = 10/16 = 5/8.
Sorry this was so long, but I didn't want to skip over any steps...
(Whew...)