|
"Jeff " <perryj@msoe.edu> wrote in message <gof6g8$apk$1@fred.mathworks.com>...
> For a pinewood derby race I am trying to get all 48 cars to race each other at least once, to race in each lane (1 thru 4) at least once, and to do so randomly. I do believe I would start with a 4 x 12 matrix. Beyond that I am very MATLAB rusty. Help!!
It seems to me you have grossly underestimated the number of necessary races if you think there will be only 12 races. At a minimum there are 48*47/2 = 1128 possible pairings among 48 cars, and each race contains only 6 pairings which would mean a minimum of 1128/6 = 188 different races.
You are actually faced with choosing from among 4,669,920 different possible races. I have no idea whether a scheme could be devised to meet all your conditions with this minimum number, but it surely would not qualify as a "randomly" determined one. What do you mean when you say "randomly"? You could write a program that continually chose random races from among that huge number until all conditions were met but you might have to stage an immense total number of races that way.
In any case this is a problem in combinatorics and hardly appropriate for this matlab newsgroup. The problem and solution could be expressed equally well in almost any computer language.
Roger Stafford
|