Harry Potter in Magical Maze --- II

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 NOT affected Harry`s Memory because of a protective spell, so he remembers exactly 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 440.

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.

2 solutions

Satyen Nabar
Aug 7, 2014

In the event, there is memory, the following equation will be true:

Escape time =

0.25 x 5 +

0.25 x 3 +

0.25 x (8 + 5/3 + 3/3 + 1/3*(2 + 5/2 + 3/2)) +

0.25 x (2 + 5/3 + 3/3 + 1/3*(8 + 5/2 + 3/2))

Solving, one would get 7 minutes 20 seconds (440 seconds) as the answer.

0.25 x (8 + 5/3 + 3/3 + 1/3 (2 + 5/2 + 3/2)) + 0.25 x (2 + 5/3 + 3/3 + 1/3 (8 + 5/2 + 3/2))
how did you get this?

Deena Albert - 6 years, 9 months ago

Each route has 1/4 probability. If route B is taken, it leads back to the start in 8 minutes. Now Harry can take one of three routes, A, C, D with 1/3 probability. If A or C is chosen Harry is out in 5 and 3 minutes respectively. If route D is chosen, Harry will be back to start in 2 minutes. Now he can choose between one of two possible routes with 1/2 probability. If route A he is out in 5 and if route C , he is out in 3 minutes.

The same logic for choosing route D initially.

Satyen Nabar - 6 years, 9 months ago

Both problems were amazing sir,

A Former Brilliant Member - 5 years, 12 months ago

Log in to reply

Tx Chinmay :)

Satyen Nabar - 5 years, 12 months ago

shit ! thought it asked for minutes , entered 7 :(

A Former Brilliant Member - 4 years, 3 months ago
Brock Brown
Feb 9, 2015

Monte Carlo simulation in Python:

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

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...