nakulak
10-24-2005, 09:30 AM
I ran into a little math problem, if anyone has the solution it would be appreciated.
I was making a schedule for 3x TDM matches (3 teams play in one game).
the background:
prior to now, I only dealt with 6 teams, so the solution was to iterate the teams : set of teams T= {1,2,3,4,5,6}
total games C(m,n)=C(6,3)=20 games,
if the list ofgames is iterated as follows:
match1=123,
match2=124,
match3=125
.
.
.
match20=456
then it turns out to be a trivial case, because match1 is reflexive to match 20, so the schedule turns out to be
week1=match1,match20
week2=match2,match19
etc.
the problem:
well, when you have 9 teams {1,2,3,4,5,6,7,8,9},
C(m,n)=C(9,3)=84 matches
now, the problem is to have all nine teams play in groups of 3, where all 9 members are unique members of the set of teams T.
so, for example, one match would be
Weekx= Game 1{1,2,3},Game 2 {4,5,6}, Game 3{7,8,9}
but there is no obvious case for iterating the subsets so that I can compile a list of 28 weeks x 3 matches per week, where all the members are unique (the 9 teams each play 1 game that week)
now, its clear that with 84 games, the combinations are 84*83*82/3!= 95k combinations of the games, and its clear that I could program the schedule program to filter out the bad ones by using the total of the indexes (ie, if the sum of the indexes doesn't = 1+2+3...+9, then the set of 3 games giving those indexes has a repeating element and can be thrown out,and while intuitively it seems clear that there should be 28 groups of 3 sets of 3 elements that would make a schedule of all the 84 unique games, its not obvious how to iterate the items, nor is it clear as to how many solutions there are.
SOOO..., I was wondering if someone knew of an easier way to iterate the team#'s to that the answer was much easier, if not trivial.
anyway, if anyone does , please post or email me nakulak@comcast.net
(if you do, all I really need is the list of indexes using the #'s 1 thru 9 and I can use the indexes as pointers to the array of strings containing the team names to generate the schedule, or the method for iterating the indexes that provides a trivial solution)
thx
I was making a schedule for 3x TDM matches (3 teams play in one game).
the background:
prior to now, I only dealt with 6 teams, so the solution was to iterate the teams : set of teams T= {1,2,3,4,5,6}
total games C(m,n)=C(6,3)=20 games,
if the list ofgames is iterated as follows:
match1=123,
match2=124,
match3=125
.
.
.
match20=456
then it turns out to be a trivial case, because match1 is reflexive to match 20, so the schedule turns out to be
week1=match1,match20
week2=match2,match19
etc.
the problem:
well, when you have 9 teams {1,2,3,4,5,6,7,8,9},
C(m,n)=C(9,3)=84 matches
now, the problem is to have all nine teams play in groups of 3, where all 9 members are unique members of the set of teams T.
so, for example, one match would be
Weekx= Game 1{1,2,3},Game 2 {4,5,6}, Game 3{7,8,9}
but there is no obvious case for iterating the subsets so that I can compile a list of 28 weeks x 3 matches per week, where all the members are unique (the 9 teams each play 1 game that week)
now, its clear that with 84 games, the combinations are 84*83*82/3!= 95k combinations of the games, and its clear that I could program the schedule program to filter out the bad ones by using the total of the indexes (ie, if the sum of the indexes doesn't = 1+2+3...+9, then the set of 3 games giving those indexes has a repeating element and can be thrown out,and while intuitively it seems clear that there should be 28 groups of 3 sets of 3 elements that would make a schedule of all the 84 unique games, its not obvious how to iterate the items, nor is it clear as to how many solutions there are.
SOOO..., I was wondering if someone knew of an easier way to iterate the team#'s to that the answer was much easier, if not trivial.
anyway, if anyone does , please post or email me nakulak@comcast.net
(if you do, all I really need is the list of indexes using the #'s 1 thru 9 and I can use the indexes as pointers to the array of strings containing the team names to generate the schedule, or the method for iterating the indexes that provides a trivial solution)
thx