Group Abstract Group Abstract

Message Boards Message Boards

0
|
10.8K Views
|
7 Replies
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

Random selection of pairs

Posted 10 years ago

I have a group of 16 people and wish to schedule them for 10 weeks in groups of 2. All 16 people meet (8 pairs of 2) each week and I do not wish to have any of the pairs repeat in future weeks. I have been able to come up with pairings but I am unsure as to how make the selections unique, i.e. some pairs are selected more than once. Any suggestions?

Here is the line of code that I've written:

For[i = 1, i < 11, i++,  Print[Partition[RandomSample[Range[1, 16], 16], 2]]]
POSTED BY: gmauser Mauser
7 Replies
Posted 10 years ago

Thank you for all of the help!

POSTED BY: gmauser Mauser
Posted 10 years ago

This should do it for 10 sets of games, if you alter the count above 11 it stalls.

a = Subsets[Range[16], {2}]; cnt = 0;
While[cnt <= 9, 
 b = Sort[Sort /@ Partition[RandomSample[Range[16]], 2]]; 
 If[Length[a] - Length[Complement[a, b]] == 8, Print[b]; 
  a = Complement[a, b]; cnt++]]

Paul.

POSTED BY: Paul Cleary
Posted 10 years ago

Here is a way to generate 15 weeks of no repeating game.

a = Subsets[Range[16], {2}]; Partition[RandomSample[a], {8}]

David, the line.

pairings = Select[Union[Sort /@ Tuples[{Range[16], Range[16]}]], #[[1]] != #[[2]] &];

can be replaced with

pairings = Subsets[Range[16], {2}]

Paul.

Forget this it doesn't account for same team playing in each round:(

POSTED BY: Paul Cleary
Posted 10 years ago

Random selection of pairs

POSTED BY: Dana DeLouis
Posted 10 years ago
POSTED BY: David Gathercole
Posted 10 years ago

Perhaps you can adapt this algorithm

POSTED BY: Bill Simpson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard