Constructing a Histogram with Data Set

Constructing a Histogram with Data Set
Loading the math board and drawing, please wait…
2022-11-14 06:29
This interactive activity demonstrates how to build a histogram using a data set. The core math concepts involved are probability & statistics, specifically histogram construction methods. Key GeoGebra commands used include Shuffle, If, Take, CountIf, Sum, Zip, Element, twoPointBox, Polygon, Mod, VerticalText, Sequence, Segment, and onboardingTextOffset. It is suitable for students in grades 6-8 to learn how to organize and compare one set of information in histograms and bar graphs.

GeoGebra Commands & Parameters

  1. Shuffle(Sequence[15]) → randomList2, {12, 3, 1, 2, 10, 11, 6, 9, 5, 4, 15, 13, 8, 14, 7}
  2. Shuffle({1, 2, 3, 4}) → ansOrder, {4, 1, 3, 2}
  3. Shuffle(Sequence[1, 5]) → shuffleOrder, {5, 4, 1, 3, 2}
  4. Shuffle(Remove[Sequence[1, 49], {10, 20, 30, 40}]) → randomAges, {24, 42, 3, 14, 33, 16, 15, 27, 9, 25, 49, 23, 37, 45, 38, 4, 41, 32, 22, 44, 28, 6, 34, 13, 17, 12, 39, 36, 48, 46, 35, 29, 7, 8, 43, 21, 18, 1, 26, 5, 19, 31, 47, 2, 11}
  5. If((2 * countQuestion) + 9 < 45, (2 * countQuestion) + 1, 1) → startIndex
  6. Take(randomAges, startIndex, startIndex + 7) → ages
  7. CountIf(40 < A < 50, A, ages) → ans5
  8. CountIf(30 < A < 40, A, ages) → ans4
  9. CountIf(20 < A < 30, A, ages) → ans3
  10. CountIf(A < 10, A, ages) → ans1
  11. CountIf(10 < A < 20, A, ages) → ans2
  12. Sum(Zip[(("" * A) * B), A, Sort[ages], B, {", ", ", ", ", ", ", ", ", ", ",\\", ", ", ""}]) → textAgesSorted
  13. Zip(If[A ≟ 0, "no one", If[A ≟ 1, "one person", (("" * A) * " people")]], A, {ans1, ans2, ans3, ans4, ans5}) → counts
  14. Element(randomList2, Mod[countQuestion, 15] + 1) → randomNum2
  15. twoPointBox(Bar1a, Bar1b) → bar1
  16. twoPointBox(Bar2a, Bar2b) → bar2
  17. twoPointBox(Bar3a, Bar3b) → bar3
  18. twoPointBox(Bar4a, Bar4b) → bar4
  19. twoPointBox(Bar5a, Bar5b) → bar5
  20. Polygon({(-10, -1), (-10, 5.5), (55, 5.5), (55, -1)}) → viewbox
  21. Zip(twoPointBox[A, B], A, {Bar1a, Bar2a, Bar3a, Bar4a, Bar5a}, B, {Bar1b, Bar2b, Bar3b, Bar4b, Bar5b}) → barOutlines
  22. Mod(shuffleOrder(countQuestion + 1), 5) → ans3Temp
  23. VerticalText("Number of Campers") → labelY
  24. Sequence(Segment[(0, A), (55, A)], A, 1, 5) → horizGrids
  25. Sum(Zip[("" * (A * B)), A, ages, B, {}]) → agesLatex
  26. Sum(Zip[((("" * A) * B) * " "), A, ages, B, {",", ",", ",", ",", ",", ",", ",", ""}]) → agesText
  27. Zip(A + SolnAnchor, A, barPositions) → solnPositions
  28. Zip(SolnAnchor + (A, B), A, {0, 10, 20, 30, 40}, B, {ans1, ans2, ans3, ans4, ans5}) → solnPoints
  29. Zip(twoPointBox[A, A + (10, 0)], A, solnPoints) → solnOutlines
  30. Zip(Text[("" * A), SolnAnchor + (0, A), true, true, -1, 0], A, {1, 2, 3, 4, 5}) → solnNumbersY
  31. Sequence(Segment[SolnAnchor + (-1, i), SolnAnchor + (0, i)], i, 1, 5) → solnTicksY
  32. Sequence(Segment[SolnAnchor + (i, -0.1), SolnAnchor + (i, 0)], i, 10, 50, 10) → solnTicksX
  33. Sequence(Text[("" * A), SolnAnchor + (A, 0), true, true, 0, -1], A, 0, 50, 10) → solnNumbersX
  34. twoPointBox(solnPoints(1), solnPoints(1) + (10, 0)) → soln1
  35. twoPointBox(solnPoints(2), solnPoints(2) + (10, 0)) → soln2
  36. twoPointBox(solnPoints(3), solnPoints(3) + (10, 0)) → soln3
  37. twoPointBox(solnPoints(4), solnPoints(4) + (10, 0)) → soln4
  38. twoPointBox(solnPoints(5), solnPoints(5) + (10, 0)) → soln5
  39. VerticalText("\text{Number of Campers\\\vspace{245px}\\Number of Campers}") → lblSolnY
  40. Sequence(Segment[SolnAnchor + (0, A), SolnAnchor + (55, A)], A, 1, 5) → solnGrids
  41. If(showsolution, 200, 140) → maxX
  42. If(showsolution, -20, -15) → minX
  43. Sequence(Text[("" * A), (0, 0) + (A, 0), true, true, 0, -1], A, 0, 50, 10) → questionNumbersX
  44. Zip(Text[("" * A), (0, 0) + (0, A), true, true, -1, 0], A, {1, 2, 3, 4, 5}) → questionNumbersY
  45. Segment(Bar1a, Bar1a) → startBar1
  46. onboardingTextOffset(Corner[onboardingText, 1], Corner[onboardingText, 3], onboardingCase, Corner[1], Corner[3], Corner[5]) → OnboardingTextOffset
  47. twoPointBox(Bar2a, Bar2b) → pulsingQuad
  48. Segment(Bar1a, Bar1b) → StartMarker1
  49. Segment(Bar2a, Bar2b) → StartMarker2
  50. Segment(Bar3a, Bar3b) → StartMarker3
  51. Segment(Bar4a, Bar4b) → StartMarker4
  52. Segment(Bar5a, Bar5b) → StartMarker5

AI Drawing Prompt Reference

Create a histogram to represent the distribution of age data. First, randomly shuffle and group the age data, then count the number of people in each age range (0-9, 10-19, 20-29, 30-39, 40-49). Use these counts to draw the histogram on a coordinate plane, with the x-axis representing age ranges and the y-axis representing the number of people. Each bar's height corresponds to the number of people in the respective age range, and bars should touch each other without gaps. Finally, add Y-axis and X-axis labels, as well as X-axis and Y-axis tick marks.
The prompt above was compiled from the original drawing commands and is for reference only.