On the Subject of Partitions

This is the way to make groups in class, okay maybe not.

This module displays a 5×5 grid of pixels. Highlighting a pixel will reveal its colour channels. In order to solve the module, you must group the current groups until there is just one left. Initially there are 25 groups: one for each pixel.

The groups all have 3 values between 0 and 4 inclusive. These are their RGB values. To get a group's value, add its three values together.

In order to obtain the grouping, repeat the following process until all groups are regrouped:

  1. Take the sum of all the group values.
  2. Modulo this number by the amount of groups and add 1.
  3. Take the value of the n'th group, where n is the value from step 2.
  4. Take this number reductive-modulo the amount of ungrouped squares and add 1. This is one of the groups.
    Reductive modulo is a custom operator that works as follows (a reducmod b):
    • If a is less than b, returns a
    • Otherwise subtract b from a and reduce b by 1. Then try the above again with your new values.
    • If b gets to 0 before a gets below b, it returns 0.
  5. Disregard the group from step 3 for all steps, except for step 4.

Note: The group count must always be reduced. If you only have groups of 1 in your regrouping, replace two of those by a group of 2.

To submit your groups, select an amount of pixels. Press a pixel, highlight until there are as many groups selected as required for a group, then press one of the selected pixels. These pixels will no longer be selectable for further groups and they will not reveal their colour again until a strike incurs or the module advances.

The shapes of these groups or the order of entering them do not matter.