I'm looking for what I think is a random number generator, it should have the following properties, but I'm completely uncertain how to look for a suitable algorithm. I'd appreciate either pointers to a specific algorithm, a class of them, places for starting my research, or an explanation of why what I'm looking for isn't feasible.
Given a set of N items (item 1, item 2, … item N) I'm looking for what I presume is a pseudo random number generator that will:
- for a given positive number input (A) return a deterministically chosen item (item B) —
g(A) = B
- where B is always between 1 and N inclusive
- where two consecutive inputs will never return the same output —
g(A) != g(A+1)
- where
g(A)
is frequently not equal tog(A+N)
— ie. it's not just a repeating sequence - any N consecutive outputs have a reasonably high probability of being the full set of 1 to N.
- there's a broadly uniform chance of getting any B for a given A.
g(A)
can be calculated without knowingg(A-1)
Can anyone help?