Comparing Mean, Median, and Mode

Comparing Mean, Median, and Mode
Loading the math board and drawing, please wait…
2017-04-26 00:03
This example demonstrates the concepts of mean, median, and mode through data sets. Key mathematical concepts include statistics such as mean, median, and mode. Construction highlights include using DotPlot to display data distribution and BoxPlot to show quartile distribution. Suitable for middle school and above students to learn basic statistical concepts.

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