Worked example
Group count: 8
Inputs
- Students: 30
- Desired group size: 4
- Minimum group size: 3
- Maximum group size: 5
Choose the nearest feasible group count to students / desired size, then distribute students as evenly as possible.
Use the units shown.
Feasible group counts range from roundUp(a/d) through floor(a/c). Clamp round(a/b) to that range; reject if the range is empty.
Give each group floor(a/group count) students, then give one extra to the first a remainder group count groups.
Choose the nearest feasible group count to students / desired size, then distribute students as evenly as possible. Groups differ by at most one; this allocates counts, not named students.
OpenStax: algebra and proportional reasoning ↗Group count: 8
Group count: 4