Identify the Mode in Game-Score Data (In-Game Mode)
Loading the math board and drawing, please wait…
This GeoGebra example demonstrates how to determine the mode of a list of “video game scores,” i.e., the score value that appears most frequently. Students can generate new random score sets and immediately observe how the mode changes. The key mathematical ideas are the mode as a descriptive statistical measure for discrete data, counting occurrences for candidate values, and managing unique values and indexing. Construction highlights include using RandomUniform to generate random scores, Take and Sequence to build the dataset, Unique to extract distinct score candidates, and Element to retrieve values by index (from sets like allScores and currentScores). Occurrence counts are computed with CountIf for each candidate, producing modeValue (the value with the highest frequency). Logic and updates are handled with If, Reverse, and Append, while PixelsToPoint and Text are used to present results clearly in the interface. Suitable for grades 6–8 and for introductory Probability & Statistics lessons focused on describing data using the mode.
GeoGebra Commands & Parameters
RandomUniform(0, 0.999, 200) → allRandomSeeds, {0.6959388293896254, 0.6502841462587158, 0.6894590037735864, 0.6925109067239651, 0.6173471139970224, 0.5818040786250765, 0.708953931426687, 0.9487680569387938, 0.5041533238284187, 0.5067909973577055, 0.698207683971174, 0.3301388661192545, 0.14454739800277247, 0.28302587611832264, 0.23277987370134945, 0.8235243591822955, 0.029753163918062733, 0.9290006121538038, 0.9002587293284752, 0.2636265993277092, 0.05630862263152074, 0.680500999486153, 0.017871297108595113, 0.9336445437734032, 0.760934014222963, 0.14053942833428065, 0.3693795015261951, 0.314932066823253, 0.9219490682835625, 0.5970812438094084, 0.9047096012743214, 0.7168247024536305, 0.1715713406599728, 0.7073705157311181, 0.05730405245557061, 0.8152511192848947, 0.259890786657066, 0.29586746735116176, 0.8113213350113597, 0.19049868220430086, 0.7468738369105961, 0.989859212382167, 0.7475378289132649, 0.038598456353596315, 0.17740167691279668, 0.7736995731320695, 0.9931300354124672, 0.15623571010565973, 0.258091961415385, 0.29237015639580743, 0.4714316189627134, 0.13987651062681863, 0.171492562338071, 0.9496370016658691, 0.8482708596744417, 0.5069282472991863, 0.8931687540680452, 0.4035011177650686, 0.3345989485357635, 0.10722433577965933, 0.33523070906149843, 0.04190994734038321, 0.8308168032727046, 0.7459380162058855, 0.17496940579410952, 0.4558094399277526, 0.9785011852288008, 0.4421902040254113, 0.503482035949672, 0.6885720654425751, 0.3171160461402689, 0.08411825307872915, 0.774476221669462, 0.26563607096010994, 0.12377437178895653, 0.5750204607216474, 0.10284325627285537, 0.6248349195286659, 0.4971896447288472, 0.7243800183950732, 0.6520860238845865, 0.5903830165299965, 0.8926223662991778, 0.24210787241746654, 0.7232759844200587, 0.939814824490908, 0.6348884640537044, 0.21122065438287185, 0.1348962704964486, 0.9783496336417341, 0.8973501403657652, 0.31839215756748007, 0.6917042641013187, 0.24417229780637575, 0.26625893231338327, 0.9303822742884275, 0.8496170925796145, 0.13198303906385223, 0.2638616708976896, 0.8452558989925215, 0.1485875736469664, 0.27387491573883743, 0.17531672803667664, 0.15855829080506226, 0.6514954885028696, 0.9581482822089628, 0.0756967010397026, 0.23820874316342902, 0.4132306085359694, 0.7530637051046395, 0.23117745388574176, 0.23681605434870498, 0.9273888258410267, 0.7507737722077177, 0.935930173182503, 0.9074027355607743, 0.6543419786375592, 0.5497537706129774, 0.4122436824635441, 0.7691531396825873, 0.9428740310676572, 0.14797719957394803, 0.6050092422780237, 0.7997720321277373, 0.127103217058922, 0.42984966799111407, 0.6038977036503353, 0.9313561182194317, 0.10702937191514746, 0.8195278366888273, 0.9113514565323291, 0.5713396351044893, 0.5017599626873546, 0.9667056497839093, 0.0008988154688603695, 0.2650786027471976, 0.30727554748866037, 0.052250048129006355, 0.4152785299007415, 0.4039842816143339, 0.061497122691811915, 0.40221171829663266, 0.1924347485125517, 0.5678077219613563, 0.7164127156245966, 0.6407242597799311, 0.505610238735194, 0.6907105873209013, 0.7681094528138388, 0.502135515809733, 0.27352631155969315, 0.7501361167180921, 0.7007401800232668, 0.7943901805436442, 0.9099920854797775, 0.0842150897231903, 0.49272959244984216, 0.7262009195463651, 0.5482343943768826, 0.7575078189764896, 0.7338956122696532, 0.9499081162101289, 0.8097813882976923, 0.637291494372268, 0.9006250295703453, 0.24413348316829925, 0.6708686014130256, 0.9333560357353545, 0.4618003451937301, 0.6913838019675462, 0.022065938215278545, 0.04336777601954998, 0.789825980376274, 0.6056533317714626, 0.2991469575555195, 0.43330050672163933, 0.3068474712647467, 0.18981199022689485, 0.9551392797728088, 0.18621847519611973, 0.8770954726596619, 0.12414609130140952, 0.5930053120975498, 0.5478227037594091, 0.26221967695683057, 0.8428447040398949, 0.30550692795970635, 0.5186447305860622, 0.3205038485058557, 0.2544920202152972, 0.1475064849816878, 0.05958665222327047, 0.7659731671806898, 0.04573910250355494, 0.6732478528196805, 0.9836654844539586, 0.48261911672408114, 0.5392842294789969, 0.1770475953904632, 0.9803235457445081}Take(allRandomSeeds, randIndex, randIndex + numRandoms - 1) → currentRandomSeedsSequence(1 + floor((currentRandomSeeds(19 + A) * 9)), A, 1, 10) → firstDigit, {3, 5, 2, 2, 9, 8, 5, 9, 4, 4}Unique(Zip[round((100000 * (A / 10 + currentRandomSeeds(B) / 10))), A, firstDigit, B, Sequence[1, 12]]) → uniqueScoresElement(Remove[Sequence[1, 10], {order1}], 1 + floor((currentRandomSeeds(12) * 9))) → order2Element(Remove[Sequence[1, 10], {order1, order2}], 1 + floor((currentRandomSeeds(13) * 8))) → order3Element(Remove[Sequence[1, 10], {order1, order2, order3}], 1 + floor((currentRandomSeeds(14) * 7))) → order4Element(Remove[Sequence[1, 10], {order1, order2, order3, order4}], 1 + floor((currentRandomSeeds(15) * 6))) → order5Element(Remove[Sequence[1, 10], {order1, order2, order3, order4, order5}], 1 + floor((currentRandomSeeds(16) * 5))) → order6Element(Remove[Sequence[1, 10], {order1, order2, order3, order4, order5, order6}], 1 + floor((currentRandomSeeds(17) * 4))) → order7Element(Remove[Sequence[1, 10], {order1, order2, order3, order4, order5, order6, order7}], 1 + floor((currentRandomSeeds(18) * 3))) → order8Element(Remove[Sequence[1, 10], {order1, order2, order3, order4, order5, order6, order7, order8}], 1 + floor((currentRandomSeeds(19) * 2))) → order9Element(Remove[Sequence[1, 10], {order1, order2, order3, order4, order5, order6, order7, order8, order9}], 1) → order10If(Length[uniqueScores] ≥ 10, Zip[uniqueScores(A), A, {order1, order2, order3, order4, order5, order6, order7, order8, order9, order10}], backupScores) → allScoresElement(allScoreIndexOptions, 1 + floor((currentRandomSeeds(11) * Length[allScoreIndexOptions]))) → currentIndicesReverse(Sort[Zip[allScores(A), A, currentIndices]]) → currentScoresMode(currentScores) → modeValueAppend(1, Sequence[If[currentScores(A) < currentScores(A - 1), 1, 0], A, 2, Length[currentScores]]) → orderedCountSequence(Sum[Take[orderedCount, 1, A]], A, 1, Length[orderedCount]) → colorIndexPixelsToPoint((xMin, yMin), (xMax, yMax), (PXwidth, PXheight), (23, 426)) → AnchorSequence(Anchor + ((200 * windowWidth / PXwidth), (15 * windowHeight / PXheight) + (B * boxHeight)), B, Length[currentScores] - 1, 0, -1) → allClickableAnchorsZip(centerBox[boxWidth, boxHeight, A], A, allClickableAnchors) → allClickableBoxesSequence(("Score is " * currentScores(A)), A, 1, Length[currentScores]) → altCaptionsCorner(5) → layoutAppSizeZip(A ≟ modeValue(1), A, currentScores) → isModeZip((((((("" * If[showColors, (("\textcolor{" * colors(C)) * "}{"), ""]) * "") * B) * ". ") * nameOptions(A)) * If[showColors, "}", ""]), A, {order1, order2, order3, order4, order5, order6, order7, order8, order9, order10}, B, {" 1", " 2", " 3", " 4", " 5", " 6", " 7", " 8", " 9", "10"}, C, colorIndex) → playerNamesZip(If[A, B], A, isMode, B, allClickableBoxes) → highlightModeBoxesZip(Text[If[A, ("" * B), ""], C, true, true, 0, 0], A, isMode, B, currentScores, C, allClickableAnchors) → modeLabelsexpandPoly(backgroundCorners, 7, (xMin, yMin), (xMax, yMax), (PXwidth, PXheight)) → BackgroundText(("" * currentScores(animateIndex)), allClickableAnchors(animateIndex), true, true, 0, 0) → pulsingLabelCountIf(A ≟ 1, A, orderedCount) → numDifferentSequence(CountIf[A ≟ k, A, colorIndex], k, 1, 7) → bracketHeightcenterBox(boxWidth, boxHeight, allClickableAnchors(Element[{order1, order2, order3, order4, order5, order6, order7, order8, order9, order10}, animateIndex])) → pulsingBoxPolygon({currentVerts(1) + highlightOffset, currentVerts(2) + ((-x(highlightOffset)), y(highlightOffset)), currentVerts(3) - highlightOffset, currentVerts(4) + (x(highlightOffset), (-y(highlightOffset)))}) → highlightBoxAppend(RemoveUndefined[Sequence[IndexOf[A, colorIndex], A, 1, 7]], 11) → groupStartsSequence(Midpoint[allClickableAnchors(groupStarts(A)), allClickableAnchors(groupStarts(A + 1) - 1)], A, 1, Length[groupStarts] - 1) → bracketCentersZip(rightBracketBox[boxWidth, (A * boxHeight), B, (8 * windowWidth / PXwidth)], A, bracketHeight, B, bracketCenters) → rightBracketsZip(leftBracketBox[boxWidth, (A * boxHeight), B, (5 * windowWidth / PXwidth)], A, bracketHeight, B, bracketCenters) → leftBracketsZip(A + ((-160 * windowWidth / PXwidth), 0), A, allClickableAnchors) → allNameAnchorsText("\text{HIGH SCORE}", Midpoint[backgroundCorners(3), backgroundCorners(4)], true, true, 0, -1) → titleZip(Text[((("" * If[showColors, (("\textcolor{" * colors(C)) * "}{"), "{"]) * A) * "}"), B + (0, (5 * windowHeight / PXheight)), true, true, 0, 0], A, currentScores, B, allClickableAnchors, C, colorIndex) → boxLabelsZip(Text[((("" * If[showColors, (("\textcolor{" * colors(C)) * "}{"), "{"]) * A) * "}"), B + (0, (5 * windowHeight / PXheight)), true, true, 1, 0], A, playerNames, B, allNameAnchors, C, colorIndex) → nameLabelsLength(uniqueScores) → testText("\text{Click to select}", PixelsToPoint[(xMin, yMin), (xMax, yMax), (PXwidth, PXheight), (onboardingX + 25, onboardingY - 10)], true, true, 1, 0) → onboardingText
AI Drawing Prompt Reference
Create an interactive probability-and-statistics layout showing in-game high scores as discrete boxes. Arrange multiple vertically stacked selectable box panels; each box contains the score value text and is visually linked to a color-coded name label shown alongside or above it. Add a prominent header reading “HIGH SCORE” and an instruction line “Click to select”. Include clickable highlight frames so that one box at a time can be emphasized, and also compute and display the mode by highlighting the box (and label text) corresponding to the most frequent score value. Additionally, add a pulsing text indicator to show the currently focused/animated score. Build in order: generate a random score list, extract distinct candidates, sort scores by frequency/ordering for display, create the score boxes with matching name/color labels, then overlay the selected-mode highlight and the mode label.
The prompt above was compiled from the original drawing commands and is for reference only.