Random Walks in Polygons

Random Walks in Polygons
Loading the math board and drawing, please wait…
2017-01-24 07:16
This example demonstrates the dynamic process and trajectory of random walks within polygonal boundaries. It involves core mathematical concepts such as stochastic processes, probability & statistics, coordinate geometry calculations, and polygonal geometric properties. The construction utilizes GeoGebra commands like Polygon, RemoveUndefined, RandomElement, If, and Segment, along with objects like segments and coordinates. Suitable for high school and above, it helps visualize and simulate random processes in geometric spaces.

GeoGebra Commands & Parameters

  1. Polygon(A, B, n) → poly1, f, q, I, J, K, L, M, N, O, P, g, h, i, j, k, l, m, p
  2. RemoveUndefined(list2) → list3
  3. RandomElement(list3) → C1
  4. RandomElement(list3) → C99
  5. RandomElement(list3) → C98
  6. RandomElement(list3) → C97
  7. RandomElement(list3) → C96
  8. RandomElement(list3) → C95
  9. RandomElement(list3) → C94
  10. RandomElement(list3) → C93
  11. RandomElement(list3) → C92
  12. RandomElement(list3) → C91
  13. RandomElement(list3) → C90
  14. RandomElement(list3) → C89
  15. RandomElement(list3) → C88
  16. RandomElement(list3) → C87
  17. RandomElement(list3) → C86
  18. RandomElement(list3) → C85
  19. RandomElement(list3) → C84
  20. RandomElement(list3) → C83
  21. RandomElement(list3) → C82
  22. RandomElement(list3) → C81
  23. RandomElement(list3) → C80
  24. RandomElement(list3) → C79
  25. RandomElement(list3) → C78
  26. RandomElement(list3) → C77
  27. RandomElement(list3) → C76
  28. RandomElement(list3) → C75
  29. RandomElement(list3) → C74
  30. RandomElement(list3) → C73
  31. RandomElement(list3) → C72
  32. RandomElement(list3) → C71
  33. RandomElement(list3) → C70
  34. RandomElement(list3) → C69
  35. RandomElement(list3) → C68
  36. RandomElement(list3) → C67
  37. RandomElement(list3) → C66
  38. RandomElement(list3) → C65
  39. RandomElement(list3) → C64
  40. RandomElement(list3) → C63
  41. RandomElement(list3) → C62
  42. RandomElement(list3) → C61
  43. RandomElement(list3) → C60
  44. RandomElement(list3) → C59
  45. RandomElement(list3) → C58
  46. RandomElement(list3) → C57
  47. RandomElement(list3) → C56
  48. RandomElement(list3) → C55
  49. RandomElement(list3) → C54
  50. RandomElement(list3) → C53
  51. RandomElement(list3) → C52
  52. RandomElement(list3) → C51
  53. RandomElement(list3) → C50
  54. RandomElement(list3) → C49
  55. RandomElement(list3) → C48
  56. RandomElement(list3) → C47
  57. RandomElement(list3) → C46
  58. RandomElement(list3) → C45
  59. RandomElement(list3) → C44
  60. RandomElement(list3) → C43
  61. RandomElement(list3) → C42
  62. RandomElement(list3) → C41
  63. RandomElement(list3) → C40
  64. RandomElement(list3) → C39
  65. RandomElement(list3) → C38
  66. RandomElement(list3) → C37
  67. RandomElement(list3) → C36
  68. RandomElement(list3) → C35
  69. RandomElement(list3) → C34
  70. RandomElement(list3) → C33
  71. RandomElement(list3) → C32
  72. RandomElement(list3) → C31
  73. RandomElement(list3) → C30
  74. RandomElement(list3) → C29
  75. RandomElement(list3) → C28
  76. RandomElement(list3) → C27
  77. RandomElement(list3) → C26
  78. RandomElement(list3) → C25
  79. RandomElement(list3) → C24
  80. RandomElement(list3) → C23
  81. RandomElement(list3) → C22
  82. RandomElement(list3) → C21
  83. RandomElement(list3) → C20
  84. RandomElement(list3) → C19
  85. RandomElement(list3) → C18
  86. RandomElement(list3) → C17
  87. RandomElement(list3) → C16
  88. RandomElement(list3) → C15
  89. RandomElement(list3) → C14
  90. RandomElement(list3) → C13
  91. RandomElement(list3) → C12
  92. RandomElement(list3) → C11
  93. RandomElement(list3) → C10
  94. RandomElement(list3) → C9
  95. RandomElement(list3) → C8
  96. RandomElement(list3) → C7
  97. RandomElement(list3) → C6
  98. RandomElement(list3) → C5
  99. RandomElement(list3) → C4
  100. RandomElement(list3) → C3
  101. If(nn ≥ A2, Translate[B1, Vector[B1, C1] / Length[Vector[B1, C1]]]) → B2
  102. RandomElement(list3) → C2
  103. If(nn ≥ A3, Translate[B2, Vector[B2, C2] / Length[Vector[B2, C2]]]) → B3
  104. If(nn ≥ A4, Translate[B3, Vector[B3, C3] / Length[Vector[B3, C3]]]) → B4
  105. If(nn ≥ A5, Translate[B4, Vector[B4, C4] / Length[Vector[B4, C4]]]) → B5
  106. If(nn ≥ A6, Translate[B5, Vector[B5, C5] / Length[Vector[B5, C5]]]) → B6
  107. If(nn ≥ A7, Translate[B6, Vector[B6, C6] / Length[Vector[B6, C6]]]) → B7
  108. If(nn ≥ A8, Translate[B7, Vector[B7, C7] / Length[Vector[B7, C7]]]) → B8
  109. If(nn ≥ A9, Translate[B8, Vector[B8, C8] / Length[Vector[B8, C8]]]) → B9
  110. If(nn ≥ A10, Translate[B9, Vector[B9, C9] / Length[Vector[B9, C9]]]) → B10
  111. If(nn ≥ A11, Translate[B10, Vector[B10, C10] / Length[Vector[B10, C10]]]) → B11
  112. If(nn ≥ A12, Translate[B11, Vector[B11, C11] / Length[Vector[B11, C11]]]) → B12
  113. If(nn ≥ A13, Translate[B12, Vector[B12, C12] / Length[Vector[B12, C12]]]) → B13
  114. If(nn ≥ A14, Translate[B13, Vector[B13, C13] / Length[Vector[B13, C13]]]) → B14
  115. If(nn ≥ A15, Translate[B14, Vector[B14, C14] / Length[Vector[B14, C14]]]) → B15
  116. If(nn ≥ A16, Translate[B15, Vector[B15, C15] / Length[Vector[B15, C15]]]) → B16
  117. If(nn ≥ A17, Translate[B16, Vector[B16, C16] / Length[Vector[B16, C16]]]) → B17
  118. If(nn ≥ A18, Translate[B17, Vector[B17, C17] / Length[Vector[B17, C17]]]) → B18
  119. If(nn ≥ A19, Translate[B18, Vector[B18, C18] / Length[Vector[B18, C18]]]) → B19
  120. If(nn ≥ A20, Translate[B19, Vector[B19, C19] / Length[Vector[B19, C19]]]) → B20
  121. If(nn ≥ A21, Translate[B20, Vector[B20, C20] / Length[Vector[B20, C20]]]) → B21
  122. If(nn ≥ A22, Translate[B21, Vector[B21, C21] / Length[Vector[B21, C21]]]) → B22
  123. If(nn ≥ A23, Translate[B22, Vector[B22, C22] / Length[Vector[B22, C22]]]) → B23
  124. If(nn ≥ A24, Translate[B23, Vector[B23, C23] / Length[Vector[B23, C23]]]) → B24
  125. If(nn ≥ A25, Translate[B24, Vector[B24, C24] / Length[Vector[B24, C24]]]) → B25
  126. If(nn ≥ A26, Translate[B25, Vector[B25, C25] / Length[Vector[B25, C25]]]) → B26
  127. If(nn ≥ A27, Translate[B26, Vector[B26, C26] / Length[Vector[B26, C26]]]) → B27
  128. If(nn ≥ A28, Translate[B27, Vector[B27, C27] / Length[Vector[B27, C27]]]) → B28
  129. If(nn ≥ A29, Translate[B28, Vector[B28, C28] / Length[Vector[B28, C28]]]) → B29
  130. If(nn ≥ A30, Translate[B29, Vector[B29, C29] / Length[Vector[B29, C29]]]) → B30
  131. If(nn ≥ A31, Translate[B30, Vector[B30, C30] / Length[Vector[B30, C30]]]) → B31
  132. If(nn ≥ A32, Translate[B31, Vector[B31, C31] / Length[Vector[B31, C31]]]) → B32
  133. If(nn ≥ A33, Translate[B32, Vector[B32, C32] / Length[Vector[B32, C32]]]) → B33
  134. If(nn ≥ A34, Translate[B33, Vector[B33, C33] / Length[Vector[B33, C33]]]) → B34
  135. If(nn ≥ A35, Translate[B34, Vector[B34, C34] / Length[Vector[B34, C34]]]) → B35
  136. If(nn ≥ A36, Translate[B35, Vector[B35, C35] / Length[Vector[B35, C35]]]) → B36
  137. If(nn ≥ A37, Translate[B36, Vector[B36, C36] / Length[Vector[B36, C36]]]) → B37
  138. If(nn ≥ A38, Translate[B37, Vector[B37, C37] / Length[Vector[B37, C37]]]) → B38
  139. If(nn ≥ A39, Translate[B38, Vector[B38, C38] / Length[Vector[B38, C38]]]) → B39
  140. If(nn ≥ A40, Translate[B39, Vector[B39, C39] / Length[Vector[B39, C39]]]) → B40
  141. If(nn ≥ A41, Translate[B40, Vector[B40, C40] / Length[Vector[B40, C40]]]) → B41
  142. If(nn ≥ A42, Translate[B41, Vector[B41, C41] / Length[Vector[B41, C41]]]) → B42
  143. If(nn ≥ A43, Translate[B42, Vector[B42, C42] / Length[Vector[B42, C42]]]) → B43
  144. If(nn ≥ A44, Translate[B43, Vector[B43, C43] / Length[Vector[B43, C43]]]) → B44
  145. If(nn ≥ A45, Translate[B44, Vector[B44, C44] / Length[Vector[B44, C44]]]) → B45
  146. If(nn ≥ A46, Translate[B45, Vector[B45, C45] / Length[Vector[B45, C45]]]) → B46
  147. If(nn ≥ A47, Translate[B46, Vector[B46, C46] / Length[Vector[B46, C46]]]) → B47
  148. If(nn ≥ A48, Translate[B47, Vector[B47, C47] / Length[Vector[B47, C47]]]) → B48
  149. If(nn ≥ A49, Translate[B48, Vector[B48, C48] / Length[Vector[B48, C48]]]) → B49
  150. If(nn ≥ A50, Translate[B49, Vector[B49, C49] / Length[Vector[B49, C49]]]) → B50
  151. If(nn ≥ A51, Translate[B50, Vector[B50, C50] / Length[Vector[B50, C50]]]) → B51
  152. If(nn ≥ A52, Translate[B51, Vector[B51, C51] / Length[Vector[B51, C51]]]) → B52
  153. If(nn ≥ A53, Translate[B52, Vector[B52, C52] / Length[Vector[B52, C52]]]) → B53
  154. If(nn ≥ A54, Translate[B53, Vector[B53, C53] / Length[Vector[B53, C53]]]) → B54
  155. If(nn ≥ A55, Translate[B54, Vector[B54, C54] / Length[Vector[B54, C54]]]) → B55
  156. If(nn ≥ A56, Translate[B55, Vector[B55, C55] / Length[Vector[B55, C55]]]) → B56
  157. If(nn ≥ A57, Translate[B56, Vector[B56, C56] / Length[Vector[B56, C56]]]) → B57
  158. If(nn ≥ A58, Translate[B57, Vector[B57, C57] / Length[Vector[B57, C57]]]) → B58
  159. If(nn ≥ A59, Translate[B58, Vector[B58, C58] / Length[Vector[B58, C58]]]) → B59
  160. If(nn ≥ A60, Translate[B59, Vector[B59, C59] / Length[Vector[B59, C59]]]) → B60
  161. If(nn ≥ A61, Translate[B60, Vector[B60, C60] / Length[Vector[B60, C60]]]) → B61
  162. If(nn ≥ A62, Translate[B61, Vector[B61, C61] / Length[Vector[B61, C61]]]) → B62
  163. If(nn ≥ A63, Translate[B62, Vector[B62, C62] / Length[Vector[B62, C62]]]) → B63
  164. If(nn ≥ A64, Translate[B63, Vector[B63, C63] / Length[Vector[B63, C63]]]) → B64
  165. If(nn ≥ A65, Translate[B64, Vector[B64, C64] / Length[Vector[B64, C64]]]) → B65
  166. If(nn ≥ A66, Translate[B65, Vector[B65, C65] / Length[Vector[B65, C65]]]) → B66
  167. If(nn ≥ A67, Translate[B66, Vector[B66, C66] / Length[Vector[B66, C66]]]) → B67
  168. If(nn ≥ A68, Translate[B67, Vector[B67, C67] / Length[Vector[B67, C67]]]) → B68
  169. If(nn ≥ A69, Translate[B68, Vector[B68, C68] / Length[Vector[B68, C68]]]) → B69
  170. If(nn ≥ A70, Translate[B69, Vector[B69, C69] / Length[Vector[B69, C69]]]) → B70
  171. If(nn ≥ A71, Translate[B70, Vector[B70, C70] / Length[Vector[B70, C70]]]) → B71
  172. If(nn ≥ A72, Translate[B71, Vector[B71, C71] / Length[Vector[B71, C71]]]) → B72
  173. If(nn ≥ A73, Translate[B72, Vector[B72, C72] / Length[Vector[B72, C72]]]) → B73
  174. If(nn ≥ A74, Translate[B73, Vector[B73, C73] / Length[Vector[B73, C73]]]) → B74
  175. If(nn ≥ A75, Translate[B74, Vector[B74, C74] / Length[Vector[B74, C74]]]) → B75
  176. If(nn ≥ A76, Translate[B75, Vector[B75, C75] / Length[Vector[B75, C75]]]) → B76
  177. If(nn ≥ A77, Translate[B76, Vector[B76, C76] / Length[Vector[B76, C76]]]) → B77
  178. If(nn ≥ A78, Translate[B77, Vector[B77, C77] / Length[Vector[B77, C77]]]) → B78
  179. If(nn ≥ A79, Translate[B78, Vector[B78, C78] / Length[Vector[B78, C78]]]) → B79
  180. If(nn ≥ A80, Translate[B79, Vector[B79, C79] / Length[Vector[B79, C79]]]) → B80
  181. If(nn ≥ A81, Translate[B80, Vector[B80, C80] / Length[Vector[B80, C80]]]) → B81
  182. If(nn ≥ A82, Translate[B81, Vector[B81, C81] / Length[Vector[B81, C81]]]) → B82
  183. If(nn ≥ A83, Translate[B82, Vector[B82, C82] / Length[Vector[B82, C82]]]) → B83
  184. If(nn ≥ A84, Translate[B83, Vector[B83, C83] / Length[Vector[B83, C83]]]) → B84
  185. If(nn ≥ A85, Translate[B84, Vector[B84, C84] / Length[Vector[B84, C84]]]) → B85
  186. If(nn ≥ A86, Translate[B85, Vector[B85, C85] / Length[Vector[B85, C85]]]) → B86
  187. If(nn ≥ A87, Translate[B86, Vector[B86, C86] / Length[Vector[B86, C86]]]) → B87
  188. If(nn ≥ A88, Translate[B87, Vector[B87, C87] / Length[Vector[B87, C87]]]) → B88
  189. If(nn ≥ A89, Translate[B88, Vector[B88, C88] / Length[Vector[B88, C88]]]) → B89
  190. If(nn ≥ A90, Translate[B89, Vector[B89, C89] / Length[Vector[B89, C89]]]) → B90
  191. If(nn ≥ A91, Translate[B90, Vector[B90, C90] / Length[Vector[B90, C90]]]) → B91
  192. If(nn ≥ A92, Translate[B91, Vector[B91, C91] / Length[Vector[B91, C91]]]) → B92
  193. If(nn ≥ A93, Translate[B92, Vector[B92, C92] / Length[Vector[B92, C92]]]) → B93
  194. If(nn ≥ A94, Translate[B93, Vector[B93, C93] / Length[Vector[B93, C93]]]) → B94
  195. If(nn ≥ A95, Translate[B94, Vector[B94, C94] / Length[Vector[B94, C94]]]) → B95
  196. If(nn ≥ A96, Translate[B95, Vector[B95, C95] / Length[Vector[B95, C95]]]) → B96
  197. If(nn ≥ A97, Translate[B96, Vector[B96, C96] / Length[Vector[B96, C96]]]) → B97
  198. If(nn ≥ A98, Translate[B97, Vector[B97, C97] / Length[Vector[B97, C97]]]) → B98
  199. If(nn ≥ A99, Translate[B98, Vector[B98, C98] / Length[Vector[B98, C98]]]) → B99
  200. Segment(B1, B2) → D1
  201. Segment(B2, B3) → D2
  202. Segment(B3, B4) → D3
  203. Segment(B4, B5) → D4
  204. Segment(B5, B6) → D5
  205. Segment(B6, B7) → D6
  206. Segment(B7, B8) → D7
  207. Segment(B8, B9) → D8
  208. Segment(B9, B10) → D9
  209. Segment(B10, B11) → D10
  210. Segment(B11, B12) → D11
  211. Segment(B12, B13) → D12
  212. Segment(B13, B14) → D13
  213. Segment(B14, B15) → D14
  214. Segment(B15, B16) → D15
  215. Segment(B16, B17) → D16
  216. Segment(B17, B18) → D17
  217. Segment(B18, B19) → D18
  218. Segment(B19, B20) → D19
  219. Segment(B20, B21) → D20
  220. Segment(B21, B22) → D21
  221. Segment(B22, B23) → D22
  222. Segment(B23, B24) → D23
  223. Segment(B24, B25) → D24
  224. Segment(B25, B26) → D25
  225. Segment(B26, B27) → D26
  226. Segment(B27, B28) → D27
  227. Segment(B28, B29) → D28
  228. Segment(B29, B30) → D29
  229. Segment(B30, B31) → D30
  230. Segment(B31, B32) → D31
  231. Segment(B32, B33) → D32
  232. Segment(B33, B34) → D33
  233. Segment(B34, B35) → D34
  234. Segment(B35, B36) → D35
  235. Segment(B36, B37) → D36
  236. Segment(B37, B38) → D37
  237. Segment(B38, B39) → D38
  238. Segment(B39, B40) → D39
  239. Segment(B40, B41) → D40
  240. Segment(B41, B42) → D41
  241. Segment(B42, B43) → D42
  242. Segment(B43, B44) → D43
  243. Segment(B44, B45) → D44
  244. Segment(B45, B46) → D45
  245. Segment(B46, B47) → D46
  246. Segment(B47, B48) → D47
  247. Segment(B48, B49) → D48
  248. Segment(B49, B50) → D49
  249. Segment(B50, B51) → D50
  250. Segment(B51, B52) → D51
  251. Segment(B52, B53) → D52
  252. Segment(B53, B54) → D53
  253. Segment(B54, B55) → D54
  254. Segment(B55, B56) → D55
  255. Segment(B56, B57) → D56
  256. Segment(B57, B58) → D57
  257. Segment(B58, B59) → D58
  258. Segment(B59, B60) → D59
  259. Segment(B60, B61) → D60
  260. Segment(B61, B62) → D61
  261. Segment(B62, B63) → D62
  262. Segment(B63, B64) → D63
  263. Segment(B64, B65) → D64
  264. Segment(B65, B66) → D65
  265. Segment(B66, B67) → D66
  266. Segment(B67, B68) → D67
  267. Segment(B68, B69) → D68
  268. Segment(B69, B70) → D69
  269. Segment(B70, B71) → D70
  270. Segment(B71, B72) → D71
  271. Segment(B72, B73) → D72
  272. Segment(B73, B74) → D73
  273. Segment(B74, B75) → D74
  274. Segment(B75, B76) → D75
  275. Segment(B76, B77) → D76
  276. Segment(B77, B78) → D77
  277. Segment(B78, B79) → D78
  278. Segment(B79, B80) → D79
  279. Segment(B80, B81) → D80
  280. Segment(B81, B82) → D81
  281. Segment(B82, B83) → D82
  282. Segment(B83, B84) → D83
  283. Segment(B84, B85) → D84
  284. Segment(B85, B86) → D85
  285. Segment(B86, B87) → D86
  286. Segment(B87, B88) → D87
  287. Segment(B88, B89) → D88
  288. Segment(B89, B90) → D89
  289. Segment(B90, B91) → D90
  290. Segment(B91, B92) → D91
  291. Segment(B92, B93) → D92
  292. Segment(B93, B94) → D93
  293. Segment(B94, B95) → D94
  294. Segment(B95, B96) → D95
  295. Segment(B96, B97) → D96
  296. Segment(B97, B98) → D97
  297. Segment(B98, B99) → D98
  298. If(nn ≥ A100, Translate[B99, Vector[B99, C99] / Length[Vector[B99, C99]]]) → B100
  299. Segment(B99, B100) → D99
  300. RandomElement(list3) → C100

AI Drawing Prompt Reference

Draw a random walk trajectory inside a polygon, starting from a vertex and moving randomly to adjacent vertices each time, connecting each movement point with a line segment to show the dynamic process of the walk, with clear polygon boundaries and randomly scattered trajectory lines inside the polygon, demonstrating the characteristics of random walks.
The prompt above was compiled from the original drawing commands and is for reference only.