You have a math exam of $180$ minutes. However, the teacher doesn't stay in the classroom the entire time. He randomly enters the classroom $3$ times. Each time he spends $30$ seconds before he leaves again. One of the student figures he can cheat by looking up the answers in his book. The act of taking out his book, finding the answer and putting his book back in his bag takes $1$ minute. The student wants to make sure that the probability of not getting caught is at least $99.9\%$. Consider the student caught when some part of the $30$ secondes overlap with some part of the $1$ minute. Note: the student doesn't know whether the teacher is in the classroom, so it is possible that he takes out his book while the teacher is already present. How many times can the student takes out his book while maintaining a $99.9\%$ chance (minimum) of not getting caught?
I translated the question since English isn't my native language
I honestly don't know how to even approach this question. I tried a lot of binomials but nothing makes sense. I figured it should be someting like 180 choose n (where n is the number of times he cheats) over n*2 choose 3. I didn't want to do n*60 choose 90 since that doesn't incorporate the fact that the teacher stays in the classroom for 30 consecutive seconds. But all of it doesn't make sense. Working with seconds instead of 180 minutes yields entirely different results while I would expect them to be the same. It's driving me crazy. If someone could help me out it would mean the world.