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

You are not logged in.

## #401 2013-04-01 11:26:49

anonimnystefy
Real Member

Offline

### Re: PSLQ and LLL?

Can't you, please, post the code?

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

## #402 2013-04-01 11:29:26

bobbym

Online

### Re: PSLQ and LLL?

Okay, I am now pretty sure of it's accuracy:

#### Code:

```maze[]:=Module[{box, L={0,0,0,0}},

firstmove=RandomInteger[{1,4}];
If[firstmove==1, box=1;L[[4]]=1];
If[firstmove==2, box=2;L[[4]]=2];
If[firstmove>2, box=3;L[[4]]=3];
Do[
move=RandomInteger[{1,2}];
If [box==1 && move==1,L[[1]]=1;Return[L]];
If [box==1 && move==2,box=2];

move=RandomInteger[{1,3}];
If [box==2 && move==1,box=1];
If [box==2 && move==2,L[[2]]=1;Return[L]];
If [box==2&& move==3,box=3];

move=RandomInteger[{1,3}];
If [box==3&& move==1,box=2];
If [box==3 && move>1,L[[3]]=1;Return[L]],
{100}]
]

ans =Table[maze[],{1000000}];

(Select[ans,#[[3]]==1 && Last[#]==1&]//Length)/(Select[ans,#[[3]]==1 &]//Length)

0.07703891543158152```

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.

## #403 2013-04-01 11:39:01

anonimnystefy
Real Member

Offline

### Re: PSLQ and LLL?

Shouldn't you be checking if Last[#] is 1. That is where he enters.

And what is the rest of the list L for?

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

## #404 2013-04-01 11:41:19

bobbym

Online

### Re: PSLQ and LLL?

The list L contains all that information.

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.

## #405 2013-04-01 11:45:10

anonimnystefy
Real Member

Offline

### Re: PSLQ and LLL?

But, shouldn't you be checking if the third element is 1 and the fourth is 1?

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

## #406 2013-04-01 11:46:45

bobbym

Online

### Re: PSLQ and LLL?

L[[4]] has the room the rat entered in

L[[1...3]] Has either a 1 or a 0. For instance L={0,1,0,3} would mean the rat entered the maze in room 3 and exited from room 2. L={1,0,0,2} would mean the rat entered the maze in room 2 and exited from room 1.

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.

## #407 2013-04-01 11:51:40

anonimnystefy
Real Member

Offline

### Re: PSLQ and LLL?

Then that means you are selecting the cases where the rat has entered in room 3 and left at room 1!

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

## #408 2013-04-01 11:57:00

bobbym

Online

### Re: PSLQ and LLL?

Yikes, that is correct. I told you not to rush me! I have adjusted the code.

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.

## #409 2013-04-01 11:58:19

anonimnystefy
Real Member

Offline

### Re: PSLQ and LLL?

You need #[[3]]==1 in the second select as well.

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

## #410 2013-04-01 12:01:02

bobbym

Online

### Re: PSLQ and LLL?

Hi;

No, that is correct. Last[L] == 1 says it entered the maze in room 1.

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.

## #411 2013-04-01 12:05:24

anonimnystefy
Real Member

Offline

### Re: PSLQ and LLL?

Oh, I tought that was for c).

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

## #412 2013-04-01 12:06:25

bobbym

Online

### Re: PSLQ and LLL?

That is what I did it for:

(c) If the rat leaves the maze from Room 3 find the probability that it entered at Room 1.

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.

## #413 2013-04-01 12:20:17

anonimnystefy
Real Member

Offline

### Re: PSLQ and LLL?

Well, that probability is P(entered at 1 and left at 3)/P(left at 3). That means the second Select selects the cases when the rat left at three, i.e. when #[[3]]==1.

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

## #414 2013-04-01 12:27:53

bobbym

Online

### Re: PSLQ and LLL?

Hmmm, I think it should be
( the cases it left at 3 and started at 1) / (cases it started at 1 ).
That is what I have calculated.

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.

## #415 2013-04-01 12:35:05

anonimnystefy
Real Member

Offline

### Re: PSLQ and LLL?

That is not correct. That will give you the answer for a).

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

## #416 2013-04-01 12:45:10

bobbym

Online

### Re: PSLQ and LLL?

Hi;

Out of 1000000 tries the rat started in room 1, 250077 times. About 1 / 4 which is
just what we expect. The number of times it left room 3 after starting in room 1 is
38522

38522 / 250077 = 0.15404 which is just what I am getting with mine.

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.

## #417 2013-04-01 12:48:22

anonimnystefy
Real Member

Offline

### Re: PSLQ and LLL?

Yes, but that still answers a).

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

## #418 2013-04-01 12:51:39

bobbym

Online

### Re: PSLQ and LLL?

Maybe the answers are the same? Is there something wrong with what I did in post #416?

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.

## #419 2013-04-01 12:54:44

anonimnystefy
Real Member

Offline

### Re: PSLQ and LLL?

Yes, there is.

Do we agree that the probability we are looking for is P(entered at 1|left at 3)?

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

## #420 2013-04-01 12:56:10

bobbym

Online

### Re: PSLQ and LLL?

Yes, that looks good.

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.

## #421 2013-04-01 12:57:46

anonimnystefy
Real Member

Offline

### Re: PSLQ and LLL?

And, do you agree that P(A|B)=P(A and B)/P(B)?

Last edited by anonimnystefy (2013-04-01 12:58:24)

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

## #422 2013-04-01 12:59:52

bobbym

Online

### Re: PSLQ and LLL?

Yes, that is the definition.

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.

## #423 2013-04-01 13:01:36

anonimnystefy
Real Member

Offline

### Re: PSLQ and LLL?

That means that P(entered at 1|left at 3)=P(entered at 1 and left at 3)/P(left at 3).

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

## #424 2013-04-01 13:06:21

bobbym

Online

### Re: PSLQ and LLL?

Hmmmm, hard to argue with that one. By golly I think you are right. I did not look at it that way.

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.

## #425 2013-04-01 13:08:14

anonimnystefy
Real Member

Offline

### Re: PSLQ and LLL?

Well, there you have it. What is the new result?

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