Customizable Galton Board

Customizable Galton Board
Loading the math board and drawing, please wait…
2020-01-11 16:36
This example demonstrates the operation of a Galton board, illustrating probability distribution and statistical characteristics. Users can adjust parameters to observe ball distribution patterns under different settings. It utilizes commands such as Sequence, Point, Transform, and Vector for construction. Suitable for high school and above students to learn probability and statistics.

GeoGebra Commands & Parameters

  1. Sequence(Sequence[(Reset * 0) + random(), i, 1, n], t, 1, m) → matrix1
  2. Sequence(Sequence[If[Element[Element[matrix1, t], i] < p, 0, 1], i, 1, n], t, 1, m) → matrix2
  3. Join({{(0, 0)}, Sequence[(Element[Element[matrix2, h + 1], i], 1 - Element[Element[matrix2, h + 1], i]), i, 1, n]}) → list3
  4. Sequence(Sum[list3, i], i, 1, n + 1) → list4
  5. Point(Ray[A, A + (1, 0)]) → B
  6. Dilate(Rotate[B, 45°, A], 0.7071067811865475, A) → P
  7. Vector(P, P + (A - P) / n) → u
  8. Vector(P, P + (B - P) / n) → v
  9. Sequence(Segment[P + (i * u), P + (i * u) + ((n - i) * v)], i, 0, n) → list1
  10. Sequence(Segment[P + (i * v), P + (i * v) + ((n - i) * u)], i, 0, n) → list2
  11. Point(Ray[A, A + (0, -1)]) → C
  12. Translate(C, Vector[A, B]) → D
  13. Sequence(Sum[Element[matrix2, i]], i, 0, h) → list6
  14. Sequence(-0.5 + i, i, 0, n + 1) → list7
  15. Frequency(list7, list6) → list8
  16. Sequence(A + (i * (B - A) / n), i, 1, n - 1) → list10
  17. Sequence(C + (i * (D - C) / n), i, 1, n) → list11
  18. Textfield(n) → inputBox1
  19. Sequence(((nCr[n, i] * p^(n - i)) * (1 - p)^(i)), i, 0, n) → list9
  20. Sum(Sequence[Polygon[C + ((((2 * i) - 2.8) * d), 0), C + ((((2 * i) - 1.2) * d), 0), C + ((((2 * i) - 1.2) * d), (Element[list9, i] * floor(abs(y(A) - y(C) - 1) / Max[list9]))), C + ((((2 * i) - 2.8) * d), (Element[list9, i] * floor(abs(y(A) - y(C) - 1) / Max[list9])))], i, 1, n + 1]) → f
  21. Sum(Frequency[list7, Sequence[Sum[Element[matrix2, i]], i, 0, m]]) → g
  22. Sequence(Polygon[C + ((((2 * i) - 2.8) * d), 0), C + ((((2 * i) - 1.2) * d), 0), C + ((((2 * i) - 1.2) * d), ((Element[list8, i] * 5) * f / 8 / g / d)), C + ((((2 * i) - 2.8) * d), ((Element[list8, i] * 5) * f / 8 / g / d))], i, 1, n + 2) → list14
  23. Sequence(PolyLine[C + ((((2 * i) - 2.8) * d), 0), C + ((((2 * i) - 2.8) * d), (Element[list9, i] * floor(abs(y(A) - y(C) - 1) / Max[list9]))), C + ((((2 * i) - 1.2) * d), (Element[list9, i] * floor(abs(y(A) - y(C) - 1) / Max[list9]))), C + ((((2 * i) - 1.2) * d), 0)], i, 1, n + 1) → list13
  24. Sequence(Segment[P + (x(Element[list4, i]) * v) + (y(Element[list4, i]) * u), P + (x(Element[list4, i + 1]) * v) + (y(Element[list4, i + 1]) * u)], i, 1, k) → list5
  25. Segment(C + (-0.8, 0), D + (0.8, 0)) → b
  26. Sequence(A + (i * (B - A) / ((2 * n))), i, 1, (2 * n)) → liste1
  27. Sequence(C + (i * (D - C) / ((2 * n))), i, 1, (2 * n)) → liste2
  28. Sequence(Segment[Element[liste1, i], Element[liste2, i]], i, 1, Length[liste1], 2) → liste3
  29. Segment(E, F) → j
  30. Segment(EE, G) → l
  31. Sequence(C + ((t - 1) * (D - C) / n) + (-0.1, ((5 * f / 8 / g / d) * Element[list8, t]) + 0.05), t, 1, n + 1) → liste4
  32. Sequence(Segment[Element[liste4, i], Element[liste4, i + 1]], i, 1, Length[liste4]) → liste5
  33. Circle(Ball, r) → q
  34. Sequence(Sequence[Translate[H, Vector[(i * u) + (j * v)]], i, 0, n - j - 1], j, 0, n) → liste6
  35. Polygon(I, EE, E, J) → poly1, i_1, ee, e_1, j_1
  36. Segment(L, J) → s
  37. Segment(I, K) → t
  38. Polygon(E, EE, G, F) → poly2, e_2, ee_1, g_1, f_1
  39. Sequence(Circle[Element[liste7, i], r], i, 1, Length[liste7]) → liste8
  40. Sequence(Circle[Element[liste7, i], r], i, 1, Length[liste7]) → liste9
  41. Sequence(Text[Element[list8, t], C + ((t - 1) * (D - C) / n) + (-0.1, ((5 * f / 8 / g / d) * Element[list8, t]) + 0.325)], t, 1, n + 1) → list12

AI Drawing Prompt Reference

Draw a customizable Galton board experiment. At the top, pegs are arranged in a triangular grid. Balls drop from the top, randomly bounce left or right at each peg, and collect into vertical bins at the bottom. Below the bins, show both the theoretical probability distribution curve and the actual frequency histogram for comparison. Include sliders and an input box to adjust the number of balls, peg rows, and bias probability. Display paths of balls as polylines, bars for frequencies, and text labels for counts. The layout is clear for educational demonstration.
The prompt above was compiled from the original drawing commands and is for reference only.