Ask Your Question
0

Assigning students in groups

asked 2013-03-03 18:03:06 +0200

Kaiserfilk gravatar image

I have a project with 60 students and 6 teachers. I'd like to know if it is possible to use Matrix and Permutation functions in Sage to assign those 60 students in 6 groups. There would be 6 sessions (a month each). Each student has to work once with each teacher and avoid being in the same group of students (as much as possible).

Thank you.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2013-03-04 22:48:09 +0200

Kaiserfilk gravatar image

Thank you for the answer. I think I could use this to fill 6 groups randomly with the 60 students. Since the numbers of students in each group is larger than the number of groups, the problem is difficult to solve (cf. social golfer problem). In my case, between two sessions, each teacher could, one after the other, use this program to generate the composition of his new group (10 new students among 60-10n students he never had yet, n being the session's number).

from random import shuffle
a=[[i] for i in range(60)]
n=len(a)/10
shuffle(a)
results=[[a[i] for i in range(j*10,j*10+10)] for j in range(0,n)]
results
edit flag offensive delete link more
0

answered 2013-03-04 09:20:55 +0200

calc314 gravatar image

updated 2013-03-04 23:46:58 +0200

Here's a way to shuffle students into groups in python. It's not a solution to the problem you've posed, but it's a start.

from random import shuffle
a=['a','b','c','d','e','f','g','h','i','j','k','l']
n=len(a)/6
shuffle(a)
results=[[a[i] for i in range(j*6,j*6+6)] for j in range(0,n)]
results
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-03-03 18:03:06 +0200

Seen: 617 times

Last updated: Mar 04 '13