So, about this math problem...

MCakaTLK

First Post
Well, statistics, actually. This problem interested me. Assuming someone can solve it (I can't, I'm a comp sci major, statistics is not my strong point,) it would be an neat way to assign value to treasure.

Say you have a dragon, and a cave with multiple rooms, with each room having one or more exits. Designate one room the exit, and one room the treasure room, which contains the dragons hoarde. Now, the dragon is a little strange. He's nearsighted, deaf, and doesn't smell very well. Unless he's in the same room as something, he won't know it's there. He's also restless, so he wanders through his cave system, completely at random. Given some pattern of movement (for example,once every minute the dragon moves through a random exit in the room he's in) what are the odds of him being in any room at some given time?

This may be a really hard problem, or a really easy one. I have no idea :p If anyone feels like tackleing it, I'd be interested in the answer. (Yay! Answers!)
 

log in or register to remove this ad

Welcome to the boards!

First, to determine in what room the dragon can be, we have to set up the cavern:

How many rooms? Variable?
Is the number of exits in a single room also variable?
Can the dragon leave the cave complex?
What happens if it does?

If you let the "experience" last long enough, or that you determine that the dragon starts off in a random room, then I would guess that the probability that the dragon is in a particular room would be proportional to the number of exits that room would have.

AR
 

Altamont Ravenard said:
Welcome to the boards!
First, to determine in what room the dragon can be, we have to set up the cave.
How many rooms? Variable?
Is the number of exits in a single room also variable?
Can the dragon leave the cave complex?
What happens if it does?
AR

Thanks for the welcome. As for the question, simple parameters seem like a good place to start with me. For example, how about 6 rooms, set up like so

simple.jpg

The dragon would be restricted to the cave. I suppose you could change this, and say that he randomly leaves the cave at some point in time, for some length of time. Or that if he's in the cave entrance (room 1 in this example) he has some chance of going for a walk in the woods. But I'm still wrapping my mind around this one, so I'll forgoe that for now :)

I guess the dragon needs a starting place, so how about at the back of the cave, room 6.

So at time 0, the probability that he's in room 6 is 1, and all other rooms is 0.

After one time unit he has to move (Itchy feet, I don't know.) I suppose you could give some chance of him not moving, but I'm still going for simple. So at time 1, he has to move. One exit from room 6 leaves him in room 5. Therefore, at time 1, he has a probability of 1 to be in room 5, and 0 everywhere else.

Now, what about time 2? 3 exits leaves probability of 1/3 in rooms 6, 4, and 3, and a probability of 0 everywhere else. I think.

Assuming I have that right, the problem for me is turning this from a recursive problem (ie, if I know the time, and the room, I can compute the probability at time + 1 of him being in a given room) can some limit be taken, as time goes to infinity, which will give a probability per room at any time?
 
Last edited:

MCakaTLK said:
Well, statistics, actually. This problem interested me. Assuming someone can solve it (I can't, I'm a comp sci major, statistics is not my strong point,) it would be an neat way to assign value to treasure.

Say you have a dragon, and a cave with multiple rooms, with each room having one or more exits. Designate one room the exit, and one room the treasure room, which contains the dragons hoarde. Now, the dragon is a little strange. He's nearsighted, deaf, and doesn't smell very well. Unless he's in the same room as something, he won't know it's there. He's also restless, so he wanders through his cave system, completely at random. Given some pattern of movement (for example,once every minute the dragon moves through a random exit in the room he's in) what are the odds of him being in any room at some given time?

This may be a really hard problem, or a really easy one. I have no idea :p If anyone feels like tackleing it, I'd be interested in the answer. (Yay! Answers!)


This depends on howe the problem is set up, and how it is measured. A simple ring of rooms (1--2--3--4--5--, where 5 connects to 1) makes it equally likely that he's in any room at a given time.

For a general solution, you're looking at a Google connectedness algorothm.
 

I know this answer can not be right (it's just too simple), but it is a starting point.

1. Let's say there are 100 rooms.
2. Further, let's say that there are no dead end rooms, that is, no room has as it's only exit the room you entered from.
3. Let's say the dragon is always wandering and only stays in a room for 1 minute before being bored (in addition to the nearsightedness, deafness, and clogged nasal passages, he apparently has ADD too) and going to another room.

Then for any time frame less than one minute the chance of the dragon being in any room is 1/100.



right?

g!
 

apsuman said:
I know this answer can not be right (it's just too simple), but it is a starting point.

1. Let's say there are 100 rooms.
2. Further, let's say that there are no dead end rooms, that is, no room has as it's only exit the room you entered from.
3. Let's say the dragon is always wandering and only stays in a room for 1 minute before being bored (in addition to the nearsightedness, deafness, and clogged nasal passages, he apparently has ADD too) and going to another room.

Then for any time frame less than one minute the chance of the dragon being in any room is 1/100.



right?

g!


What you just said is this: there are 100 rooms. I put the dragon in one at random. Thus, there is 1 in 100 chance that the dragon is in any given room.
 

Try this one on for size:

A security guard is employed to patrol a shopping complex. The guard is instructed to wait 10 minutes at each corner (numbered 1 to 4.) After 10 minutes, the guard must either stay where he is or move to one of the adjacent corners. Movements should be at random so that the chances of remaining or moving to each adjoining corner are the same.

1___2
|...../|
|..../.|
|.../..|
|../...|
|./....|
|/___|
3 4



T = [1/3 1/3 1/3 0 ]
|1/4 1/4 1/4 1/4|
|1/4 1/4 1/4 1/4|
[ 0 1/3 1/3 1/3]

Question:
Find the steady-state matrix for the likelihood of the guard's being at each of the corners.


Subject: Re: Finding the steady state matrix

I ALWAYS work with the columns adding to 1 when using probability
matrices.

So we require the column vector

[a]

[c]
[d]

to remain unchanged when the above matrix operates on it.

[1/3 1/4 1/4 0] [a] [a]
[1/3 1/4 1/4 1/3] * =
[1/3 1/4 1/4 1/3] [c] [c]
[0 1/4 1/4 1/3] [d] [d]

This will produce 4 equations:

-(2/3)a + (1/4)b + (1/4)c + 0.d = 0
(1/3)a - (3/4)b + (1/4)c + (1/3)d = 0
(1/3)a + (1/4)b - (3/4)c + (1/3)d = 0
0.a + (1/4)b + (1/4)c - (2/3)d = 0

and solving for a, b, c, d in terms of one variable b we get:

a = 3b/4
b = b
c = b
d = 3b/4

Finally we can use

a + b + c + d = 1

to get b = 2/7, and the stable vector is

[3/14]
[ 2/7]
[ 2/7]
[3/14]

So the probability that guard is at corners 1 and 4 is 3/14 each and
the probability that he is at corners 2 and 3 is 2/7 each.

The stationary matrix will have all 4 columns the same with the
entries:

[3/14]
[ 2/7]
[ 2/7]
[3/14]

- Doctor Anthony, The Math Forum
http://mathforum.org/dr.math/


For more clarity, or perhaps a different scenario (like assuming the dragon/security guard MUST move, and cannot stand still), try contacting the good doctor above :)
 

don't forget at any given time X he is in a doorway. so he is technically in 2 rooms at the same time. ;) since there is no facing in this edition.
 

Now, what about time 2? 3 exits leaves probability of 1/3 in rooms 6, 4, and 3, and a probability of 0 everywhere else. I think.

Assuming I have that right, the problem for me is turning this from a recursive problem (ie, if I know the time, and the room, I can compute the probability at time + 1 of him being in a given room) can some limit be taken, as time goes to infinity, which will give a probability per room at any time?
Well, this should be fairly straightforward... Let P(n) be the probability of him being in room n at a given time; the sum of the probability figures at any given time will be one.

At t=0, since you stated such, P(6) = 1.

The way to tackle this is as follows:

1.) What is P(n) for t=n each room given that he is in room n at t - n-1?

For example, if he was in room 1 before he last moved,
P(2) = 1
If he was in room 2 before he last moved,
P(1) = 1/3
P(3) = 1/3
P(4) = 1/3
If he was in room 3 before he last moved,
P(2) = 1/2
P(5) = 1/2
If he was in room 4 before he last moved,
P(2) = 1/2
P(5) = 1/2
If he was in room 5 before he last moved,
P(3) = 1/3
P(4) = 1/3
P(6) = 1/3
And of course if he was in room 6 before he last moved,
P(5) = 1

By successively multiplying probabilities, we can see what room he's in at a given moment in time... multiply his probability of being at a certain location based on his location last turn (by the chart above) by the probability of him being in the location the turn before... for instance, the probability of his moving from 6 to 5 on turn 1 is one. The probability of him moving from 5 to 4 on turn 2 is 1/3, so his probability of BEING in room 4 on turn two is 1 (probability of him making the move from 6 to 5) *1/3 (probability of him making the move from 5 to 4). Repeat ad nauseum.

t=0 -> P(6) = 1 by definition
t=1 -> 1*possibilities from room 6 above -> 1 * P(5) = 1
t=2 -> 1*possibilities from room 5 above ->
P(6) = 1/3*1
P(4) = 1/3*1
P(3) = 1/3*1

t=3 ->
1/3 chance of being in P(6) time 1/1 chance of moving from 6 to 5 which leads to:
P(5) = 1/3 * 1
1/3 chance of being in P(4) which leads to:
P(5) = 1/3 * 1/2
P(2) = 1/3 * 1/2
1/3 chance of being in P(3) which leads to:
P(2) = 1/3 * 1/2
P(5) = 1/3 * 1/2

So the sum for t=3 is:
P(5) = 1/3*1 + 1/3*1/2 + 1/3*1/2 = 1/3 + 1/6 + 1/6 = 2/3
P(2) = 1/3*1/2 + 1/3*1/2 = 1/3

Now we can consider t=4, again making a tree from P(5) and P(2):
P(3) = 1/3 * 2/3
P(4) = 1/3 * 2/3
P(6) = 1/3 * 2/3
P(1) = 1/3 * 1/3
P(3) = 1/3 * 1/3
P(4) = 1/3 * 1/3

P(3) = 1/3*2/3 + 1/3*1/3 = 2/9 + 1/9 = 1/3
P(4) = 1/3*2/3 + 1/3*1/3 = 2/9 + 1/9 = 1/3
P(1) = 1/3*1/3 = 1/9
P(6) = 1/3*2/3 = 2/9

Now for t=5
P(2) = 1/2 * 1/3
P(5) = 1/2 * 1/3
P(2) = 1/2 * 1/3
P(5) = 1/2 * 1/3
P(2) = 1 * 1/9
P(5) = 1 * 2/9

Or, quickly, P(2) = 1/6+1/6+1/9 = 1/3+1/9 = 4/9 and P(5) = 5/9

It is interesting to note that on odd-numbered turns (t=1, 3, 5), etc., the dragon will always be found in either room 2 or room 5, while on even-numbered turns, the dragon will always be found in room 1, 3, 5, or 6.

Intuition tells me that the probability of the dragon being in a particular room as t-> infinity for this particular layout is directly proportional to the number of "entrances" into a room; i.e., that as t -> infinity we have:

Odd-numbered turns: 50% chance of being in room 2, 50% chance of being in room 5 (3 entrances to each).

Even-numbered turns: Room 1 has one entrance, Room 6 has one entrance, room 3 has 2 entrances, as does room 4. Hence we have 6 total "entrances" which tells me that on even numbered turns:
Room 1: 1/6 chance of being in room 1. 1/6 chance of being in room 6. 1/3 chance of being in room 3. 1/3 chance of being in room 4.

Can't empirically prove it off the cuff, but if you work out the next few turns, you'll see the numbers starting to get closer and closer to those distributions.

More in a bit.

--The Sigil

EDIT: On even-numbered turns... if the odds for odd-numbered turns are in fact 50-50 for large quanitites of t, then it seems patently obvious that the odds are 1-2-2-1 on even numbered turns...

P(1) = 1/3*1/2
P(3) = 1/3*1/2
P(4) = 1/3*1/2

P(3) = 1/3*1/2
P(4) = 1/3*1/2
P(6) = 1/3*1/2

P(1) = 1/6; P(3) = 1/6+1/6; P(4) = 1/6+1/6; P(6)=1/6

How do we know that we'll get to the 50/50 split on large quantities of t? Without actually doing the math, suffice to say that we have converging series. I have done enough exercises like this to trust my own judgement, though hopefully it is self-evident that over time, if he can be in only one of two locations on an even-numbered turn, and the physical setup is a diagonal reflection, the odds will go to 50-50. Just for sake of argument, though, let's run another turn or two...

t=5
P(2) = 4/9
P(5) = 5/9

So at t=6
P(1) = 1/3*4/9
P(3) = 1/3*4/9
P(4) = 1/3*4/9
P(3) = 1/3*5/9
P(4) = 1/3*5/9
P(6) = 1/3*5/9

or
P(1) = 4/27
P(6) = 5/27
P(3) = P(4) = 1/3*4/9 + 1/3*5/9 = 1/3

so at t=7

P(2) = 1 * 4/27
P(2) = 1/2 * 1/3
P(5) = 1/2 * 1/3
P(2) = 1/2 * 1/3
P(5) = 1/2 * 1/3
P(5) = 1 * 5/27

And we have P(2) = 4/27 + 1/6 + 1/6 = 4/27 + 1/3 = 13/27
P(5) = 5/27 + 1/6 + 1/6 = 5/27 + 1/3 = 14/27

These are converging towards 1/2.
 
Last edited:


Remove ads

Top