An urn "A" contains 2 white marbles. Another urn "B" contains 1 white marble and 1 black marble. One white marble is drawn, not being known which urn it was drawn from. Then, the urns are shuffled and a second marble is drawn.
The problem asks the probability that this second marble is black.
My reasoning:
For the first (white) marble, there are 2 possible scenarios, considering that either urn has the same probability of being chosen, $\frac{1}{2}$
Scenario 1: marble was drawn from urn A
Probability of choosing urn A * Probability of choosing any white marble inside urn A (since there are only white marbles in urn A, it's 1)
So, probability of scenario 1 is $\frac{1}{2} * 1 = \frac{1}{2}$
Urn A will now contain only 1 white marble and urn B will stay as it was (1 white marble and 1 black marble)
Scenario 2: marble was drawn from urn B
Probability of choosing urn B * Probability of choosing any white marble inside urn B (since there are 1 white and 1 black marble in urn B, it's $\frac{1}{2}$)
So, probability of scenario 2 is $\frac{1}{2} * \frac{1}{2} = \frac{1}{4}$
Urn A will stay as it was (2 white marbles) and urn B will now contain only 1 black marble.
Then, as the problem says, "the urns are shuffled". I consider it means the urns themselves (not their marbles) are shuffled so that we don't know which urn the second marble will be drawn from.
Now, for the second marble being black, the probability for each previous scenario is:
Probability of choosing urn A * Probability of choosing any black marble inside urn A + Probability of choosing urn B * Probability of choosing any black marble inside urn B
Let's again refer to the previous two scenarios after the first draw.
Scenario 1:
Second marble black: $\frac{1}{2} * 0 + \frac{1}{2} * \frac{1}{2} = \frac{1}{4}$
Multiplying by the previous calculated probability of scenario 1: $\frac{1}{4} * \frac{1}{2} = \frac{1}{8}$
Scenario 2:
Second marble black: $\frac{1}{2} * 0 + \frac{1}{2} * 1 = \frac{1}{2}$
Multiplying by the previous calculated probability of scenario 2: $\frac{1}{2} * \frac{1}{4} = \frac{1}{8}$
The total probability of the second marble being black is thus $\frac{1}{8} + \frac{1}{8} = \frac{1}{4}$
But the answer is supposed to be $\frac{3}{8}$ and I don't know what I'm getting wrong.
EDIT: I translated the original problem almost verbatim from Portuguese. See original in Google Translate
The probability $\frac14$ that you compute is the probability for the first ball to be white and the second ball to be black.
The probability $\frac13$ that the two existing answers compute is the probability for the second ball to be black, given that the first ball was white.
Both of these probabilities can be deduced with less effort.
Imagine all four balls being drawn from the two urns one after the other, with the urns being shuffled between draws. Not all $4!$ permutations of the four balls are equally likely, because a ball has a different relationship to its urnmate than to the other two balls. But this distinction among pairs of balls isn’t a distinction among the balls. While some pairs are distinct from other pairs, all individual balls are on an equal footing. (In group-theoretic terms, the action of the $8$-element subgroup of ball permutations that preserve urnmateship is transitive but not $2$-transitive.)
Thus, the black ball is equally likely to be drawn in any of the $4$ draws. It follows immediately that the probability for it to be drawn on the second draw is $\frac14$, and that, given it was not drawn on the first draw, the probability that it will be drawn on the second draw is $\frac13$.
All of this assumes that the first draw was also made from a uniformly random urn. The problem as currently stated doesn’t state that explicitly. (It seems you didn’t quote it verbatim; if so, I suggest you do that so we can see whether the ambiguities are due to your reformulation or stem from the source.)
As currently stated, the problem doesn’t specify how the first draw was conducted and how we came to know that it yielded a white ball. Usually, a uniformly random urn selection would be the most natural assumption, but since the source arrived at a different answer, let’s consider what other assumptions might lead to that answer.
Since we don’t know how the first draw of a white ball came about, all sorts of scenarios are possible. We could be in a game show, and the host, knowing which urn is which, might have drawn a white ball from one particular urn so as to skew the chances against us.
Being completely ignorant about the circumstances of the first draw, we might consider assigning a maximally uninformative prior to the provenance of the first white ball, i.e. a probability of $\frac12$ of it coming from either urn. In that case, with probability $\frac12$ the black ball is now alone and we have probability $\frac12$ to draw it, and with probability $\frac12$ it still has its companion and we have probability $\frac14$ to draw it, for a total of $\frac12\cdot\frac12+\frac12\cdot\frac14=\frac38$, in agreement with the answer in the source.