Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- `A = Table[0, {1}, {2}];
- Do[
- x = RandomReal[];
- Which[
- x < 0.25, A[[i + 1, 1]] = A[[i, 1]] + 1;
- x < 0.25, A[[i + 1, 2]] = A[[i, 2]] - 1],
- {i, 1, 0}, {i, 1, 1}]
- ListLinePlot[A]`
- ListLinePlot[Accumulate@RandomChoice[{{1, 0}, {-1, 0}, {0, 1}, {0, -1}}, 500]]
Add Comment
Please, Sign In to add comment