|
-
August 31st, 2012, 09:09 AM
#1
random partition in to k groups
How do you generate a random permutation of numbers from 0 to N without storing it in an array ?
Note that duplicates are to be avoided so I can't use rand() calls to generate them.
The problem I have is to partition N number of data points into k groups in random selection manner.
I thought of random shuffling of indices using random_shuffle of stl but the indices need to be stored in an array.
Is there a way to get N integers from [0..n] sorted in a random order, using which I can access a database ?
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|