Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. s = 100;
  2. i = 0.5;
  3. f = 0.05;
  4. nStep = 100;
  5. sim := NestList[If[RandomReal[] < f, # - i, # - i + 1000 #] &, s,
  6. nStep];
  7.  
  8. runs = Table[sim, {r, 100}];
  9. ListPlot[runs, Joined -> True, PlotRange -> All]
  10.  
  11. ListPlot[Mean @ runs, Joined -> True, PlotRange -> All]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement