|
-
Jan 8th, 2010, 09:06 AM
#1
Thread Starter
Addicted Member
Random with weight
Hello fellow VB-ers!
I'd like to ask you a programming problem which is bothering me for quite some time now. Here is the problem
I'd like to pick random names from:
-peter,50
-rick,25
-linda,12.5
-dennis,6.25
-rob,6.25
After each name is the probability that the name is picked. To explain it the other way round; If you took 100 random names, Peter would occur about 50 percent of the times.
I've figured that you your fill and array with 100 string spaces, and fill peter 50 times, rick 25 times etc. But there must be a better way to do that!
Thanks for thinking along!
Lectere
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
|