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

You are not logged in.

## #26 2013-03-31 17:46:37

Agnishom
Real Member

Offline

### Re: rat run probability

Any of them

'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

## #27 2013-03-31 19:35:46

bobbym

Offline

### Re: rat run probability

Let's look at the first one:

You would initialize 3 variables probably in an array to keep track of where the mouse is. You start him in one and then generate random numbers to move from room to room. You would tally up the number of times it leaves from room1, room 2 and room 3. You would run millions of these and then compute the percentage from room 3.

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.

## #28 2013-03-31 21:36:52

Agnishom
Real Member

Offline

### Re: rat run probability

Why 3 variables?

'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

## #29 2013-03-31 22:06:06

bobbym

Offline

### Re: rat run probability

Because there are 3 rooms to exit from.

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.

## #30 2013-03-31 22:27:39

Agnishom
Real Member

Offline

### Re: rat run probability

So how would I count the things basically? I am confused

'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

## #31 2013-03-31 22:32:21

bobbym

Offline

### Re: rat run probability

Hi;

You start in box one;

So say box[1]=1 now generate a random number between 0 and 1. If the number is <.5 then exit and count it as an exit from box A. Else you goto box 2

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.

## #32 2013-03-31 22:42:36

Agnishom
Real Member

Offline

### Re: rat run probability

Is it possible that we can do it manually?
There are not many rooms

'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

## #33 2013-03-31 22:44:52

bobbym

Offline

### Re: rat run probability

Not really the problem is it is difficult to tree because the rat can go to 2 and then back to 1. Because he can can backwards the rats path could be very large.

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.

## #34 2013-03-31 22:51:04

Agnishom
Real Member

Offline

### Re: rat run probability

And if we simulate we have to simulate each case for a finite amount of turns

'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

## #35 2013-03-31 22:53:18

bobbym

Offline

### Re: rat run probability

I would choose something like 100 moves. It is possible the rat might still be in the maze but very improbable. So you would have a good estimate, which is what a simulation is.

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.

## #36 2013-03-31 23:04:18

Agnishom
Real Member

Offline

### Re: rat run probability

Okay let me do it

'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

## #37 2013-03-31 23:15:07

Agnishom
Real Member

Offline

### Re: rat run probability

One question, can the rat enter once it has left?

Last edited by Agnishom (2013-03-31 23:21:57)

'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

## #38 2013-03-31 23:32:43

bobbym

Offline

### Re: rat run probability

Once the rat has left the rooms to go into the outer chamber the game is over.

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.

## #39 2013-03-31 23:34:01

Agnishom
Real Member

Offline

### Re: rat run probability

Is my simulation okay?

For b) I am getting 0.49939447

Last edited by Agnishom (2013-03-31 23:37:22)

'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

## #40 2013-03-31 23:36:27

bobbym

Offline

### Re: rat run probability

For b, I have not done the problem yet. When the OP did not come back I stopped working on it. I have to do a chore and then I will start on it.

You have done well being able to write the simulation.

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.

## #41 2013-03-31 23:37:58

Agnishom
Real Member

Offline

### Re: rat run probability

Thank you
I just edited the last post

'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

## #42 2013-03-31 23:53:03

Agnishom
Real Member

Offline

### Re: rat run probability

For c) I am getting 0.352179

'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

## #43 2013-04-01 00:05:31

bobbym

Offline

### Re: rat run probability

That is very good thinking, notice that your simulation backs that idea up.

b) 1 / 2 is correct.

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.

## #44 2013-04-01 00:56:31

Agnishom
Real Member

Offline

### 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

## #45 2013-04-01 02:50:35

anonimnystefy
Real Member

Online

### Re: rat run probability

Hi bobbym

How do you do simulations like this in M?

The limit operator is just an excuse for doing something you know you can't.
“It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment

## #46 2013-04-01 09:07:22

bobbym

Offline

### Re: rat run probability

Which M are you talking about?

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.

## #47 2013-04-01 09:18:06

anonimnystefy
Real Member

Online

### Re: rat run probability

The one and only. Mathematica.

The limit operator is just an excuse for doing something you know you can't.
“It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment

## #48 2013-04-01 09:19:51

bobbym

Offline

### Re: rat run probability

Mathematica is superior to all when it concerns mathematical programming. I have tried them all and will not use anything else.

How to do it? I am doing it now. But the first parts have been already solved using M's probability commands.

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.

## #49 2013-04-01 09:25:24

anonimnystefy
Real Member

Online

### Re: rat run probability

But, I want you to show me how to do simulations in it.

The limit operator is just an excuse for doing something you know you can't.
“It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment

## #50 2013-04-01 09:30:15

bobbym

Offline

### Re: rat run probability

There are many ways to use M's probability functions to get simulations. If you have the PDF or the Markov matrix, M can run a simulation just from that.

Also, you can use M's lisp type functional programming to do it. As soon as I do it for c) I will post it for you. Right now I have administrative matters to deal with and they are slowing me down.

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.