2

From a mathematical point of view it's possible do what I wrote in the title?
In computer science I could resolve the problem creating an array which contains all value from 0 to 2147483647 and then shuffle the array but it requires GBs of space, another way is to generate number and save it and if it's present regenerated a new one but I need (again) lot of memory where save the numbers and the latest number could be generated after a lot of random cycle.
So there is a mathematical way for solving this problem whitout using lots of memory?

Tinwor
  • 158
  • 2
    If there is no repetition, then that is not really random. Or perhaps you are really trying to generate a "random permutation" of ${0,1,2,\ldots, 2147483647 }?$ – Geoff Robinson Jan 31 '16 at 21:32
  • 1
    I'm searching a way for generating a random permutation from 0 to n without no repetition. – Tinwor Jan 31 '16 at 21:38
  • https://en.wikipedia.org/wiki/Reservoir_sampling – Will Jagy Jan 31 '16 at 21:48
  • Would a "pseudo-random" generator be sufficient? (A generator that uses a simple formula to get the next value from the current one--it is not random but it does pass some of the randomness tests.) – Rory Daulton Feb 01 '16 at 00:42

0 Answers0