Enumerating Combinations (6-from-54)
- Posted by ck lester <cklester at YAHOO.COM> Sep 11, 2000
- 398 views
Well, thanks Matt! I'm working with a combin(54,6), which produces 25,827,165 combinations... What's the least amount of memory into which I can fit all these combinations? I'm wondering if it would be smart to put all of them into a file and then use an index to all the combinations. Also, when generating random combinations using combin(54,6), what's the quickest way to check for duplicates? I'm using simple find() or match() (i forget at the moment)... But I was wondering, when I'm going to start having to check thousands of combinations for duplicates, would it be simpler to check, say, a length 3 sequence instead of length 6? For example, I might have the following in the combos group: { 1, 2, 3, 4, 5, 6 } { 1, 2, 3, 4, 5, 7 } { 1, 2, 4, 5, 6, 7 } { 1, 3, 5, 7, 8, 9 } { 1, 3, 6, 8, 9, 10 } ...ad infinitum Instead of checking the entire sequence against each other, what if i were to check just the first three (and upon finding a duplicate, THEN check all 6)? I wonder... Of course, it may not matter (in regards to the speed of checking for duplicates) until I'm up into the hundreds of thousands of combinations... just something for you guys to think about and comment on. Thanks! <\< ----- Original Message ----- From: Matthew Lewis <MatthewL at KAPCOUSA.COM> To: <EUPHORIA at LISTSERV.MUOHIO.EDU> Sent: Monday, September 11, 2000 10:09 AM Subject: Re: enumerating all the combinations > > From: ck lester > > > > Can anybody decode this into EUPHORIA? > <snip> > > Erm...no thanks... _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com