All Possible Combinations code
Posted: Sat Nov 11, 2006 4:55 pm
Hi,
I would like to get all the possible combinantions from a pool of teams. For example; there are 3 teams (Chelsea, Arsenal and Man U). I would like to have a script that automatically gives me: Chelsea - Arsenal, Chelsea - Man U, Arsenal - Man U. This is a combination of 2 out of 3. I would like to have code for combinations of 2 out of X (variable number of teams).
Info on combinatorics: http://en.wikipedia.org/wiki/Combinatorics
Does anyone have an idea about how I should script this into PHP?
Thans
I would like to get all the possible combinantions from a pool of teams. For example; there are 3 teams (Chelsea, Arsenal and Man U). I would like to have a script that automatically gives me: Chelsea - Arsenal, Chelsea - Man U, Arsenal - Man U. This is a combination of 2 out of 3. I would like to have code for combinations of 2 out of X (variable number of teams).
Info on combinatorics: http://en.wikipedia.org/wiki/Combinatorics
Does anyone have an idea about how I should script this into PHP?
Thans