Any way to compose groups of people in MAPLE?

This is sorta helping me with my homework, and sorta not, since I’m the teacher :wink:

One of my tasks is to subdivide the class into 6 groups (24 students) - and to do it at random and to change them fairly often. So the geek in me thought “hey, generating the groups in MAPLE would be kinda cool”.

Apparantly, the geek in me is not big enough, and I’m stumped. So - anyone have any ideas/help?

If it could be an algorithm where you can put the students’ names in an array and enter how many groups you want (for future use) it’s be neat too…

If not, I could resort to drawing numbers out of a hat :slight_smile:

Thanks in advance,
Tikster

I assume Maple will generate (pseudo) random numbers. If not it can certainly be programmed to do so with any number of algorithms. Then

Generate a random number for each student and assign integers by rank. Then divide them into groups by rank. So (not knowing Maple language) some formula like

group assignment = Modulo(rank(rand),n)

where n is the number of groups you want. If you don’t want a group zero, use

group assignment = Modulo(rank(rand),n) + 1.

The only real issue is how to get Maple to compute the rank from a list of numbers. There might or might not be a simple function.

In Excel, you’d use

A B C
Name Random Group
Amy =rand() =Mod(rank(b2,$b$2:b?),6)
Bill =rand() =Mod(rank(b2,$b$2:b?),6)
Charlie =rand() =Mod(rank(b2,$b$2:b?),6)

etc