in reply to Unique Combos with Math::Combinatorics

And here's a 36er.

ELQV AEPR IKNR FHTW BEIS DFMQ CQRX CGJV DOPX FGSX BDHR MNWX GKLP ABCT +EHNU JMST EFKO BFLN AJOW ADGU BPVW AKMV AHIQ IMPU KQUW CHPS NPQT CDEW + DIJL GMOR TUVX LRSW DNSV CLOU FJRU BJKX

I've found it by randomly adding new teams until the set was maximal, starting from no teams repeatedly until it got larger than 35.

J source (modified from the above post; to see how slow it works, it prints the number of teams in a set it's found after each try):

players =: a.{~65+i.24 teams =: (#~]-:"1~."1)~./:~/:~"1>,{4$<players good =: teams#~[:(*./"1) 1>: teams&(+/@:e."1"1 _) fmt =: ,/@:(,&' '"1)"2 rand =: 3 :'((,(?@:#{])@:good) ::])^:_ i.0 4' fmt 3 :('while. 1!:2&2#(t =: rand 0)'; '35>:#t'; 'do. end.'; 't') 0

Update: I got lucky. Here's a set of 38 teams (generated using the same code except by raising the constant 35).

BEHN KQTX BJMR GIPQ ELTW DNPV AGHU GLMO JNOT CEFI KOSW ADMX AJVW CLPU +AFLS HJSX DIOU BFGK FOPR BDQS CHQW HIKM ACKN KLRV NRSU FHTV EGRX CDGT + EMUV MPST FJQU EJKP FMNW BPWX COVX AEOQ ILNX ABIT

Replies are listed 'Best First'.
Re^2: Unique Combos with Math::Combinatorics (fair)
by tye (Sage) on Mar 02, 2008 at 13:50 UTC

    Note that none of your solutions are fair because they all have some players playing on more teams than other players.

    Update: Also note that a likely scenario for applying this algorithm is a gathering of 24 people where they break up into teams. This requires that the list of possible teams can be divided into "rounds" where each round has every player on exactly one team. I'm curious what the maximal solutions are with and without the requirement of rounds (but with the requirement of being "fair", of course). Even the maximal number of teams without a requirement of fairness would be interesting.

    But from a practical standpoint, it may be even more valuable to come up with solutions that are more fair but don't require the number of repeated pairings to be zero, just to be minimized.

    - tye        

        Interestingly, it says that the maximum can be achieved, however, the given solution:

        7 rounds play in 6 groups of 4 golfers [ 1 2 11 21 | 9 10 19 5 | 17 18 3 13 | 4 7 6 24 | 8 12 14 15 | 16 20 2 +2 23 ] [ 1 3 12 22 | 9 11 20 6 | 17 19 4 14 | 5 8 7 18 | 2 13 15 16 | 10 21 2 +3 24 ] [ 1 4 13 23 | 9 12 21 7 | 17 20 5 15 | 6 2 8 19 | 3 10 14 16 | 11 18 2 +2 24 ] [ 1 5 14 24 | 9 13 22 8 | 17 21 6 16 | 7 3 2 20 | 4 10 11 15 | 12 18 1 +9 23 ] [ 1 6 15 18 | 9 14 23 2 | 17 22 7 10 | 8 4 3 21 | 5 11 12 16 | 13 19 2 +0 24 ] [ 1 5 16 19 | 9 15 24 3 | 17 23 8 11 | 2 5 4 22 | 6 10 12 13 | 14 18 2 +0 21 ] [ 1 8 10 20 | 9 16 18 4 | 17 24 2 12 | 3 6 5 23 | 7 11 13 14 | 15 19 2 +1 22 ]

        Obviously doesn't work since 1 is paired with 5 in both the 4th and 6th round. But that appars to be a typo and should be a 7 in round 6. Spot checking didn't turn up any other problem but I didn't fully verify the solution, which using our A..X notation would be:

        ABKU IJSE QRCM DGFX HLNO PTVW ACLV IKTF QSDN EHGR BMOP JUWX ADMW ILUG QTEO FBHS CJNP KRVX AENX IMVH QUFP GCBT DJKO LRSW AFOR INWB QVGJ HDCU EKLP MSTX AGPS IOXC QWHK BEDV FJLM NRTU AHJT IPRD QXBL CFEW GKMN OSUV

        - tye