Random Walks in the Plane

Random Walks in the Plane
Loading the math board and drawing, please wait…
2014-08-19 02:23
This example demonstrates a random walk in a 2D plane where each step is randomly chosen from North, South, East, or West with equal 25% probability. After 12 moves, the path and final position are visualized. Key math concepts include Probability & Statistics, Coordinate Geometry, Vectors, Sequences, and Discrete Random Processes. GeoGebra commands like Random, If, Segment, DotPlot, and PolyLine are used to construct the simulation, plotting the path and final distribution. Suitable for high school and above to explore random processes and data analysis.

GeoGebra Commands & Parameters

  1. Random(1, 4) → B1
  2. Random(1, 4) → B2
  3. Random(1, 4) → B3
  4. Random(1, 4) → B4
  5. Random(1, 4) → B5
  6. Random(1, 4) → B6
  7. Random(1, 4) → B7
  8. Random(1, 4) → B8
  9. Random(1, 4) → B9
  10. Random(1, 4) → B10
  11. Random(1, 4) → B11
  12. Random(1, 4) → B12
  13. If(B1 ≟ 1, A1 + (1, 0), If[B1 ≟ 2, A1 + (0, 1), If[B1 ≟ 3, A1 + (-1, 0), A1 + (0, -1)]]) → A2
  14. If(B2 ≟ 1, A2 + (1, 0), If[B2 ≟ 2, A2 + (0, 1), If[B2 ≟ 3, A2 + (-1, 0), A2 + (0, -1)]]) → A3
  15. If(B3 ≟ 1, A3 + (1, 0), If[B3 ≟ 2, A3 + (0, 1), If[B3 ≟ 3, A3 + (-1, 0), A3 + (0, -1)]]) → A4
  16. If(B4 ≟ 1, A4 + (1, 0), If[B4 ≟ 2, A4 + (0, 1), If[B4 ≟ 3, A4 + (-1, 0), A4 + (0, -1)]]) → A5
  17. If(B5 ≟ 1, A5 + (1, 0), If[B5 ≟ 2, A5 + (0, 1), If[B5 ≟ 3, A5 + (-1, 0), A5 + (0, -1)]]) → A6
  18. If(B6 ≟ 1, A6 + (1, 0), If[B6 ≟ 2, A6 + (0, 1), If[B6 ≟ 3, A6 + (-1, 0), A6 + (0, -1)]]) → A7
  19. If(B7 ≟ 1, A7 + (1, 0), If[B7 ≟ 2, A7 + (0, 1), If[B7 ≟ 3, A7 + (-1, 0), A7 + (0, -1)]]) → A8
  20. If(B8 ≟ 1, A8 + (1, 0), If[B8 ≟ 2, A8 + (0, 1), If[B8 ≟ 3, A8 + (-1, 0), A8 + (0, -1)]]) → A9
  21. If(B9 ≟ 1, A9 + (1, 0), If[B9 ≟ 2, A9 + (0, 1), If[B9 ≟ 3, A9 + (-1, 0), A9 + (0, -1)]]) → A10
  22. If(B10 ≟ 1, A10 + (1, 0), If[B10 ≟ 2, A10 + (0, 1), If[B10 ≟ 3, A10 + (-1, 0), A10 + (0, -1)]]) → A11
  23. If(B11 ≟ 1, A11 + (1, 0), If[B11 ≟ 2, A11 + (0, 1), If[B11 ≟ 3, A11 + (-1, 0), A11 + (0, -1)]]) → A12
  24. If(B12 ≟ 1, A12 + (1, 0), If[B12 ≟ 2, A12 + (0, 1), If[B12 ≟ 3, A12 + (-1, 0), A12 + (0, -1)]]) → A13
  25. Segment(A1, A13) → a
  26. If(B1 ≟ 1, "E", If[B1 ≟ 2, "N", If[B1 ≟ 3, "W", "S"]]) → C1
  27. If(B2 ≟ 1, "E", If[B2 ≟ 2, "N", If[B2 ≟ 3, "W", "S"]]) → C2
  28. If(B3 ≟ 1, "E", If[B3 ≟ 2, "N", If[B3 ≟ 3, "W", "S"]]) → C3
  29. If(B4 ≟ 1, "E", If[B4 ≟ 2, "N", If[B4 ≟ 3, "W", "S"]]) → C4
  30. If(B5 ≟ 1, "E", If[B5 ≟ 2, "N", If[B5 ≟ 3, "W", "S"]]) → C5
  31. If(B6 ≟ 1, "E", If[B6 ≟ 2, "N", If[B6 ≟ 3, "W", "S"]]) → C6
  32. If(B7 ≟ 1, "E", If[B7 ≟ 2, "N", If[B7 ≟ 3, "W", "S"]]) → C7
  33. If(B8 ≟ 1, "E", If[B8 ≟ 2, "N", If[B8 ≟ 3, "W", "S"]]) → C8
  34. If(B9 ≟ 1, "E", If[B9 ≟ 2, "N", If[B9 ≟ 3, "W", "S"]]) → C9
  35. If(B10 ≟ 1, "E", If[B10 ≟ 2, "N", If[B10 ≟ 3, "W", "S"]]) → C10
  36. If(B11 ≟ 1, "E", If[B11 ≟ 2, "N", If[B11 ≟ 3, "W", "S"]]) → C11
  37. If(B12 ≟ 1, "E", If[B12 ≟ 2, "N", If[B12 ≟ 3, "W", "S"]]) → C12
  38. DotPlot(data) → list1
  39. PolyLine(A1, A2, A11, A12, A13, A3, A4, A5, A6, A7, A8, A9, A10) → c

AI Drawing Prompt Reference

Draw a random walk path in a 2D plane starting at the origin, moving randomly north, south, east, or west 12 times in total, connecting each endpoint with line segments to show the entire path, and use a dot plot to indicate the direction of each move (E, S, W, N), marking the final position with a point.
The prompt above was compiled from the original drawing commands and is for reference only.