Relative Frequencies and Categorical Bar Charts

Relative Frequencies and Categorical Bar Charts
Loading the math board and drawing, please wait…
2014-02-13 02:16
In collections Charts & Graphs
This example demonstrates constructing relative frequency distributions and categorical bar charts. Key math concepts include relative frequency, frequency distribution, and bar chart plotting. GeoGebra commands like Element, Sequence, RemoveUndefined, Sum, Max, Mod, CountIf, Segment are used along with objects such as CatNoSq, DataSet, CatNo1. Ideal for high school statistics and probability teaching and student practice.

GeoGebra Commands & Parameters

  1. Element(CatNoSq, DataSet) → CatNo1
  2. Sequence(If[k > 96, 6, If[k > 91, 5, If[k > 85, 4, If[k > 79, 3, If[k > 66, 2, 1]]]]], k, 1, 100) → DtSq1
  3. Sequence(If[k > 91, 5, If[k > 69, 4, If[k > 57, 3, If[k > 51, 2, 1]]]], k, 1, 100) → DtSq2
  4. Sequence(If[k > 79, 4, If[k > 66, 3, If[k > 28, 2, 1]]], k, 1, 100) → DtSq3
  5. Element(DtSqSq, DataSet) → DtSq
  6. Sequence(Element[DtSq, Mod[Seed + (47 * k), 100] + 1], k, 1, Sz1) → AcDt
  7. Sequence(CountIf[x ≟ k, AcDt], k, 1, CatNo1) → FrqSq1
  8. Sequence(If[Element[FrqSq1, k] ≟ 0, NaN, Element[FrqSq1, k]], k, 1, CatNo1) → FrqSq2
  9. RemoveUndefined(FrqSq2) → FrqSq3
  10. Sum(FrqSq3) → Sz2
  11. Max(FrqSq3) → FrqMax
  12. Max(1, floor(FrqMax / 3)) → FrqUnt
  13. Mod(Seed, 10) → Start
  14. Element(CatLabSq, DataSet) → CatLab
  15. Element(IndPrcSq, DataSet) → IndPrc
  16. Element(CatSq, DataSet) → Cat1
  17. Sequence(Sum[First[IndPrc1, k]], k, 1, 5) → CmlPrc1
  18. Sequence(Sum[First[IndPrc2, k]], k, 1, 4) → CmlPrc2
  19. Sequence(Sum[First[IndPrc3, k]], k, 1, 3) → CmlPrc3
  20. Sequence(If[Element[FrqSq2, k] ≠ 0, Element[Cat1, k]], k, 1, CatNo1) → Cat2
  21. RemoveUndefined(Cat2) → Cat3
  22. CountIf(x > 0, FrqSq1) → CatNo2
  23. Sequence(Element[FrqSq3, k] / Sz2, k, 1, CatNo2) → RFSq
  24. Sequence(Text[Element[Cat3, k], ((-4), ClTp - (0.1 * k))], k, 1, CatNo2) → CatTxt
  25. Segment(UL, LL) → FrqAx
  26. Segment(LL, LR) → HrAx
  27. Segment(LR, UR) → RFAx
  28. Sequence(Segment[(GL + ((k - 1) * CW), Adpt(Element[FrqSq3, k])), (GL + (k * CW), Adpt(Element[FrqSq3, k]))], k, 1, CatNo2) → BrTp
  29. Segment(LL, (GL, Adpt(Element[FrqSq3, 1]))) → LftSd
  30. Segment(LR, (GR, Adpt(Element[FrqSq3, CatNo2]))) → RgtSd
  31. Sequence(Segment[(GL + (k * CW), GB), (GL + (k * CW), Adpt(Max[Element[FrqSq3, k], Element[FrqSq3, k + 1]]))], k, 1, CatNo2 - 1) → BrSd
  32. Sequence((GL + ((k - 0.6) * CW) - 0.5, GB - 0.02), k, 1, CatNo2) → LblLcSq
  33. Sequence(VerticalText[Element[Cat3, k], Element[LblLcSq, k]], k, 1, CatNo2) → BrLblSq
  34. Element(TtlSq, DataSet) → Title
  35. Sequence(Text[k, (GL - 3.5, GB + (k * FrqScl) - 0.02)], k, 0, AxMax, FrqUnt) → FrqLbSq
  36. Sequence(Segment[(GL - 1, Adpt(k)), (GL, Adpt(k))], k, 0, AxMax, FrqUnt) → FrqAxTc
  37. Sequence(Segment[(GR, Adpt(k)), (GR + 1, Adpt(k))], k, 0, AxMax, FrqUnt) → RFAxTc
  38. Sequence(Text[k / Sz2, (GR + 1.1, GB + (k * FrqScl) - 0.02)], k, 0, AxMax, FrqUnt) → RFLblSq
  39. Sequence(Text[Element[FrqSq3, k], (11, ClTp - (0.1 * k))], k, 1, CatNo2) → FrqTxt1
  40. Sequence(Text[(((Element[FrqSq3, k] * "/") * Sz2) * " ="), (15, ClTp - (0.1 * k))], k, 1, CatNo2) → RFC1Tx
  41. Sequence(Text[Element[RFSq, k], (22, ClTp - (0.1 * k))], k, 1, CatNo2) → RLFrTx
  42. Sequence((k * FrqUnt / Sz2), k, 0, CatNo3) → GRFSq
  43. Sequence((k * FrqUnt), k, 0, CatNo3) → GFSq
  44. Sequence(Text[((((Element[GFSq, k + 1] * "/") * Sz2) * " = ") * Element[GRFSq, k + 1]), (75, (-1.53) + (0.1 * k))], k, 0, CatNo3) → RFC2Tx

AI Drawing Prompt Reference

Create a bar chart to show the relative frequencies of different score ranges. First, categorize the dataset into score ranges, calculate the frequency for each range, remove bars with zero frequency, determine the maximum frequency, and set the frequency axis scale interval. Finally, draw the bar chart, label each bar with its frequency and relative frequency.
The prompt above was compiled from the original drawing commands and is for reference only.