# Any way to compose groups of people in MAPLE?

**URL:** <https://boards.straightdope.com/t/any-way-to-compose-groups-of-people-in-maple/466089>\
**Category:** Factual Questions\
**Created:** [October 1, 2008, 10:42pm UTC](https://boards.straightdope.com/t/any-way-to-compose-groups-of-people-in-maple/466089 "2008-10-01T22:42:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tikster](https://avatars.discourse-cdn.com/v4/letter/t/8edcca/32.png) [@Tikster](https://boards.straightdope.com/u/Tikster)\
**Post date:** [October 1, 2008, 10:42pm UTC](https://boards.straightdope.com/t/any-way-to-compose-groups-of-people-in-maple/466089/1 "2008-10-01T22:42:46Z")

</div>

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

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 🙂

Thanks in advance,  
Tikster

---

<div class="post-metadata">

**Author:** ![OldGuy](https://avatars.discourse-cdn.com/v4/letter/o/3bc359/32.png) [@OldGuy](https://boards.straightdope.com/u/OldGuy)\
**Post date:** [October 1, 2008, 11:00pm UTC](https://boards.straightdope.com/t/any-way-to-compose-groups-of-people-in-maple/466089/2 "2008-10-01T23:00:20Z")

</div>

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
