MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Plot Random Walk!

  • To: mathgroup at smc.vnet.net
  • Subject: [mg34389] Re: [mg34388] Plot Random Walk!
  • From: BobHanlon at aol.com
  • Date: Sat, 18 May 2002 03:50:48 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

In a message dated 5/17/02 6:54:29 AM, cigen at hil.de writes:

>With this procedure i plot a randomwalk
>
>RandomWalk[n_]:=NetList[#+(-1)^Random[Integer ])&,0,n]
>
>ListPlot [RandomWalk[200],PlotJoined-->True]
>
>How can i plot for example 100 random walk on the same plot??

Needs["Graphics`MultipleListPlot`"];

RandomWalk[n_]:=
    NestList[(#+(-1)^Random[Integer])&, 0, n];

m=10; n=200;

MultipleListPlot[Table[RandomWalk[n], {m}],
    Frame->True, Axes->False,
    PlotStyle->Table[Hue[k/m], {k, m}],
    PlotJoined->True,
    SymbolShape->None];


Bob Hanlon
Chantilly, VA  USA


  • Prev by Date: Re: Plot Random Walk!
  • Next by Date: Mathematica sessions at SCI 2002 conference
  • Previous by thread: Re: Plot Random Walk!
  • Next by thread: Re: Plot Random Walk!