Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s = 100;
- i = 0.5;
- f = 0.05;
- nStep = 100;
- sim := NestList[If[RandomReal[] < f, # - i, # - i + 1000 #] &, s,
- nStep];
- runs = Table[sim, {r, 100}];
- ListPlot[runs, Joined -> True, PlotRange -> All]
- ListPlot[Mean @ runs, Joined -> True, PlotRange -> All]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement