Comparing New and Old Mean and Median

Comparing New and Old Mean and Median
Loading the math board and drawing, please wait…
2018-04-04 23:39
This example dynamically demonstrates how to compare the mean and median of new and old data sets. Key mathematical concepts include the calculation of mean and median. GeoGebra commands used include Random, Sequence, Join, Median, If, Defined, LaTeX, Textfield, etc. Suitable for high school mathematics education and learning.

GeoGebra Commands & Parameters

  1. Random(5, 9) → numvalues
  2. Sequence(Random[0, 20], i, 1, numvalues) → OrigList
  3. Join({OrigList, {usernum}}) → NewList
  4. Median(NewList) → newmedian
  5. Median(OrigList) → origmedian
  6. If(meandiff > mediandiff, 1, If[meandiff < mediandiff, 2, 3]) → ans
  7. Defined(usernum) → Step1Correct
  8. LaTeX(If[ans ≟ 1, "mean changed more", If[ans ≟ 2, "median changed more", "mean and median changed by the same amount"]]) → AnsDisp
  9. Textfield(usertext) → InputBox1
  10. Circle((0.5, 3.3), 0.15) → Circ1
  11. Circle((0.5, 2.8), 0.15) → Circ2
  12. Circle((0.5, 2.3), 0.15) → Circ3
  13. Polygon((0, 6.5), (2.5, 6.5), (2.5, 4.2), (0, 4.2)) → NewValBox, f, g, h, i
  14. LaTeX((((("\begin{tabular}{c}\text{new mean }= " * newmean) * "\qquad\text{new median}=") * newmedian) * "\end{tabular}")) → NewDisp
  15. LaTeX(If[numvalues > 5, "," + (Element[OrigList, 6]), ""]) → d6
  16. LaTeX(If[numvalues > 6, "," + (Element[OrigList, 7]), ""]) → d7
  17. LaTeX(If[numvalues > 8, "," + (Element[OrigList, 9]), ""]) → d9
  18. LaTeX(If[numvalues > 7, "," + (Element[OrigList, 8]), ""]) → d8
  19. LaTeX(d1to5 + d6 + d7 + d8 + d9) → dOrigList
  20. LaTeX((((((("\begin{tabular}{c}\phantom{1000000000000000000000}\\\text{Original Data Set: }" * dOrigList) * "\\\text{mean}=") * origmean) * "\qquad \text{median=}") * origmedian) * "\end{tabular}")) → OrigDisp