A mouse has 3 rooms to go into.
If it goes into room 1, it will find the cheese after 3 minutes.
If it goes into room 2, it will look for cheese for 4 minutes, won't find it, and will go out.
If it goes into room 3, it will look for cheese for 5 minutes, won't find it, and will go out.
The mouse will not remember that it was in rooms 2 and 3 after it goes out of them, and it will continue going in and out until it finds the cheese. (It can go into the same room again and again.)
What is the average time for the mouse to find the cheese?
(In reply to
solution by xdog)
On average, the mouse will find the cheese after entering 3 rooms. The last of these will of course be room 1. So on average he'll visit two others before room 1. The average time spent there will be 4.5 minutes each. Then 4.5 * 2 + 3 = 12 minutes as his average (expected) time to get the cheese.
A simulation confirms this:
DEFDBL A-Z
FOR m = 1 TO 1000000
t = 0
DO
room = INT(RND(1) * 3 + 1)
SELECT CASE room
CASE 1
t = t + 3: EXIT DO
CASE 2
t = t + 4
CASE 3
t = t + 5
END SELECT
LOOP
tt = tt + t: PRINT m, tt, tt / m
NEXT
which gave, after 1,000,000 trials, the mouse having spent 12,022,242 minutes, an average time of 12.022242 minutes.
|
Posted by Charlie
on 2008-09-11 13:56:10 |