in reply to Puzzle: need a more general algorithm
So the total number of distributions of N categories into M columns is equal to the number of combinations of N-1 things taken M-1 at a time.
Dunno if this helps, but it should keep you from brute forcing more than you need. {grin}
In fact, for your particular dataset (6 categories, 4 columns), you shouldn't need to brute force more than (5 items taken 3 at a time which is) 10 tries.
Wow, that's less than I thought! But it desk checks properly. All you need is a good generating algorithm, and you can brute force this!
-- Randal L. Schwartz, Perl hacker
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: •Re: Puzzle: need a more general algorithm
by Ovid (Cardinal) on Jul 09, 2002 at 05:03 UTC | |
by FoxtrotUniform (Prior) on Jul 09, 2002 at 05:28 UTC | |
by Ovid (Cardinal) on Jul 09, 2002 at 14:17 UTC | |
by FoxtrotUniform (Prior) on Jul 09, 2002 at 15:04 UTC | |
by Ovid (Cardinal) on Jul 09, 2002 at 15:42 UTC | |
by merlyn (Sage) on Jul 12, 2002 at 19:39 UTC | |
Re: •Re: Puzzle: need a more general algorithm
by Anonymous Monk on Jul 08, 2002 at 21:21 UTC | |
by dws (Chancellor) on Jul 08, 2002 at 21:27 UTC | |
by Anonymous Monk on Jul 08, 2002 at 21:52 UTC |