Rethink2m4
Aufgabe
This question is taken from McElreath, R. (2020). Statistical rethinking: A Bayesian course with examples in R and Stan (2. Ed.). Taylor and Francis, CRC Press.
2M4. Suppose you have a deck with only three cards. Each card has only two sides, and each side is either black or white. One card has two black sides. The second card has one black and one white side. The third card has two white sides. Now suppose all three cards are placed in a bag and shuffled. Someone reaches into the bag and pulls out a card and places it flat on a table. A black side is shown facing up, but you don’t know the color of the side facing down. Show that the probability that the other side is also black is 2/3. Use the counting method (Section 2 of the chapter) to approach this problem. This means counting up the ways that each card could produce the observed data (a black side faceing up on the table).
Lösung
Let’s firmly remember that our data is a black side is facing up.
We have three cards in the deck, giving us three hypothesises. Let’s label the cards bb (black on both sides), bw (black on one, white on the other), and ww (both sides are white), respectively.
Wanted is the probability that both sides are black (bb), given one side is black (1b): \(Pr(bb|1b)\).
Let’s count the ways how the data - one black side - can come up in each conjecture (hypothesis), bb, bw, ww. Let’s denote “first side black” as 1b” and “second side black” as 2b (and similarly for white).
Hypothesis bb has 2 valid paths:
That is, if the card is black on both sides, there are two ways to get a black side.
Hypothesis bw has 1 valid path:
Given that we have observed a black side already, the other side must be white – assuming the card is bw.
Hypothesis ww has 0 valid path:
The Bayes-Box nicely summarizes these data:
Hyp | Prior | Likelihood | unstand_post | std_post |
---|---|---|---|---|
bb | 1 | 2 | 2 | 0.67 |
bw | 1 | 1 | 1 | 0.33 |
ww | 1 | 0 | 0 | 0.00 |
The important piece is that there are two ways that a all-black card (bb) can show a black side, since ist has two black sides.
Categories:
- probability
- bayes
- bayesbox
- rethink-chap2
- string