Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Random Grouping

Subject: Random Grouping

From: Jeff

Date: 1 Mar, 2009 23:42:00

Message: 1 of 3

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!!

Subject: Random Grouping

From: Roger Stafford

Date: 2 Mar, 2009 02:49:01

Message: 2 of 3

"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

Subject: Random Grouping

From: us

Date: 2 Mar, 2009 06:41:01

Message: 3 of 3

"Roger Stafford"
> The problem and solution could be expressed equally well in almost any computer language...

oh... roger... after all those years you mean to tell me that there are other computer languages besides ML?...

us

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us