What is the probability of getting caught? 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. 
 A: As shown below, the teacher will spend $1.5$ minutes in the class room and the student will spend $n+3$ minutes in danger (if she cheats $n$ times):

The probability of not being caught is $$\frac{180-(n+3)}{180}.$$
For $n=1$, this probability is  $\approx0.977$ already less than $0.999$. So the student will not cheat at all.
A: First of all, don't try to think about this in terms of discrete minutes or seconds: just consider the length of time that is the 'window' during which  the students gets caught: assuming the teacher is just as likely to come in at any time during the $180$ minutes as far as the student is concerned, your u can just take the ratio of that window and the full $180$ minutes as the probability that the students gets caught.
Second, if the student takes out the book just once and at the very beginning of the exam, then the student will get caught if the teacher walks in anytime in the first one and a half minutes, which is already more than $0.1$% of the total $180$ minutes.
So, even with the teacher coming in just once during the $180$ minutes, the student would already have a more than $0.1$% chance of getting caught! So, the student should not take out the book at all if the student wants at a probability of at least $99.9$% of not getting caught.
By the way, the student getting out the book right at the start (or at the very end) is, from the student's perspective, the best case scenario: If the student takes out the book somewhere in the 'middle', there is a whole $2$ minute time period during which the teacher coming in will end up in the student being caught. So that makes things even worse for the student.
