Length of the Path on a Rectangular Grid

Length of the Path on a Rectangular Grid
Loading the math board and drawing, please wait…
2020-06-06 15:41
This GeoGebra example dynamically demonstrates the calculation of the total length of a randomly generated path on a rectangular grid. The core mathematical concepts include coordinate representation on a grid, piecewise summation of segment lengths, random experiments, and comparison of rational and irrational lengths. The construction uses commands such as Sequence to generate random points, Insert, Join, and Polygon to build the path, and Sum to accumulate segment lengths. Key objects include width, length, list0, and points A1 through A25, with the final length displayed via texte1. This resource is suitable for middle school, high school, or introductory college mathematics, helping students understand path length computation, stochastic simulation, and the integration of geometry and algebra. It also serves as an extension for exploring the Pythagorean theorem in grid contexts.

GeoGebra Commands & Parameters

  1. Sequence(1, i, 1, length + (a * 0)) → list0
  2. Insert(0, A1, Random[1, Length[A1] + 1]) → A2
  3. Insert(0, A2, Random[1, Length[A2 + 1]]) → A3
  4. Insert(0, A3, Random[1, Length[A3 + 1]]) → A4
  5. Insert(0, A4, Random[1, Length[A4 + 1]]) → A5
  6. Insert(0, A5, Random[1, Length[A5 + 1]]) → A6
  7. Insert(0, A6, Random[1, Length[A6 + 1]]) → A7
  8. Insert(0, A7, Random[1, Length[A7 + 1]]) → A8
  9. Insert(0, A8, Random[1, Length[A8 + 1]]) → A9
  10. Insert(0, A9, Random[1, Length[A9 + 1]]) → A10
  11. Insert(0, A10, Random[1, Length[A10 + 1]]) → A11
  12. Insert(0, A11, Random[1, Length[A11 + 1]]) → A12
  13. Insert(0, A12, Random[1, Length[A12 + 1]]) → A13
  14. Insert(0, A13, Random[1, Length[A13 + 1]]) → A14
  15. Insert(0, A14, Random[1, Length[A14 + 1]]) → A15
  16. Insert(0, A15, Random[1, Length[A15 + 1]]) → A16
  17. Insert(0, A16, Random[1, Length[A16 + 1]]) → A17
  18. Insert(0, A17, Random[1, Length[A17 + 1]]) → A18
  19. Insert(0, A18, Random[1, Length[A18 + 1]]) → A19
  20. Insert(0, A19, Random[1, Length[A19 + 1]]) → A20
  21. Insert(0, A20, Random[1, Length[A20 + 1]]) → A21
  22. Insert(0, A21, Random[1, Length[A21 + 1]]) → A22
  23. Insert(0, A22, Random[1, Length[A22 + 1]]) → A23
  24. Insert(0, A23, Random[1, Length[A23 + 1]]) → A24
  25. Insert(0, A24, Random[1, Length[A24 + 1]]) → A25
  26. Element(L_1, width + 1) → list1
  27. Sequence(Sum[Take[list1, 1, i]], i, 1, length + width) → list2
  28. Sequence((0, 0) + (Element[list2, i] * (1, 0)) + ((i - Element[list2, i]) * (0, 1)), i, 1, length + width) → list3
  29. Join({{(0, 0)}, list3}) → list4
  30. Sequence(Vector[Element[list4, i], Element[list4, i + 1]], i, 1, length + width) → list5
  31. Sequence(Segment[(i, 0), (i, width)], i, 0, length) → list6
  32. Sequence(Segment[(0, i), (length, i)], i, 0, width) → list7
  33. Polygon(C, B, D, A) → poly1, c, b_1, d, a_1
  34. Sequence(Segment[Element[list4, i], Element[list4, i + 1]], i, 1, length + width) → liste1
  35. Sum(liste1) → e
  36. Sequence(If[y(Element[list4, i]) ≟ y(Element[list4, i + 1]), Segment[Element[list4, i], Element[list4, i + 1]], 0], i, 1, Length[list4]) → l2
  37. RemoveUndefined(l2) → l1
  38. Sequence(Midpoint[Element[l1, i]], i, 1, Length[l1]) → l3
  39. Sequence((x(Element[l3, i]), 0), i, 1, Length[l3]) → l3b
  40. Sequence(Vector[Element[l3, i], Element[l3b, i]], i, 1, Length[l3]) → l4
  41. Sequence(Translate[Element[l1, i], Vector[(g / 10 * Element[l4, i])]], i, 1, Length[l1]) → l1b
  42. Sequence(If[x(Element[list4, i]) ≟ x(Element[list4, i + 1]), Segment[Element[list4, i], Element[list4, i + 1]], 0], i, 1, Length[list4]) → verti1
  43. RemoveUndefined(verti1) → ver
  44. Sequence(Midpoint[Element[ver, i]], i, 1, Length[ver]) → milver
  45. Sequence((length, y(Element[milver, i])), i, 1, Length[l3]) → verb
  46. Sequence(Vector[Element[milver, i], Element[verb, i]], i, 1, Length[l3]) → l5
  47. Sequence(Translate[Element[ver, i], Vector[(g / 10 * Element[l5, i])]], i, 1, Length[ver]) → l6