An interesting combinatorics problem can be found here:
http://www.perlmonks.com/index.pl?node_id=671445
Twenty-four bikers, 'A' to 'X', participate in matches. In every
match, exactly four bikers compete. No two bikers may compete in more
than one matches. How many matches can you organize this way?
I've written a simple J program that tries to find a solution
randomly. It could find 38 matches. We do not know the theoretical
maximum, but an upper bound that's easy to derive is 42 matches. The
program and the output I've got can be found in that thread, but I
copy it here.
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
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
Ambrus
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm