Anda di halaman 1dari 22

# Andri Rahmadhani Department of Physics ITB KAIST Internship Program Summer 2012

## Basic Theory Method & Algorithm Results References

What is random walk? Algorithm that represents trajectory of random steps The direction of random walk cannot be predicted from the past actions.

## Example : Time-Series Graph (1-D)

Figure 2. Time-Series random walk with N (steps) = 1000 and equal probability 0.5

## The mathematics of 1-D Random Walk

Sum/Position after n steps: = Expected Value:
= 1 1 + 2 2 + 3 3 + + = = 0 =1 2 = 2 = =1
=1

; 0 = 0

## The mathematics of 2-D Random Walk

Sum/Position after n steps: = Absolute Value:
+
2

; =1

0 = 0
=

Expected Value:

2

=1 =1 ,=1

=1

=1

= +

,=1

## 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 moves 3) Repeat step 2 for n times which already set up in step 1 4) Plot sample graph 5) Calculate mean/expectation value 6) Increase number of steps and repeat step 2 until reaching maximum number of steps 7) Plot distance graph and print the results

## Random Walk in 1-D

3.5 Distance Curve Fitting N1/2

2
3

0
Distance <|Sn|>
2.5

Value

-2

-4

-6

1.5

-8

1 1 trial
st

2 2

3
nd

4
rd

6 8 trial
th

7 9 trial
th

9 10 trial
th

10

trial

10

15

## Random Walk in 1-D

14 Distance Curve Fitting N1/2 12

10

10

Distance <|Sn|>

Value

-5
4

-10
2

-15

10 1st trial

20

30 2nd trial

40

## 50 Steps (N) 3rd trial

60 8th trial

70

80 9th trial

90 10th trial

100
0 0 10 20 30 40 50 60 Number of steps (N) 70 80 90 100

## Random Walk in 1-D

3.5 Distance Curve Fitting N1/2

2
3

0
Distance <|Sn|>
2.5

-1
Value

-2

-3

-4
1.5

-5

-6

0
st

1 1 trial

2 2
nd

3 trial

4 3 trial
rd

5 Steps (N)
th

7
th

8 9999 trial

9
th

10

10

9998 trial

10000 trial

## Random Walk in 1-D

11 Distance 10 Curve Fitting N1/2

Distance <|Sn|>

-5
Value

-10

-15

-20

10 1 trial
st

20 2
nd

30 trial

40 3 trial
rd

50 Steps (N)

60
th

70
th

80 9999 trial

90
th

100

10

20

30

## 40 50 60 Number of steps (N)

70

80

90

100

9998 trial

10000 trial

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

## Random Walk in 1-D

Curve Fitting : = +
Table 1. Curve fitting property for = +

## Random Walk in 2-D

4 Distance Curve Fitting N1/2 3.5

0.5

0
Distance <|Sn|>

-0.5

2.5

-1

-1.5

1.5

-2 -4 1 trial
st

-3

-2 End 2

-1
nd

0 x End

1 9 trial
th

2 End

4 10 trial
th

5 End

10

trial

15

## Random Walk in 2-D

14 Distance Curve Fitting N1/2 12

10

10

5
Distance <|Sn|>

-5
4

-10
2

st

-5 End 2
nd

0 x trial End

5 9 trial
th

10 End 10 trial
th

15 End

10

20

30

70

80

90

100

## Random Walk in 2-D

3.5 Distance Curve Fitting N1/2

3
2

-1

Distance <|Sn|>
-1.5 End -1 -0.5 2nd trial 0 End 0.5 x 1 9999th trial 1.5 End 2 2.5 10000th trial 3 End

2.5

-2

-3

1.5

-4 -2 1st trial

## 5 6 Number of steps (N)

10

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

20

## Random Walk in 2-D

12 Distance Curve Fitting N1/2

15

10

10
8
Distance <|Sn|>

0
4

-5
2

-4 End

## -2 2nd trial End

0 x 9999th trial

2 End

4 10000th trial

6 End
0 0 10 20 30 40 50 60 Number of steps (N) 70 80 90 100

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

## Random Walk in 2-D

Curve Fitting : = +
Table 2. Curve fitting property for = +

## 100 steps 10000 trials 1 -0.002094 0.9998

R2 0.8919

Root-mean-square of random walk final position or the distance is equal with rootsquare of number of random walk steps. Valid for large number of random walks trials and equal probability.

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, 281298, 1940.

End of slide