So what you want to do is like shuffling a deck of cards, but you only have
15 cards.

The way I always handled that kind of thing was to make an array of the
right length (N=15), initialize it with identity values (so array[1] = 1,
array[2] = 2, etc). Then write a loop that goes from 1 to N. In the loop,
generate a random number from 1 to N and swap the array value at the current
loop index with the array value indexed by the random number. Each run
through this loop is a "shuffle".  To get a nice randomization, shuffle the
deck seven times.

        Mark

-----Original Message-----
From: Dobris, Eric [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 18, 2002 12:58 PM
To: CF-Talk
Subject: RE: Random Iterations -


Yes, 
I just need to be able to generate them and choose 40 random combinations.
I don't need to actually buld a table with 
1,307,674,368,000 rows.

Eric
-----Original Message-----
From: webguy [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, December 18, 2002 12:37 PM
To: CF-Talk
Subject: RE: Random Iterations -


BTW you know there are

1,307,674,368,000

different non-ordered sets????

WG

> -----Original Message-----
> From: webguy [mailto:[EMAIL PROTECTED]]
> Sent: 18 December 2002 17:15
> To: CF-Talk
> Subject: RE: Random Iterations
>
>
> That requires a pretty intense algorithm, you going to be doing this 
> often? I'd recommend doing this in C or Java... What platform?
>
> If it's the same 15 numbers just do it once !
>
> WG
>
> > -----Original Message-----
> > From: Dobris, Eric [mailto:[EMAIL PROTECTED]]
> > Sent: 18 December 2002 16:45
> > To: CF-Talk
> > Subject: Random Iterations
> >
> >
> > Hi Everyone,
> >
> > I have a problem I can't figure out and I am hoping someone on the 
> > list can help me figure out how to do it.
> >
> > I need to generate iteration tables.
> >
> > For Example:
> >
> > For a 3 digit iteration:
> >
> > All The possible combinations for these 3 digits; 1 2 3
> >
> > I would end up with:
> >
> >     1       1,2,3
> >     2       1,3,2
> >     3       2,1,3
> >     4       3,2,1
> >     5       2,3,1
> >     6       3,1,2
> >
> >
> >
> > I need to auto generate tables with up to 15 digits.
> >
> > Can anyone figure out the code to do this?
> >
> > Any help would be appreciated.
> >
> > Thanks,
> >
> > Eric Dobris
> >
> 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

Reply via email to