Skip to main content
added 672 characters in body
Source Link
thils
  • 3.3k
  • 2
  • 19
  • 36

To make sure all the walks start at {0}, you could use

Li[n_] := 2*RandomVariate[BinomialDistribution[n, 1/2], n] - n; Tb[n_, m_] := Table[Join[{0}, Li[n]], {i, 1, m}]; ListPlot[Tb[10, 5], Joined -> True] 

enter image description here

Then the average distance for 1 run is calc using

 Ave[n_] := Abs[Total[Flatten[Tb[n, 1], 1]]]/n N[Ave[1000]] (* 0.891*) 

You can repeat the process for m runs as well. The output is highly sensitive to the parameter (1/2 in this case) which appears in the BionomialDistribution

Regarding the remark about the mean, I don't see it going to zero. Try

Li[n_, p_] := 2*RandomVariate[BinomialDistribution[n, p], n] - n; Tb[n_, p_, m_] := Table[Join[{0}, Li[n, p]], {i, 1, m}]; Ave[n_, p_] := Abs[Total[Flatten[Tb[n, p, 1], 1]]]/n Aver[n_, p_, m_] := N[Sum[Ave[n, p]/m, {i, 1, m}]] Manipulate[ Aver[n, p, m], {n, {100, 500, 1000}}, {p, 0.1, 1}, {m, {100, 200, 300}}] 

enter image description here

For p=1/2, you get average < 1, for p values that deviate from 1/2, the average explodes. Unless of course, you have used some other relation for the mean.

To make sure all the walks start at {0}, you could use

Li[n_] := 2*RandomVariate[BinomialDistribution[n, 1/2], n] - n; Tb[n_, m_] := Table[Join[{0}, Li[n]], {i, 1, m}]; ListPlot[Tb[10, 5], Joined -> True] 

enter image description here

Then the average distance for 1 run is calc using

 Ave[n_] := Abs[Total[Flatten[Tb[n, 1], 1]]]/n N[Ave[1000]] (* 0.891*) 

You can repeat the process for m runs as well. The output is highly sensitive to the parameter (1/2 in this case) which appears in the BionomialDistribution

To make sure all the walks start at {0}, you could use

Li[n_] := 2*RandomVariate[BinomialDistribution[n, 1/2], n] - n; Tb[n_, m_] := Table[Join[{0}, Li[n]], {i, 1, m}]; ListPlot[Tb[10, 5], Joined -> True] 

enter image description here

Then the average distance for 1 run is calc using

 Ave[n_] := Abs[Total[Flatten[Tb[n, 1], 1]]]/n N[Ave[1000]] (* 0.891*) 

You can repeat the process for m runs as well. The output is highly sensitive to the parameter (1/2 in this case) which appears in the BionomialDistribution

Regarding the remark about the mean, I don't see it going to zero. Try

Li[n_, p_] := 2*RandomVariate[BinomialDistribution[n, p], n] - n; Tb[n_, p_, m_] := Table[Join[{0}, Li[n, p]], {i, 1, m}]; Ave[n_, p_] := Abs[Total[Flatten[Tb[n, p, 1], 1]]]/n Aver[n_, p_, m_] := N[Sum[Ave[n, p]/m, {i, 1, m}]] Manipulate[ Aver[n, p, m], {n, {100, 500, 1000}}, {p, 0.1, 1}, {m, {100, 200, 300}}] 

enter image description here

For p=1/2, you get average < 1, for p values that deviate from 1/2, the average explodes. Unless of course, you have used some other relation for the mean.

added 318 characters in body
Source Link
thils
  • 3.3k
  • 2
  • 19
  • 36

To make sure all the walks start at {0}, you could use

Li[n_] := 2*RandomVariate[BinomialDistribution[n, 1/2], n] - n; Tb[n_, m_] := Table[Join[{0}, Li[n]], {i, 1, m}]; ListPlot[Tb[10, 5], Joined -> True] 

enter image description here

Then the average distance for 1 run is calc using

 Ave[n_] := Abs[Total[Flatten[Tb[n, 1], 1]]]/n N[Ave[1000]] (* 0.891*) 

You can repeat the process for m runs as well. The output is highly sensitive to the parameter (1/2 in this case) which appears in the BionomialDistribution

To make sure all the walks start at {0}, you could use

Li[n_] := 2*RandomVariate[BinomialDistribution[n, 1/2], n] - n; Tb[n_, m_] := Table[Join[{0}, Li[n]], {i, 1, m}]; ListPlot[Tb[10, 5], Joined -> True] 

enter image description here

To make sure all the walks start at {0}, you could use

Li[n_] := 2*RandomVariate[BinomialDistribution[n, 1/2], n] - n; Tb[n_, m_] := Table[Join[{0}, Li[n]], {i, 1, m}]; ListPlot[Tb[10, 5], Joined -> True] 

enter image description here

Then the average distance for 1 run is calc using

 Ave[n_] := Abs[Total[Flatten[Tb[n, 1], 1]]]/n N[Ave[1000]] (* 0.891*) 

You can repeat the process for m runs as well. The output is highly sensitive to the parameter (1/2 in this case) which appears in the BionomialDistribution

Source Link
thils
  • 3.3k
  • 2
  • 19
  • 36

To make sure all the walks start at {0}, you could use

Li[n_] := 2*RandomVariate[BinomialDistribution[n, 1/2], n] - n; Tb[n_, m_] := Table[Join[{0}, Li[n]], {i, 1, m}]; ListPlot[Tb[10, 5], Joined -> True] 

enter image description here