Hi, little challenge I was thinking...
you have a lotto grid of N numbers. you have to pick K different numbers. order doesn't matter.
my challenge : write an algorithm that generates 1 random pick combination.
example with N=6 and K=3 , 1 pick would be (1,3,6)
constraints :
- you can call Random function only 1 time. ( this Random function can manage numbers of any size you want )
- N and K are very big - I mean, you can't iterate all the possibilities
- all pick combinations must have the same chance to be generated
on my side, I think I have an idea of solution, but I'm not happy with it, because it would imply some complex looping. I assume the start is to generate a random number between 1 and binomial(N,K)...