<![CDATA[How can I generate a random walk?]]>
https://help.geogebra.org/topic/how-can-i-generate-a-random-walk
Tue, 01 Oct 2019 21:41:24 +0000Tue, 01 Oct 2019 12:49:53 +0000Zend_Feed<![CDATA[N=100
Jumps = Sequence(RandomElement({-1, 1}), i, 1, N)
l1=Sequence(Sum(First(Jumps, i)), i, 1, N)
DataFunction(Sequence(N), l1)]]>
https://help.geogebra.org/topic/how-can-i-generate-a-random-walk#comment-268698
Tue, 01 Oct 2019 13:05:04 +0000<![CDATA[Thank you. Very helpful. It's not 100% what I would like, as there are two problems: 1. I would prefer the function to be a stepwise function, not triangular (that's why I used "ceil" in my formula). 2. Your code to compute l1 will be inefficient for large N. How can we compute l1 by running through the Jumps list only once?]]>
https://help.geogebra.org/topic/how-can-i-generate-a-random-walk#comment-268700
Tue, 01 Oct 2019 13:21:10 +0000<![CDATA[Here your points 1 and 2 will be met. The performance is low (I suspect, on the basis of the requirement in point 1.). Possibly a BarChart() diagramm or a Polyline() is more performant.]]>
https://help.geogebra.org/topic/how-can-i-generate-a-random-walk#comment-268716
Tue, 01 Oct 2019 18:12:04 +0000<![CDATA[Ok, thank you to Michael and rami. IterationList!]]>
https://help.geogebra.org/topic/how-can-i-generate-a-random-walk#comment-268718
Tue, 01 Oct 2019 18:09:33 +0000<![CDATA[If you combine IterationList() with this then I think that will be a bit faster (you also need an UpdateConstruction() in the slider's On Update script if you want it to be dynamic) DataFunction(Sequence(N), l1)g(x) = f(round(x))]]>
https://help.geogebra.org/topic/how-can-i-generate-a-random-walk#comment-268724
Tue, 01 Oct 2019 21:41:24 +0000