amit
Reputation
Top tag
Next privilege 250 Rep.
 Sep24 awarded Autobiographer Sep6 comment Number of combinations avoiding k consecutive elements I want to make sure we are talking about combinations and not permutations. Is 135135 valid? Sep6 comment Number of combinations avoiding k consecutive elements Combination of what length (without this restriction, there are infinite number of those if number of elements >= 3)? Or is it Permutation? May24 awarded Citizen Patrol Feb28 comment Algorithm to generate a fraction of winners based on a maximum number of players @Khal: No need for prepopulated list. When first player comes, you create a list of size n, and shuffle it, and get your first k% elements. This is actually a sublist of [1,...,500]. Assume this list contains an element i. When the ith player enters the game, he wins. Note that you did not need to know who this player is beforehand - your list only knows the index of the winners Feb27 awarded Teacher Feb27 answered Algorithm to generate a fraction of winners based on a maximum number of players