hari6988's blog

By hari6988, 13 years ago, In English
Hi, guys ... This is my first blog ... I am completely new to algorithms ... I have just taken it up and I really love it ... I love searching for puzzles each day and try solving them... right now, i am very bad at it ... I hope to improve ASAP and be good one day ... cheers... A problem for u all so that u dont get bored ;) 

You are given a set S of n numbers. You must pick a subset S' of k numbers from S such that the probability of each element of S occurring in S' is equal (i.e., each is selected with probability k/n). You may make only one pass over the numbers. What if n is unknown?
  • Vote: I like it
  • +16
  • Vote: I do not like it

13 years ago, # |
  Vote: I like it 0 Vote: I do not like it
at ith iteration, take the new one by 1/i probability.