Problem

Revision en3, by eins, 2018-10-12 01:01:37

Hello to everybody!

There is the next task. There is a set of objects, numbered from 1 to n. It is necessary to choose from it a random object such that has not been selected before (need to select no more than n objects). The task itself to do this with O(1) memory and less, than O(n) time.

Perfectly, it needed a function with paremeters like next_object_id(n, current_id, seed), that returns id of the next previously unselected random item.

Is the problem solvable with such requirements?

If there are already developments on this topic, please give a hint on which query to search.

Tags problem

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English eins 2018-10-12 01:01:37 0 (published)
en2 English eins 2018-10-12 01:01:17 60 (saved to drafts)
ru2 Russian eins 2018-10-12 00:59:31 51
en1 English eins 2018-10-11 16:31:01 576 Initial revision for English translation
ru1 Russian eins 2018-10-11 16:17:02 610 Первая редакция (опубликовано)