About 21 minutes. You’re gonna be up there a while. Why?

With 101 books, there are 5,050 combinations of two books possible: To make a pair, there are 101 books for the first choice and then 100 books available for the second choice. 101 x 100 = 10,100. However, we double-counted because Book A and Book B is the same pair as Book B and Book A (aka order doesn’t matter) so we need to divide our result by the number of ways that two items can be arranged–two. So 10,100 / 2 = 5,050. The alternate method is using the combinations formula for C(101, 2), or “Combinations, 101 choose 2.” C(101, 2) = 101! / ((101 – 2)! 2!) = 5,050.

So we now have to calculate the expected number of the 5,050 pairs we will need to try in order to open the passageway. When looking for something in a group of *n* choices, it will take on average (*n* + 1) / 2 tries, which is also the average of the integers from 1 to *n*. In this case, that’s 5051/2, or 2525.5 tries.

At two attempts per second, that’ll take on average 2525.5/2 = 1262.75 seconds, or about 21 minutes. But it could take you less than a second or more than 42 minutes!