Visualizing Independent Identically Distributed Random Variables

Visualizing Independent Identically Distributed Random Variables
Loading the math board and drawing, please wait…
2020-04-13 19:08
This applet dynamically illustrates the concept of independent identically distributed (i.i.d.) random variables. It demonstrates how multiple random samples are drawn from a chosen distribution, how their empirical distributions approximate the theoretical one, and how sample means behave across experiments. Core mathematical concepts include random variables, independence, identical distribution, sample mean, and the law of large numbers. The construction uses GeoGebra commands such as Sequence, RandomUniform, If, Translate, Segment, and IntegralBetween to generate sample data, plot distribution curves, and animate mean trajectories. Interactive elements include a dropdown menu (distributionDropdown) to switch between distributions and sliders (e.g., dpscale) to adjust precision. Suitable for high school and undergraduate probability and statistics courses, this applet helps learners grasp the meaning of i.i.d. assumptions and the variability of sample statistics.

GeoGebra Commands & Parameters

  1. Sequence(If[distribution ≟ 1, RandomNormal[0.5, 0.13], InverseGamma[α, β, RandomUniform[0, 1]]], i, 1, 1000) → datalist3raw
  2. Sequence(If[distribution ≟ 1, RandomNormal[0.5, 0.13], InverseGamma[α, β, RandomUniform[0, 1]]], i, 1, 1000) → datalist2raw
  3. Sequence(If[distribution ≟ 1, RandomNormal[0.5, 0.13], InverseGamma[α, β, RandomUniform[0, 1]]], i, 1, 1000) → datalist1raw
  4. Zip((xx + yy + zz) / 3, xx, datalist1, yy, datalist2, zz, datalist3) → meanlistraw
  5. Element(datalist1, experiment) → x1active
  6. If(distribution ≟ 1, F1, F2) → F
  7. RandomUniform(4.5, F(x1active)) → y1
  8. Element(datalist2, experiment) → x2active
  9. RandomUniform(4.5, F(x2active)) → y2
  10. Element(datalist3, experiment) → x3active
  11. RandomUniform(4.5, F(x3active)) → y3
  12. Element(datalist3, 4) → x43
  13. Element(datalist3, 3) → x33
  14. Element(datalist3, 2) → x23
  15. Element(datalist3, 1) → x13
  16. Element(datalist2, 4) → x42
  17. Element(datalist2, 3) → x32
  18. Element(datalist2, 2) → x22
  19. Element(datalist2, 1) → x12
  20. Element(datalist1, 4) → x41
  21. Element(datalist1, 3) → x31
  22. Element(datalist1, 2) → x21
  23. Element(datalist1, 1) → x11
  24. Element(meanlist, 1) → m1
  25. Element(meanlist, 2) → m2
  26. If(distribution ≟ 1, ((x - 0.5) / 0.13 * 8) + 168, (x * 100)) → scalefunc
  27. If(distribution ≟ 1, "cm", "k") → units
  28. Element({x11dp, x21dp, x31dp, x41dp}, experiment) → x1dpactive
  29. Element({x12dp, x22dp, x32dp, x42dp}, experiment) → x2dpactive
  30. Element({x13dp, x23dp, x33dp, x43dp}, experiment) → x3dpactive
  31. Element(meanlist, 3) → m3
  32. Element(meanlist, 4) → m4
  33. Element({m1dp, m2dp, m3dp, m4dp}, experiment) → mdpactive
  34. Translate(DotPlot[Take[datalist2, 1, experiment], false, 0.006], (0, 2 + dpscale / 2)) → datalist2_{dp}underlayer
  35. Translate(DotPlot[Take[datalist1, 1, experiment], false, 0.006], (0, 3 + dpscale / 2)) → datalist1_{dp}underlayer
  36. Translate(DotPlot[Take[datalist3, 1, experiment], false, 0.006], (0, 1 + dpscale / 2)) → datalist3_{dp}underlayer
  37. Segment((0, 4.5), (1, 4.5)) → a
  38. IntegralBetween(4.5, F, 0, 1, false) → c
  39. Segment((0, 0), (1, 0)) → maxis
  40. If(distribution ≟ 1, "", "\$") → dollars
  41. Translate(F, (0, (-1.5 * t51))) → x1F
  42. Translate(F, (0, (-2.5 * t51))) → x2F
  43. Translate(F, (0, (-3.5 * t51))) → x3F
  44. If(distribution ≟ 1, M1, M2) → M
  45. Segment((0, 4.5), (0, 4.45)) → tick1
  46. Segment((1, 4.5), (1, 4.45)) → tick3
  47. Segment((0.5, 4.5), (0.5, 4.45)) → tick2
  48. Segment((0, 2.99), (1, 2.99)) → x1axis
  49. Segment((0, 1.99), (1, 1.99)) → x2axis
  50. Segment((0, 0.99), (1, 0.99)) → x3axis
  51. Translate(DotPlot[Take[meanlist, 1, experiment], false, 0.006], (0, dpscale / 2)) → Mean_{dp}
  52. Segment((0, 4.5), (0, 0)) → guideline1
  53. Segment((1, 4.5), (1, 0)) → guideline2
  54. Segment((0.5, 4.5), (0.5, 0)) → guideline3

AI Drawing Prompt Reference

Create a probability statistics illustration showing independent identically distributed random variables. Display three horizontal axes, each representing a sample of 1000 points drawn from a chosen distribution (normal or inverse gamma, switchable via a dropdown). On each axis, show a dot plot of sampled points and overlay the theoretical distribution curve. Use vertical segments to connect corresponding sample points across the three axes, representing one experiment's three independent observations. Show a trajectory of sample means across experiments, converging to the theoretical mean. Include axis ticks, a baseline, and a slider to adjust display precision. Label units (cm or k) appropriately. The layout should clearly demonstrate how sample statistics vary and approximate the theoretical distribution.
The prompt above was compiled from the original drawing commands and is for reference only.