Two-way Tables and Conditional Probability Dynamic Simulation

Two-way Tables and Conditional Probability Dynamic Simulation
Loading the math board and drawing, please wait…
2020-08-02 17:55
This GeoGebra example demonstrates the construction of two-way tables and the calculation of conditional probabilities through dynamic random simulation. It generates a dataset with two categorical variables, displays the frequency counts in a contingency table, and computes joint, marginal, and conditional probabilities along with expected values. The core mathematical concepts include conditional probability, joint probability, marginal probability, expected value, and random simulation. The construction uses commands such as Random, Element, Min, Mod, Segment, If, Append, and objects like Seed, DataSet, Pr12Sq, Tb11, and sliders (SlNm1, SlNm2) to control sample size or parameters. It is suitable for high school or introductory college statistics courses to illustrate probability concepts, contingency tables, and the law of large numbers through interactive exploration.

GeoGebra Commands & Parameters

  1. Element(Pr12Sq, DataSet) → Pr12
  2. Element(Pr22Sq, DataSet) → Pr22
  3. Element(Pr21Sq, DataSet) → Pr21
  4. Element(Pr11Sq, DataSet) → Pr11
  5. Min({Pr11, Pr12, Pr21, Pr22}) → PrMin
  6. Mod(SlNm2, 2) → BOp
  7. Element(DDSq, DataSet) → DD0
  8. Element(RL1Sq, DataSet) → RL1
  9. Element(RL2Sq, DataSet) → RL2
  10. Element(CL1Sq, DataSet) → CL1
  11. Element(CL2Sq, DataSet) → CL2
  12. Segment((TbLf, TbTp - TbCH), (TbLf + (3.5 * TbCW), TbTp - TbCH)) → htp
  13. Segment((TbLf, TbTp - (2 * TbCH)), (TbLf + (3.5 * TbCW), TbTp - (2 * TbCH))) → hmd
  14. Segment((TbLf, TbTp - (3 * TbCH)), (TbLf + (3.5 * TbCW), TbTp - (3 * TbCH))) → hbm
  15. Segment((TbCW, TbTp), (TbCW, TbTp - (3.5 * TbCH))) → vlf
  16. Segment(((2 * TbCW), TbTp), ((2 * TbCW), TbTp - (3.5 * TbCH))) → vmd
  17. Segment(((3 * TbCW), TbTp), ((3 * TbCW), TbTp - (3.5 * TbCH))) → vrg
  18. Element(IndSq, DataSet) → Ind
  19. Element(Rw1OpSq, DataSet) → Op1
  20. Element(Rw2OpSq, DataSet) → Op2
  21. Element(Cl1OpSq, DataSet) → Op3
  22. Element(Cl2OpSq, DataSet) → Op4
  23. If(OpBNm1 > 2, OpBNm2, OpBNm2 + 2) → OpBNm3
  24. Element(OpSq, OpANm1) → OpA1
  25. Element(OpSq, OpANm2 + 2) → OpA2
  26. Element(OpSq, OpBNm1) → OpC1
  27. Element(OpSq, OpBNm3) → OpC2
  28. Element(TbRCSq, OpANm1) → TbRw
  29. Element(TbRCSq, OpBNm1) → CndRC
  30. Element(CndRC, OpBNm2) → BNum
  31. Element(RCTtSq, OpBNm1) → BDnm
  32. Append(TbRw, Element[Element[TbRCSq, OpANm3], OpANm2]) → OpASq
  33. Element(OpASq, 1) → ANm1
  34. Element(OpASq, 2) → ANm2
  35. Element(OpASq, 3) → ANm3
  36. If(DataSet ≟ 1, "an", "a") → IA
  37. Random(1, 2) → ba
  38. Random(1, 2) → bb
  39. Random(1, 2) → bc
  40. Random(1, 2) → bd
  41. Element(IndSq_1, DataSet) → Ind_1
  42. Element(Rw1OpSq_1, DataSet) → Op1_1
  43. Element(Rw2OpSq_1, DataSet) → Op2_1
  44. Element(Cl1OpSq_1, DataSet) → Op3_1
  45. Element(Cl2OpSq_1, DataSet) → Op4_1
  46. Element(OpSq_1, OpANm1_1) → OpA1_1
  47. Element(OpSq_1, OpANm2_1 + 2) → OpA2_1
  48. If(DataSet ≟ 1, "an", "a") → IA_1

AI Drawing Prompt Reference

Create a dynamic chart showing a random dataset with two categorical variables, displaying frequency counts in a table and calculating joint, marginal, and conditional probabilities. Include sliders to control parameters, generate data through random simulation, and draw lines for the table and probability bars to visually illustrate probability concepts and expected values.
The prompt above was compiled from the original drawing commands and is for reference only.