KA-0014Repeating cycles and position mod n
4 points, difficulty 2 of 3Level 3–4about 60sBeads are threaded in the repeating order red, green, blue, yellow. What colour is the 30th bead?
Hints
Take them one at a time. The first gives nothing away.
1A nudge
The pattern repeats every four beads.
2The strategy
Divide the position by the length of one repeat and keep the remainder, not the quotient. The remainder tells you how far into a fresh repeat you have landed.
3The full solution
30 divided by 4 is 7 remainder 2. Seven whole repeats use 28 beads, so bead 29 is red and bead 30 is green, the second colour of the repeat.
Solution— no shortcut on this one
One repeat is four beads: position 1 red, 2 green, 3 blue, 4 yellow. Divide 30 by 4 to get 7 remainder 2, so bead 30 sits at position 2 of a repeat, which is green. Note the edge case: a remainder of 0 would mean the last colour of a repeat, not the first. The transferable idea: the remainder gives the position inside the cycle.
Why this is on the test: Cycle questions turn a huge position into one division, and reading the remainder is what separates a correct answer from a near miss.