AllenDowney / ThinkBayes2

Text and code for the forthcoming second edition of Think Bayes, by Allen Downey.
http://allendowney.github.io/ThinkBayes2/
MIT License
1.81k stars 1.49k forks source link

Question(s) about exercises in chapter 4 #21

Open francescolosterzo opened 4 years ago

francescolosterzo commented 4 years ago

Hello! I have some problems with the exercises from chapter 4: I found a solution for ex. 4.1 (here it is), but it doesn't match exactly the actual solution, and I can't understand the solution proposed for ex. 4.2.

ex. 4.1 Given this statement:

suppose there is a probability y that an actual heads is reported as tails, or actual tails reported as heads.

I assumed the following:

Did I misinterpret the assignment? Or what?

ex. 4.2 Here I tried to follow the same reasoning to compute the likelihood, but I had to give up since I was not getting it. I looked at the proposed solution and I am not really understanding it.

Given the text in the solution:

Each article has a quality Q, which is the probability of eliciting an upvote from a completely reliable redditor. Each user has a reliability R, which is the probability of giving an upvote to an item with Q=1.

I would write it as follows in terms of probability: Q = P(vote=UP|R=1) R = P(vote=UP|Q=1)

Now of course the likelihood is (as stated in the solution):

The probability that a redditor with reliability R gives an upvote to an item with quality Q

but I can't understand the solution itself, i.e. I can't obtain it when writing it down in terms of probability:

P(vote=UP|R,Q) = ... ?

What am I missing? Can anyone please help?

PS: since I already wrote a lot, adding these few words won't hurt: I love this book, great work Allen!

AllenDowney commented 4 years ago

Hi Francesco,

For ex4.1, you are right. My solution reverses the meaning of y.

For ex4.2, the solution I proposed is a bit of a hack. The more correct solution is to update both distributions simultaneously by making a joint distribution. In the second edition, I am moving this exercise to a later chapter where we can do it right.

Thanks for these corrections!