Jaymond Flurrie
Well-known Member
- Joined
- Sep 22, 2008
- Messages
- 921
- Office Version
- 365
- Platform
- Windows
I need to pick up to 100 000 numbers from possible million and these 100 000 must match my criteria. If less than 100 000 matches that's ok, I'll just have less results. Let's say I get 250 000 matches, so I need to discard 150 000 of those results.
Now the question is that can I somehow make this "fair" to all matching numbers if I just first fill an array of 100k elements and after filling the array, if I get over 100 000 I make take a random number between 0 and 100 000 and overwrite the one I got - if I get exactly 100 000 I discard this new one.
Do I have an equal chance in this scenario for discarding the first result against discarding the result #250 000?
Now the question is that can I somehow make this "fair" to all matching numbers if I just first fill an array of 100k elements and after filling the array, if I get over 100 000 I make take a random number between 0 and 100 000 and overwrite the one I got - if I get exactly 100 000 I discard this new one.
Do I have an equal chance in this scenario for discarding the first result against discarding the result #250 000?