random walk 1-d and 2-d

Post on 25-Oct-2014

104 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

Week 1...Presentation about random Walk in 1-D and 2-D as basic theory of echonphysics

TRANSCRIPT

Random Walk in 1-D and 2-D

Andri RahmadhaniDepartment of Physics ITB – KAIST Internship Program

Summer 2012

Basic Theory Method & Algorithm Results References

Outline

What is random walk? Algorithm that represents trajectory of

random steps The direction of random walk cannot be

predicted from the past actions.

Basic Theory

Example : Flipped coin problem

Basic Theory

Figure 1. One of possible random walks position after 5 flips

Example : Time-Series Graph (1-D)

Basic Theory

Figure 2. Time-Series random walk with N (steps) = 1000

and equal probability 0.5

Example : Square Lattice (2-D)

Basic Theory

Figure 3. Two dimensional random walk in square

lattice

The mathematics of 1-D Random Walk◦ Sum/Position after n steps: ; ◦ Expected Value:

◦ Expected translation distance after n steps:

Basic Theory

Basic Theory The mathematics of 2-D Random Walk

◦ Sum/Position after n steps: ; ◦ Absolute Value:

◦ Expected Value:

◦ Expected translation distance after n steps:

Simulation using Matlab Algorithm of Random Walk (1-D & 2-D)

1) Set the number of steps, trials, random variable, and probability of random variable

2) Generate random number and moves3) Repeat step 2 for n times which already set up in step 14) Plot sample graph5) Calculate mean/expectation value6) Increase number of steps and repeat step 2 until

reaching maximum number of steps7) Plot distance graph and print the results

Method & Algorithm

Random Walk in 1-D

Results

Figure 4. Value and distance for 10 steps with 10 trials

0 1 2 3 4 5 6 7 8 9 10-8

-6

-4

-2

0

2

4

Steps (N)

Val

ue

1st trial 2nd trial 3rd trial 8th trial 9th trial 10th trial

1 2 3 4 5 6 7 8 9 101

1.5

2

2.5

3

3.5

Number of steps (N)

Dis

tanc

e <

|Sn|

>

Distance Curve Fitting N1/2

Random Walk in 1-D

Results

Figure 5. Value and distance for 100 steps with 10 trials

0 10 20 30 40 50 60 70 80 90 100-15

-10

-5

0

5

10

15

Steps (N)

Val

ue

1st trial 2nd trial 3rd trial 8th trial 9th trial 10th trial0 10 20 30 40 50 60 70 80 90 100

0

2

4

6

8

10

12

14

Number of steps (N)

Dis

tanc

e <

|Sn|

>

Distance Curve Fitting N1/2

Random Walk in 1-D

Results

Figure 6. Value and distance for 10 steps with 10000 trials

0 1 2 3 4 5 6 7 8 9 10-6

-5

-4

-3

-2

-1

0

1

2

3

Steps (N)

Val

ue

1st trial 2nd trial 3rd trial 9998th trial 9999th trial 10000th trial

1 2 3 4 5 6 7 8 9 101

1.5

2

2.5

3

3.5

Number of steps (N)

Dis

tanc

e <

|Sn|

>

Distance Curve Fitting N1/2

Random Walk in 1-D

Results

0 10 20 30 40 50 60 70 80 90 100-20

-15

-10

-5

0

5

Steps (N)

Val

ue

1st trial 2nd trial 3rd trial 9998th trial 9999th trial 10000th trial

0 10 20 30 40 50 60 70 80 90 1001

2

3

4

5

6

7

8

9

10

11

Number of steps (N)

Dis

tanc

e <

|Sn|

>

Distance Curve Fitting N1/2

Figure 7. Value and distance for 100 steps with 10000 trials

Random Walk in 1-D◦ Curve Fitting :

Results

10 steps

10 trials

100 steps

10 trials

10 steps

100 trials

100 steps

100 trials

10 steps

1000 trials

100 steps

1000 trials

10 steps

10000 trials

100 steps

10000 trials

a 1.007 0.9786 0.8612 0.9993 1.006 0.9943 1.003 1

b 0.1199 0.08314 0.1896 0.08167 -0.003658 0.03825 -0.003868 0.006539

R2 0.8451 0.7447 0.9554 0.9651 0.9976 0.9946 0.9997 0.9995

Table 1. Curve fitting property for

Random Walk in 2-D

Results

Figure 8. Value and distance for 10 steps with 10 trials

-4 -3 -2 -1 0 1 2 3 4 5-2

-1.5

-1

-0.5

0

0.5

1

x

y

1st trial End 2nd trial End 9th trial End 10th trial End

1 2 3 4 5 6 7 8 9 101

1.5

2

2.5

3

3.5

4

Number of steps (N)

Dis

tanc

e <

|Sn|

>

Distance Curve Fitting N1/2

Random Walk in 2-D

Results

Figure 9. Value and distance for 100 steps with 10 trials

-10 -5 0 5 10 15-15

-10

-5

0

5

10

15

x

y

1st trial End 2nd trial End 9th trial End 10th trial End

0 10 20 30 40 50 60 70 80 90 1000

2

4

6

8

10

12

14

Number of steps (N)

Dis

tanc

e <

|Sn|

>

Distance Curve Fitting N1/2

Random Walk in 2-D

Results

Figure 10. Value and distance for 10 steps with 10000 trials

-2 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 3-4

-3

-2

-1

0

1

2

3

4

x

y

1st trial End 2nd trial End 9999th trial End 10000th trial End1 2 3 4 5 6 7 8 9 10

1

1.5

2

2.5

3

3.5

Number of steps (N)

Dis

tanc

e <

|Sn|

>

Distance Curve Fitting N1/2

Random Walk in 2-D

Results

Figure 11. Value and distance for 100 steps with 10000 trials

0 10 20 30 40 50 60 70 80 90 1000

2

4

6

8

10

12

Number of steps (N)

Dis

tanc

e <

|Sn|

>

Distance Curve Fitting N1/2

-6 -4 -2 0 2 4 6-10

-5

0

5

10

15

20

x

y

1st trial End 2nd trial End 9999th trial End 10000th trial End

Random Walk in 2-D◦ Curve Fitting :

Results

10 steps

10 trials

100 steps

10 trials

10 steps

100 trials

100 steps

100 trials

10 steps

1000 trials

100 steps

1000 trials

10 steps

10000 trials

100 steps

10000 trialsa 1.168 1.002 1.01 1.019 1.004 1.002 0.9961 1

b -0.3342 -0.1072 0.003024 -0.1196 0.007713 -0.0141 0.009183 -0.002094

R2 0.8919 0.7645 0.9865 0.9782 0.9975 0.9975 0.9998 0.9998

Table 2. Curve fitting property for

Root-mean-square of random walk final position or the distance is equal with root-square of number of random walk steps.

Valid for large number of random walks trials and equal probability.

Conclusion

Pearson, K. (1905). The problem of the Random Walk. Nature. 72, 294.

Van Kampen N. G., Stochastic Processes in Physics and Chemistry, revised and enlarged edition (North-Holland, Amsterdam) 1992.

McCrea, W. H. and Whipple, F. J. W. "Random Paths in Two and Three Dimensions." Proc. Roy. Soc. Edinburgh 60, 281-298, 1940.

References

Thank youEnd of slide

top related