Harry Potter in The Magical Maze

Harry Potter is in the maze to seek the Goblet of Fire. There are four paths that can be taken with Equal probability.

Path A leads to the Goblet in 5 minutes.

Path B leads back to start and takes 8 minutes.

Path C leads to Goblet in 3 minutes.

Path D is 2 minutes long and leads back to start.

Note --- The Magical Maze has affected Harry`s Memory so he does not remember which paths he had taken previously.

What is the Expected Escape Time (in seconds) in which Harry Potter can exit the maze and reach the Goblet?


The answer is 540.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

3 solutions

Satyen Nabar
Aug 6, 2014

In the scenario there is no memory, assume that E is the escape time. Given equal probability of each of the 4 exits, one can formulate the following equation:

E = (E + 8)/4 + (E + 2)/4 + (3 + 5)/4

Solving for E gives 9 minutes = 540 seconds.

How did you get that equation? @satyen nabar

A Former Brilliant Member - 6 years, 3 months ago

Log in to reply

Let E be Expected escape time. Probability of taking each path is 1/4

If he takes path A, he reaches goblet in 5 minutes. That's 5/4. Similar for path C. 3/4. Task is over.

If he takes path B, he takes 8 minutes and is back to start and will take E seconds to reach goblet, so that's (E+8)/4. Same for path D. (E +2)/4.

The Expected time is the combined addition of these 4 scenarios.

Hence the equation Andrei.

Satyen Nabar - 6 years, 2 months ago

Log in to reply

"If he takes path A, he reaches goblet in 5 minutes. That's 5/4." This paricular thing is over the head! what's 5/4.

P.S. I have not solved much complex probability sums.

Ronik Gandhi - 6 years, 1 month ago

Thanks for your help!

Brock Brown
Feb 9, 2015

Random simulations:

Python 2.7:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
import random
def walk():
    time = 0
    while True:
        path = random.choice('abcd')
        if path == 'a':
            time += 5
            return time
        elif path == 'b':
            time += 8
        elif path == 'c':
            time += 3
            return time
        elif path == 'd':
            time += 2
total_time = 0.0
trials = 1000000
for trial in xrange(trials):
    total_time += walk()
print "Minutes:", total_time/trials

Vishnu Bhagyanath
Mar 24, 2016

The probability of choosing each one of the tracks is 1 4 \frac 14 . Let T T be the expected time to reach the end of the maze. If he chooses Path A , he would reach in 5 5 minutes, if he chooses C, 3 3 minutes, if he chooses B, then 8 + T 8 + T minutes, since he goes back to the start again, and D 2 + T 2+ T minutes.

Then total expected time T = 1 4 ( 5 + ( 8 + T ) + 3 + ( 2 + T ) ) T = 9 minutes T = \frac 14 (5 + (8+T) + 3 + (2+T) )\Rightarrow T = 9 \text{ minutes}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...