probability

Discussion in 'CT3' started by asmkdas, May 19, 2013.

  1. asmkdas

    asmkdas Member

    A miner is trapped in a mine containing 3 doors.The first door leads to a tunnel that will take him to safety after 3 hours of travel,The second door leads to a tunnel that will return him to the mine after 5 hours of travel. The third door leads to a tunnel that will return him to the mine after7 hours of travel. If we assume that the miner is at all times equally likely to choose anyone of the doors, find the expected time for him to get to safety.
     
  2. Amit_Bansal

    Amit_Bansal Member

    it is approximately between 12.75 and 13 hours.!
    is it ??
     
    Last edited by a moderator: May 19, 2013
  3. Oxymoron

    Oxymoron Ton up Member

    Reminds of me a old problem when I did when I was preparing for CT4 a couple of years back - so concepts maybe a bit edgy

    Let X = expected time to go out of mine

    X = (1/3)*(expected time to go out of mine from door 1 = 3 hours) + (1/3)*(X + 5) + (1/3)*(X + 7)

    X + 5 stems from the fact that if he chooses door 2, he will have to get back to the mine but will have an additional 5 hours wasted (same with door 3)

    => X = 15 hours.
     
  4. Oxymoron

    Oxymoron Ton up Member

    15 is correct.

    MATLAB Code to solve the same using Monte Carlo:
    Code:
    n = 100000;
    total_hours = zeros(n,1);
    
    for i = 1:n
        exit = 0;
        hours = 0;
        while exit == 0;
            Door = ceil(rand*3);
            switch Door
                case 1
                    hours = hours + 3;
                    exit = 1;
                case 2
                    hours = hours + 5;
                    exit = 0;
                otherwise
                    hours = hours + 7;
                    exit = 0;
            end
        end
        total_hours(i,1) = hours;
    end
    
    answer = mean(total_hours)
    
     
    Last edited: May 19, 2013
  5. suraj

    suraj Member

    Is the answer "9" ??
     

Share This Page