Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

## #1 2013-03-18 20:15:56

lucik1900
Member

Offline

### rat run probability

A rat is released in the space outside a maze consisting of three rooms and six doors, as depicted in the following figure.

Whenever the rat is in a space or room with k doors, it chooses each of these doors to move through next with probability 1/k. We are interested in the movement of the rat from when it first enters the maze until it first leaves.

(a) If the rat enters the maze at Room 1, find the probability that it will leave
from Room 3.
(b) If the rat starts in the space around the maze, find the probability that it will
eventually leave the maze from Room 3.
(c) If the rat leaves the maze from Room 3 find the probability that it entered at
Room 1.
(d) Suppose that the rat is now in the maze and we gain information which
makes us 70% confident that it entered at Room 1 and 20% confident
that it entered at Room 2.

Find the probability that:
(i) the rat will leave from Room 3
(ii) the rat entered at Room 1 if it leaves from Room 3
(iii) the rat entered at Room 1 if it leaves from Room 1.
For (d) it may be assumed that had we known at which room the rat entered the maze,
the said additional information would not alter our beliefs regarding subsequent movements of the rat.

## #2 2013-03-18 21:06:26

bobbym

Online

### Re: rat run probability

Hi;

(a) If the rat enters the maze at Room 1, find the probability that it will leave
from Room 3.

These are Markov chains but the terminology is confusing. What does it mean to leave from room 3. Does it mean to end up in the space or in room 2?

Last edited by bobbym (2013-03-18 23:18:51)

In mathematics, you don't understand things. You just get used to them.
Some cause happiness wherever they go; others, whenever they go.
If you can not overcome with talent...overcome with effort.

## #3 2013-03-18 22:58:29

lucik1900
Member

Offline

### Re: rat run probability

"We are interested in the movement of the rat from when it first enters the maze until it first leaves."

It should be "end up the space"

## #4 2013-03-18 23:13:11

bobbym

Online

### Re: rat run probability

Hi;

So we start in the space and for this one we end up in the space.

In mathematics, you don't understand things. You just get used to them.
Some cause happiness wherever they go; others, whenever they go.
If you can not overcome with talent...overcome with effort.

## #5 2013-03-19 05:33:15

bobbym

Online

### Re: rat run probability

Hi;

Last edited by bobbym (2013-03-19 05:33:29)

In mathematics, you don't understand things. You just get used to them.
Some cause happiness wherever they go; others, whenever they go.
If you can not overcome with talent...overcome with effort.

## #6 2013-03-19 15:51:55

lucik1900
Member

Offline

### Re: rat run probability

Hi,
How do you get that?

## #7 2013-03-19 18:42:54

bobbym

Online

### Re: rat run probability

Hi;

Two ways, computer simulation and Absorbing Markov chain. There is a third way but I am unable to get it to work,

In mathematics, you don't understand things. You just get used to them.
Some cause happiness wherever they go; others, whenever they go.
If you can not overcome with talent...overcome with effort.

## #8 2013-03-30 22:18:12

Agnishom
Real Member

Online

### Re: rat run probability

What are Markov Chains?

'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'The whole person changes, why can't a habit?' -Alokananda

## #9 2013-03-30 22:26:29

bobbym

Online

### Re: rat run probability

named after Andrey Markov, is a mathematical system that undergoes transitions from one state to another, between a finite or countable number of possible states. It is a random process usually characterized as memoryless: the next state depends only on the current state and not on the sequence of events that preceded it. This specific kind of "memorylessness" is called the Markov property. Markov chains have many applications as statistical models of real-world processes

As usual Wikipedia achieves new heights in turning something simple into something that only Einstein can understand.

To understand them you have to see them.

In mathematics, you don't understand things. You just get used to them.
Some cause happiness wherever they go; others, whenever they go.
If you can not overcome with talent...overcome with effort.

## #10 2013-03-30 22:28:33

Agnishom
Real Member

Online

### Re: rat run probability

Hopefully not with a video

'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'The whole person changes, why can't a habit?' -Alokananda

## #11 2013-03-30 22:29:20

bobbym

Online

### Re: rat run probability

No, with a small example. I was just working on one that is tiny.

In mathematics, you don't understand things. You just get used to them.
Some cause happiness wherever they go; others, whenever they go.
If you can not overcome with talent...overcome with effort.

## #12 2013-03-30 22:32:17

Agnishom
Real Member

Online

### Re: rat run probability

'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'The whole person changes, why can't a habit?' -Alokananda

## #13 2013-03-30 22:32:57

bobbym

Online

### Re: rat run probability

Markov chains are used i probability and you will need to understand matrices and vectors. If you do not, don't worry, just enjoy the show and it all will come later.

Lets say a city has 85% of its living in the city and 15% of the population lives in the suburbs. But each year 7% of the people in the city move to the suburbs but only 1% of the people in the suburbs move back to the city. Assuming that the total population remains constant ( suburbs + city ) what percentage of people will be in the city after 5 years?

How do we answer this question?

In mathematics, you don't understand things. You just get used to them.
Some cause happiness wherever they go; others, whenever they go.
If you can not overcome with talent...overcome with effort.

## #14 2013-03-30 22:50:32

Agnishom
Real Member

Online

### Re: rat run probability

We calculate it one by one year stepwise

'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'The whole person changes, why can't a habit?' -Alokananda

## #15 2013-03-30 22:55:59

bobbym

Online

### Re: rat run probability

There is an easier way.

This is the initial state vector,

The transition matrix P is

Nothing amazing here just defining the terms.

We can strip away the labels and just leave the numbers.

To get the answer we just evaluate

To do that take this expression

{.85,.15}.MatrixPower({{.93,.07},{.01,.99}},5)

over to Wolfram and let me know what you get.

In mathematics, you don't understand things. You just get used to them.
Some cause happiness wherever they go; others, whenever they go.
If you can not overcome with talent...overcome with effort.

## #16 2013-03-30 23:30:49

Agnishom
Real Member

Online

### Re: rat run probability

'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'The whole person changes, why can't a habit?' -Alokananda

## #17 2013-03-30 23:37:01

bobbym

Online

### Re: rat run probability

That is very good.

Remember how the A0 vector ( initial state vector ) was labelled?

That says the first element is the percentage in the city and the second element, the percentage in the suburbs.

That says 60.28% are in the city and 39.71% are now living in the suburbs after 5 years.

In mathematics, you don't understand things. You just get used to them.
Some cause happiness wherever they go; others, whenever they go.
If you can not overcome with talent...overcome with effort.

## #18 2013-03-30 23:40:10

Agnishom
Real Member

Online

### Re: rat run probability

Ok

'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'The whole person changes, why can't a habit?' -Alokananda

## #19 2013-03-30 23:45:34

bobbym

Online

### Re: rat run probability

This is a pretty dry example that only touches the surface of what they can do. A real problem would be much larger and more meaningful.
The OP's problem can be solved with Markov chains.

But at least you got to see a little bit of it.

In mathematics, you don't understand things. You just get used to them.
Some cause happiness wherever they go; others, whenever they go.
If you can not overcome with talent...overcome with effort.

## #20 2013-03-30 23:49:59

Agnishom
Real Member

Online

### Re: rat run probability

Oh! So it is a way to do a chain of calculations quickly with matrices?

'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'The whole person changes, why can't a habit?' -Alokananda

## #21 2013-03-30 23:52:30

bobbym

Online

### Re: rat run probability

Yes, it is like condensing a whole tree down to just a box of numbers. Also it can contain a tree that has an infinite number of levels, branches and nodes. One that you could never draw...

In mathematics, you don't understand things. You just get used to them.
Some cause happiness wherever they go; others, whenever they go.
If you can not overcome with talent...overcome with effort.

## #22 2013-03-30 23:56:48

Agnishom
Real Member

Online

### Re: rat run probability

How to setup the simulation for this problem?

'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'The whole person changes, why can't a habit?' -Alokananda

## #23 2013-03-31 00:01:49

bobbym

Online

### Re: rat run probability

Hi;

We can solve the problem using 2 linked recurrences:

I spoke to soon before, there might be a way to simulate this process. We will talk about it when I get back.

In mathematics, you don't understand things. You just get used to them.
Some cause happiness wherever they go; others, whenever they go.
If you can not overcome with talent...overcome with effort.

## #24 2013-03-31 01:08:10

Agnishom
Real Member

Online

### Re: rat run probability

Sorry for the confusion, I meant : the simulation approach for the OP's problem

'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'The whole person changes, why can't a habit?' -Alokananda

## #25 2013-03-31 03:41:48

bobbym

Online

### Re: rat run probability

Which part? There are a lot of questions that the OP wanted answers to.

In mathematics, you don't understand things. You just get used to them.
Some cause happiness wherever they go; others, whenever they go.
If you can not overcome with talent...overcome with effort.