Wolfram Language

Open live version

Plot a Random Walk

Make a plot of a random walk. This example appears in Stephen Wolframs video Introduction to the Wolfram Language.


code

X

how it works

RandomReal[{-1,1},1000] gives a list of 1000 random numbers uniformly distributed between -1 and 1, Accumulate gives the successive accumulated totals of the random numbers, and ListLinePlot plots the resulting list of values with a line.

In[1]:=
X
Out[1]=