All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Probability
The mouse and the cheese (Posted on 2008-09-11) Difficulty: 2 of 5
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?

See The Solution Submitted by pcbouhid    
Rating: 3.0000 (2 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution re: solution | Comment 2 of 4 |
(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

Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (1)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2017 by Animus Pactum Consulting. All rights reserved. Privacy Information