Generate a List of Random Numbers with No Equal Adjacents
Loading the math board and drawing, please wait…
This example demonstrates how to generate a list of random numbers with no adjacent equal numbers. Key mathematical concepts include random experiments and sequences. It uses GeoGebra commands such as Shuffle and Append. Suitable for middle school math education, particularly in probability and statistics and sequence courses.
GeoGebra Commands & Parameters
Shuffle(Sequence[Random[0, 9], i, 1, 100]) → l1, {4, 8, 4, 3, 1, 4, 1, 2, 3, 6, 9, 6, 5, 3, 3, 4, 8, 0, 8, 9, 0, 8, 2, 8, 8, 7, 3, 3, 9, 1, 7, 6, 3, 4, 5, 8, 8, 8, 3, 6, 7, 5, 4, 1, 9, 8, 1, 3, 1, 4, 1, 2, 0, 0, 9, 7, 4, 2, 4, 9, 0, 3, 4, 1, 6, 1, 7, 0, 4, 5, 3, 1, 3, 1, 3, 3, 5, 1, 5, 9, 7, 9, 9, 4, 1, 1, 7, 4, 1, 2, 0, 7, 5, 1, 6, 9, 0, 5, 0, 1}Append(Sequence[If[Element[l1, i] ≟ Element[l1, i + 1], Mod[Element[l1, i] + 1, 10], Element[l1, i]], i, 1, Length[l1] - 1], Element[Last[l1], 1]) → l2Append(Sequence[If[Element[l2, i] ≟ Element[l2, i + 1], Mod[Element[l2, i] + 1, 10], Element[l2, i]], i, 1, Length[l2] - 1], Element[Last[l2], 1]) → l3Append(Sequence[If[Element[l3, i] ≟ Element[l3, i + 1], Mod[Element[l3, i] + 1, 10], Element[l3, i]], i, 1, Length[l3] - 1], Element[Last[l3], 1]) → l4Append(Sequence[If[Element[l4, i] ≟ Element[l4, i + 1], Mod[Element[l4, i] + 1, 10], Element[l4, i]], i, 1, Length[l4] - 1], Element[Last[l4], 1]) → l5Append(Sequence[If[Element[l5, i] ≟ Element[l5, i + 1], Mod[Element[l5, i] + 1, 10], Element[l5, i]], i, 1, Length[l5] - 1], Element[Last[l5], 1]) → l6Append(Sequence[If[Element[l6, i] ≟ Element[l6, i + 1], Mod[Element[l6, i] + 1, 10], Element[l6, i]], i, 1, Length[l6] - 1], Element[Last[l6], 1]) → l7
AI Drawing Prompt Reference
Generate a list of random numbers where each number is an integer between 0 and 9, and adjacent numbers must be different. The list should contain multiple numbers arranged to show randomness and sequence characteristics.
The prompt above was compiled from the original drawing commands and is for reference only.