Mean, Median, Mode Geometric Construction Example

Mean, Median, Mode Geometric Construction Example
Loading the math board and drawing, please wait…
2018-11-29 02:02
This example demonstrates the calculation of mean, median, and mode using GeoGebra. Key mathematical concepts include statistical measures of central tendency and the relationship between geometric shapes and data distribution. Construction involves commands like Textfield, Remove, Flatten, Sequence, If, DotPlot, Zip, Line, Sort, UnicodeToText, BoxPlot, and objects such as ds1, ds2, plot1, plot2. Suitable for middle school students learning statistics or high school students practicing data analysis.

GeoGebra Commands & Parameters

  1. Textfield(ds1Text) → InputBox1
  2. Remove(TextToUnicode[ds1Text], Sequence[32, i, 1, Length[TextToUnicode[ds1Text]]]) → unicode1
  3. Flatten(Join[{{{0}, Remove[Sequence[If[Element[unicode1, i] ≟ 44, i, 0], i, 1, Length[unicode1]], Sequence[0, i, 1, Length[unicode1]]]}, {Length[unicode1] + 1}}]) → locationOfCommas1
  4. Sequence(Take[unicode1, Element[locationOfCommas1, i] + 1, Element[locationOfCommas1, i + 1] - 1], i, 1, Length[locationOfCommas1] - 1) → removedCommas1
  5. Sequence(UnicodeToText[Element[removedCommas1, i]], i, 1, Length[removedCommas1]) → backToNumbers1
  6. If(Length[ds1Text] > 0, RemoveUndefined[Sort[Zip[FromBase[A, 10], A, backToNumbers1]]], {}) → ds1
  7. Textfield(ds2Text) → InputBox2
  8. Remove(TextToUnicode[ds2Text], Sequence[32, i, 1, Length[TextToUnicode[ds2Text]]]) → unicode2
  9. Flatten(Join[{{{0}, Remove[Sequence[If[Element[unicode2, i] ≟ 44, i, 0], i, 1, Length[unicode2]], Sequence[0, i, 1, Length[unicode2]]]}, {Length[unicode2] + 1}}]) → locationOfCommas2
  10. Sequence(Take[unicode2, Element[locationOfCommas2, i] + 1, Element[locationOfCommas2, i + 1] - 1], i, 1, Length[locationOfCommas2] - 1) → removedCommas2
  11. Sequence(UnicodeToText[Element[removedCommas2, i]], i, 1, Length[removedCommas2]) → backToNumbers2
  12. If(Length[ds2Text] > 0, RemoveUndefined[Sort[Zip[FromBase[A, 10], A, backToNumbers2]]], {}) → ds2
  13. DotPlot(ds1) → plot1
  14. DotPlot(ds2) → plot2
  15. If(Defined[Min[Join[{ds1, ds2}]]], Min[Join[{ds1, ds2}]], 0) → min
  16. If(Defined[Max[Join[{ds1, ds2}]]], Max[Join[{ds1, ds2}]], 10) → max
  17. If(Defined[Max[{Max[Frequency[ds1]], Max[Frequency[ds2]], 3}]], Max[{Max[Frequency[ds1]], Max[Frequency[ds2]], 3}], 3) → height
  18. Zip(Line[(A, 0), x = 0], A, Mode[ds1]) → mode1
  19. Zip(Line[(A, 0), x = 0], A, Mode[ds2]) → mode2
  20. Line((mean[ds1], 0), x = 0) → mean1
  21. Line((mean[ds2], 0), x = 0) → mean2
  22. Line((Median[ds1], 0), x = 0) → med1
  23. Line((Median[ds2], 0), x = 0) → med2
  24. Sort(Sequence[Random[0, 30], i, 1, Random[8, 16]]) → random1
  25. Sort(Sequence[Random[0, 30], i, 1, Random[10, 20]]) → random2
  26. Flatten(Sequence[TextToUnicode[Text[Element[random1, i] + ","]], i, 1, Length[random1]]) → random1asText
  27. UnicodeToText(First[random1asText, Length[random1asText] - 1]) → ds1Random
  28. BoxPlot(height / 2, height / 5, ds1) → boxPlot1
  29. BoxPlot(height / 2, height / 5, ds2) → boxPlot2
  30. Flatten(Sequence[TextToUnicode[Text[Element[random2, i] + ","]], i, 1, Length[random2]]) → random2asText
  31. UnicodeToText(First[random2asText, Length[random2asText] - 1]) → ds2Random