Maybe you have already solved the
Door Repairing Problem for YY, who is the officer of the accommodation building B37, in a famous university called Famous University. Maybe you have not, but it does not matter because the new term is coming. So here comes the
Another Door Repairing Problem!
As is described in
Door Repairing Problem, many students live in B37. The building is old, so sometimes a careless student such as LMY may open the door of the building too vigorously, and break it as a result. However, when a student opens the door and finds it already broken, he will report it to the headmaster, and YY will be punished as a result…
More precisely, the door is fine at the beginning of the term. The term has a length of T
term. During the term, the door will be opened many times, which can be regarded as a Poisson process, i.e., in any period of length T, the probability that the door will be opened k times is
,
where λ is a positive real constant. Note that for any non-negative real T,
When the door is fine and is opened by some student, the probability that he carelessly breaks the door is p. (0<p<=1) When the door is broken, YY can repair it anytime he likes.
Both repairing the door and being punished cost a lot. YY has thought for many days trying to make a best strategy when to repair the door, so that his expense can be minimized in expectation. He failed, so he is going to try the simplest ways. Given the length of the term T
term, the constant λ, the probability p, and the question type Q, you are to solve the
Another Door Repairing Problem:
When Q=1, tell the expected number of times YY has to repair the door, if he always repairs it immediately after it is broken.
When Q=2, tell the expected number of times YY will be punished, if he never repairs the door.