Changed probability of a book in the library

dr.trovacek

New member
Joined
Apr 3, 2017
Messages
23
Probability that some book is in a library is \(\displaystyle \frac{1}{3}\).
If the book is in the library, then it is equally probable that the book is on one of total 100 bookshelves. We checked 40 bookshelves and the book is not on any of them. What is the new probability that the book is in the library?

Solution: \(\displaystyle \frac{3}{13}\)

I think I have to use Bayes' Theorem, but I can't seem to calculate the probability of a specific book being in the library if 40 bookshelves are checked and this book is not on any of them.

So I'm starting like this:
\(\displaystyle H = \mbox{{the book is in the library}} \\
A= \mbox{{the book is not on any of the 40 checked bookshelves}}
\)

I think we are looking for: \(\displaystyle P(H|A) = P(\mbox{{book is in the library, if the book is not on any of the 40 checked bookshelves}})\)

So I need the values from the right side of the equation: \(\displaystyle P(H|A) = \frac{P(H) \cdot P(A|H)}{P(A)}\)

I have \(\displaystyle P(H)=\frac{1}{3}\), but is hard for me to make a distinction between \(\displaystyle P(A)\) and \(\displaystyle P(A|H)\), not in the terms of understanding the statement of the events, but rather the way to calculate them in this particular situation.


I tired to look at the event A as \(\displaystyle A= \mbox{{a book is on one of the 60 uncheked bookshelves}}\). I think it might be a problem that I kinda of started event A with a presumption that the book is already in the library.

Anyhow, I can't get the correct answer, this problem seems tricky to me.

Am I at least on the correct path?

Thanks in advance for any help
 
Last edited:
I would choose these events (though yours could probably work):

L = book is in the library
S = book is on one of the shelves that were checked

You know P(L); you also know P(S|L), and (think about it!) P(S|L').

Now see what you can do.

Incidentally, I like to make a table like this for this sort of problem:

S S'
total
L1/3
L'
total1
 
Last edited:
Probability that some book is in a library is \(\displaystyle \frac{1}{3}\).
If the book is in the library, then it is equally probable that the book is on one of total 100 bookshelves. We checked 40 bookshelves and the book is not on any of them. What is the new probability that the book is in the library?
Solution: \(\displaystyle \frac{3}{13}\)

\(\displaystyle H = \mbox{{the book is in the library}} \\A= \mbox{{the book is not on any of the 40 checked bookshelves}}\)
So I need the values from the right side of the equation: \(\displaystyle P(H|A) = \frac{P(H) \cdot P(A|H)}{P(A)}\)

\(\displaystyle \begin{array}{l} P(H|A) = \dfrac{{P(H) \cdot P(A|H)}}{{P(A)}}= \dfrac{{P(H) \cdot P(A|H)}}{{P(A \cap H) + P(A \cap \neg H)}}= \dfrac{{P(H) \cdot P(A|H)}}{{P(A|H)P(H) + P(A|\neg H)P(\neg H)}} \end{array}\)

Note that \(\displaystyle P(A|\neg H)P(\neg H)=(1)\left(\dfrac{2}{3}\right)\)

BTW. \(\displaystyle \frac{3}{13}\) is correct.



 
My solution

Thank you very much! It seems like a had a problem with the denominator in Bayes formula, the P(A).

I put the event A as books are NOT on the bookshelves just because it seemed easier to me because that's how it is specified in the text.


\(\displaystyle
H = \mbox{{the book is in the library}} \\
A= \mbox{{the book is not on any of the 40 checked bookshelves}} \)

\(\displaystyle P(A) \) = {book is not on one of the shelves that were checked AND book is in the library) OR ( book is not on one of the shelves that were checked AND book is not in the library) = \(\displaystyle P(AH) + P(A \overline{H}) \)

This seem little counterintuitive to me so maybe that's the reason I didn't see it at first.

\(\displaystyle
P(H|A) = \frac {P(H) \cdot P(A|H)}{P(A)}=\frac{P(H) \cdot P(A|H)}{P(A|H) \cdot P(H) + P(A| \overline{H}) \cdot P(\overline{H}))} =
\frac{\frac{1}{3} \cdot \frac{60}{100}}{\frac{60}{100} \cdot \frac{1}{3} + 1 \cdot \frac{2}{3}} = \frac{\frac{1}{5}}{\frac{13}{15}} = \frac{3}{13}
\)
 
Last edited:
This seem little counterintuitive to me so maybe that's the reason I didn't see it at first.
\(\displaystyle P(H|A) = \frac {P(H) \cdot P(A|H)}{P(A)}=\frac{P(H) \cdot P(A|H)}{P(A|H) \cdot P(H) + P(A| \overline{H}) \cdot P(\overline{H}))} = \frac{\frac{1}{3} \cdot \frac{60}{100}}{\frac{60}{100} \cdot \frac{1}{3} + 1 \cdot \frac{2}{3}} = \frac{\frac{1}{5}}{\frac{13}{15}} = \frac{3}{13}\)
Indeed! Working with conditional probability involving negations can be tricky.
But glad you got this.
 
Thank you very much! It seems like a had a problem with the denominator in Bayes formula, the P(A).

I put the event A as books are NOT on the bookshelves just because it seemed easier to me because that's how it is specified in the text.

\(\displaystyle
H = \mbox{{the book is in the library}} \\
A= \mbox{{the book is not on any of the 40 checked bookshelves}} \)

\(\displaystyle P(A) \) = {book is on one of the shelves that were checked AND book is in the library) OR ( book is on one of the shelves that were checked AND book is not in the library) = \(\displaystyle P(AH) + P(A \overline{H}) \)

This seem little counterintuitive to me so maybe that's the reason I didn't see it at first.

I think you meant,

\(\displaystyle P(A) \) = {book is NOT on one of the shelves that were checked AND book is in the library) OR ( book is NOT on one of the shelves that were checked AND book is not in the library) = \(\displaystyle P(AH) + P(A \overline{H}) \)

Part of the reason I prefer to name events positively (leaving "not" to be shown symbolically) is precisely that it saves you from getting your mind twisted around in "nots"! It isn't necessary, but I like to protect my mind.
 
Don't just memorize formulas! Think!

Imagine 3000 books. "The probability a book is in the library is 1/3". So (1/3)(3000)= 1000 books are in the library.

"If the book is in the library, then it is equally probable that the book is on one of total 100 bookshelves." So there are 1000/100= 10 books on each book shelf.

"We checked 40 bookshelves and the book is not on any of them". There are 60 bookshelves, so 600 books unchecked. The probability the book is one of those is 600/(600+2000)= 600/(2600)= 3/13
 
I think you meant,

\(\displaystyle P(A) \) = {book is NOT on one of the shelves that were checked AND book is in the library) OR ( book is NOT on one of the shelves that were checked AND book is not in the library) = \(\displaystyle P(AH) + P(A \overline{H}) \)

Part of the reason I prefer to name events positively (leaving "not" to be shown symbolically) is precisely that it saves you from getting your mind twisted around in "nots"! It isn't necessary, but I like to protect my mind.


Yeah, I did ment that, I corrected it now. I must have wrote it wrong because I started to solve it with the positive statement and then decided to solve it like I started in the first place. But I do get your point. Thank you for the good advice!
 
Don't just memorize formulas! Think!

Imagine 3000 books. "The probability a book is in the library is 1/3". So (1/3)(3000)= 1000 books are in the library.

"If the book is in the library, then it is equally probable that the book is on one of total 100 bookshelves." So there are 1000/100= 10 books on each book shelf.

"We checked 40 bookshelves and the book is not on any of them". There are 60 bookshelves, so 600 books unchecked. The probability the book is one of those is 600/(600+2000)= 600/(2600)= 3/13

Thank you for showing this kind of approach to the problem! I actually tried to look at it this way, even tried to form a table, but I've failed. I have solved some other probability problems which seemed more intuitive for this kind of perspective (for example problems regarding population, production units ect.). Unfortunately I couldn't do it for this particular problem.This is my first encounter with probability (not counting some simple basics in elementary school) and I'm sure I still have very much to learn. So I agree with your statement about thinking, and I thank you for your advice. But I also think that this kind of problem is good to look at from both perspectives, because the Bayes formula also requires thinking in a different way, for example understanding how to define and recognise every particular event needed for the calculation.

I think I understand the solution you gave, except for the very end. I presume you meant that 600 would be "the number of ways it can happen" and 2600 would be "the total number of outcomes", so the probability is \(\displaystyle \frac{600}{2600}\)

Could you please tell me where does the 600 + 2000 comes from?

I would look at it as 3000 total books minus 400 that we checked equals 2600 of books we take into account. So from 3000 books at the beginning, 2000 books are those outside the library, 1000 are in the library, of which 400 are checked and 600 unchecked, if I understood you reasoning correctly.
 
Since we're now talking about alternative ways, let me show how I use my table (which is equivalent to Bayes):

First, we know the probability that the book is not is the library is 1 - P(L) = 2/3

S S'total
L1/3
L'2/3
total1


Since a book that is on a shelf must be in the library, we know that the probability of S and L' is 0:

S S'total
L1/3
L'02/3
total1


Therefore, the probability of S' and L' is 2/3 (2/3 = 0):

S S'total
L1/3
L'02/32/3
total1


Now, if it is in the library, the probability that we would see it, P(S and L), is 40% of 1/3 = 2/15:

S S'total
L2/151/3
L'02/32/3
total1


That leaves P(S' and L) = 1/3 - 2/15 = 1/5, and we can add up the columns:

S S'total
L2/151/51/3
L'02/32/3
total2/1513/151


So the probability that it is in the library, given that it is not on those shelves, is found in the S' column: (1/5)/(13/15) = 3/13.
 
Since we're now talking about alternative ways, let me show how I use my table (which is equivalent to Bayes)

Oh yeah, this is a very nice solution :)

This is basically the same approach I've seen in one of my textbooks, regarding the problem of finding probability of a product being irregular given that it was manufactured specifically by one of the three suppliers/manufacturers. Percentage of how many products each company manufactures and a probability that the product would turn out irregular when coming from each particular company were given in the text. So they took a certain quantity of total products made by all companies (for example 1000), approach similar to what HallsofIvy described. The table then shows the number of irregular and regular products made from each company and a total number of irregular, regular and all products. Then it all comes down to basic probability of dividing "the number of ways it can happen" with "the total number of outcomes".

It seems more intuitive to me than this library problem,
though. Maybe because it seems like more of a problem you would encounter in real life. Now when I see your solution, it seems like it comes down to the same thing, so I find it very educational. Thank you for sharing!
 
Last edited:
Top