Practice with Contingency Tables and 2×2 Four-Field Tables: Randomized Questions

Practice with Contingency Tables and 2×2 Four-Field Tables: Randomized Questions
Loading the math board and drawing, please wait…
2025-01-22 22:05
In collections Kreuztabellen
This GeoGebra lesson demonstrates how to represent discrete data in contingency tables (cross-tabulations) and in 2×2 four-field tables, using an interactive workflow that generates multiple questions and provides immediate feedback. The key math concepts are the structure of contingency tables, the meaning of counts in a 2×2 four-field table, and data representation needed for later probability & statistics topics. Construction/implementation highlights: Text and Textfield elements build question prompts and user inputs (e.g., input22/input23/...); Sequence and a QuestionList manage randomized selection of questions (randomQuestions/randomQuestion); Join composes formatted question text (txtQuestion01–txtQuestion05); graphical components (e.g., PolyLine, rectangleFeedback) draw the table layout and feedback area; If statements compare user entries to expected results (correct22–correct44 aggregated into correct) and toggle validation controls; Table01–Table05 and AllTables switch between the various table states, while btnValidate plus attemptCount/correctCount track performance. Best suited for middle school grades (around 7–8) as guided practice for data representation in statistics.

GeoGebra Commands & Parameters

  1. Element(randomQuestions, Mod[questionCount - 1, Length[randomQuestions]] + 1) → randomQuestion
  2. Textfield(input) → inputBox
  3. Sequence(Sequence[PosTable + (Sum[ListSpalte, k], (-Sum[ListZeile, m])), k, 0, 4], m, 0, 4) → TablePosMat
  4. Textfield(input22) → InputBox22
  5. Textfield(input23) → InputBox23
  6. Textfield(input24) → InputBox24
  7. Textfield(input32) → InputBox32
  8. Textfield(input33) → InputBox33
  9. Textfield(input34) → InputBox34
  10. Textfield(input42) → InputBox42
  11. Textfield(input43) → InputBox43
  12. Textfield(input44) → InputBox44
  13. Text((("\textsf{\bold{" * TableCapList12(randomQuestion)) * "\vphantom{g}}}"), Midpoint[TablePosMat(1, 2), TablePosMat(2, 2)], false, true, 1, 0) → TableCap12
  14. Text((("\textsf{\bold{" * TableCapList13(randomQuestion)) * "\vphantom{g}}}"), Midpoint[TablePosMat(1, 3), TablePosMat(2, 3)], false, true, 1, 0) → TableCap13
  15. Text("\textsf{\bold{Gesamt\vphantom{g}}}", Midpoint[TablePosMat(1, 4), TablePosMat(2, 4)], false, true, 1, 0) → TableCap14
  16. Text((("\textsf{\bold{" * TableCapList21(randomQuestion)) * "\phantom{g}}}"), Midpoint[TablePosMat(2, 1), TablePosMat(3, 1)], false, true, 1, 0) → TableCap21
  17. Text((("\textsf{\bold{" * TableCapList31(randomQuestion)) * "\phantom{g}}}"), Midpoint[TablePosMat(3, 1), TablePosMat(4, 1)], false, true, 1, 0) → TableCap31
  18. Text("\textsf{\bold{Gesamt\phantom{g}}}", Midpoint[TablePosMat(4, 1), TablePosMat(5, 1)], false, true, 1, 0) → TableCap41
  19. Join({Sequence[Segment[Corner[4] + (RasterPixMat * ((k * RasterStepXY), 0)), Corner[4] + (RasterPixMat * ((k * RasterStepXY), RasterMaxY))], k, 0, RasterMaxX / RasterStepXY], Sequence[Segment[Corner[4] + (RasterPixMat * (0, (k * RasterStepXY))), Corner[4] + (RasterPixMat * (RasterMaxX, (k * RasterStepXY)))], k, 0, RasterMaxY / RasterStepXY]}) → RasterStrecken
  20. Join({Sequence[Text[UnicodeToLetter[65 + k], Midpoint[Corner[4] + (RasterPixMat * ((k * RasterStepXY), RasterMaxY)), Corner[4] + (RasterPixMat * (((k + 1) * RasterStepXY), RasterMaxY))], false, true, 0, -1], k, 0, RasterMaxX / RasterStepXY - 1], Sequence[Text[("" * k), Midpoint[Corner[4] + (RasterPixMat * (RasterMaxX, ((k - 1) * RasterStepXY))), Corner[4] + (RasterPixMat * (RasterMaxX, (k * RasterStepXY)))], false, true, 1, 0], k, 1, RasterMaxY / RasterStepXY]}) → RasterBeschriftung
  21. Sequence(Sequence[Corner[4] + (RasterPixMat * ((k * RasterStepXY), (m * RasterStepXY))), k, 0, RasterMaxX / RasterStepXY], m, 0, RasterMaxY / RasterStepXY) → RasterPunkte
  22. Textfield(InputName) → InputBoxName
  23. PolyLine(PosSB, Corner[txt001, 1] + (0.6, 0), Corner[txt001, 2] + (0.1, 0), Corner[txt001, 3] + (0.1, 0.1), Corner[txt001, 4] + (-0.1, 0.1), Corner[txt001, 1] + (-0.1, 0.5), PosSB) → sb001
  24. PolyLine(PosSB, Corner[txt002, 1] + (0.6, 0), Corner[txt002, 2] + (0.1, 0), Corner[txt002, 3] + (0.1, 0.1), Corner[txt002, 4] + (-0.1, 0.1), Corner[txt002, 1] + (-0.1, 0.5), PosSB) → sb002
  25. If(accept, (0, 10), (0.75, 4.25)) → PosMail
  26. Text(txtQuestion, PosMail + (0, (-headerHeight) - 1.4), false, true, 1, -1) → MailText
  27. Text(txtGoal, PosMail + (0, (-headerHeight) - 1.4), false, true, 1, -1) → MailTextEnd
  28. Text(txtGoalAlt, PosMail + (0, (-headerHeight) - 1.4), false, true, 1, -1) → txtEndAlt

AI Drawing Prompt Reference

Draw a 2×2 four-field table with two categorical variables, with four input fields for the number of each category value. The table title and total label should change according to the randomly generated question. Draw a grid around the table with letter and number labels. Draw a text field for the user to input their answer and a text field to display the answer feedback.
The prompt above was compiled from the original drawing commands and is for reference only.