Returning random integer from interval based on last result and a seed

Suppose we have an interval of integers [a, b]. I would like to have a function that returns random members from within the interval, without repetitions. Once that all members within the interval are explored, the function would start to return the same first random sequence again, in the same order.

Example: a=1, b=5

3, 1, 4, 5, 2, 3, 1, 4, 5, 2, 3, 1, 4, 5, 2, ... 

This would be easy to achieve by shuffling an array of all elements between a and b, and repeating it once the array is finished. However, this would take too much memory space, and this is not suitable for my case (I might have millions of elements).

Instead, the function I’d like to have would be more or less like this:

f(a, b, n, seed) -> n+1 


a - start of interval b - end of interval n - last element returned from list seed - self-explanatory n+1 - next random element from list, calculated by using the seed and the last element returned (n) 

The trick is knowing some way to get a non-repeated number from the interval based only on the element returned before and the seed. In the end, it would behave like a circular list randomized at its initialization, but without using memory space.

Is it possible to find a seed based on 10,000 generated random numbers?

I’m currently entertaining an idea I’ve had about procedurally generating a world. I would like the entire world to be procedurally generated on the fly. So when a chunk is loaded, it uses a seeded random number generator to create the terrain and objects. It is seeded to maintain persistence. This is nothing new.

Next, I want the player to be able to come in and manipulate the environment (destroy blocks, place blocks; I’m using a minecraft type recreation right now to test the idea because the blocky environment is simple to work with). If we simply used a seeded random number generator, the player’s changes would get overwritten once the chunk is discarded and reloaded. So what if we use the new block locations in the scene to generate a seed for a random number generator that will generate the environment. We know the exact order that it will generate blocks, so each time a number will be generated, we know what that number should be. I’ve looked around the cybersecurity forums a bit but haven’t found a good explanation of retrieving seeds given ordered generated numbers. If this works you could save a large scene in only the seed it takes to generate it.

Please let me know if this idea is stupid and should be thrown away, thanks!

If current time in milliseconds is considered good enough random seed for a pseudorandom number generator, why not just use that time directly?

I was reading about pseudorandom number generators and how they need a seed and how that seed is usually current system time in milliseconds. One of the most common algorithms is the linear congruential generator, which is an algorithm that based on some fixed constants and this seed through some mathematical computations gives the final pseudorandom output.

But what are the disadvantages of using this time directly as a pseudorandom number?

Raid recipe in seed files

I have the following hardware setup:

3×8 disks combined in a hardware raid, so the system sees

  • /dev/sda
  • /dev/sdb
  • /dev/sdc

Each of these logical volumes is 6.4 TB in size.

I’m trying to create a seedfile that’s able to install this system automatically.

What I want is for the root partition to use all of /dev/sda and /dev/sdb and /dev/sdc on another mountpoint called /var/local using a striped array of /dev/sdb and /dev/sdc

(I know this is less than ideal, but due to a variety of reasons, this might be the only workable solution for now)

Unfortunately, I found the documentation to be quite lacking. This is what I’ve came up with.

### partitioning ##################################################### d-i partman-auto/disk string /dev/sda /dev/sdb /dev/sdc   #d-i partman-auto/choose_recipe select atomic # <raidtype> <devcount> <sparecount> <fstype> <mountpoint> <devices> <sparedevices>  d-i partman-auto-raid/recipe string \         0 2 0 ext4 /var/spool/ras   /dev/sda3#/dev/sdb3 .  d-i partman-auto/expert_recipe string                         \     root ::                                                   \          32768 32768 32768 linux-swap                         \                   $  primary{ } method{ swap } format{ }        \          .                                                    \          200000 300000 -1 ext4                                \                   $  primary{ }                                 \                   method{ format } format{ }                  \                   use_filesystem{ } filesystem{ ext4 }        \                   mountpoint{ / }                             \         .                                                     \                                                               \     multiraid ::                                              \                 .                                             \                 100000 300000 -1 ext4                         \                         method{ raid }                        \                 .                                             \ 

Unfortunately, I have to do this pretty much blind, as I do not have a system for testing available. I’ve copied the number in /dev/sda3 from another example – I also do not know whether this is correct. I’m also not sure about the exact difference between the auto-raid string and the expert recipe string. Some pointers in the right direction would be very welcome.

If I seed a CSPRNG with a truly random number and call the output, does this make the number more, less or equally “random”?

If I have a JavaScript CSPRNG such as isaac.random(), and I seed it using a truly random number T as such: isaac.seed(T), does this make the result of the CSPRNG more, less, or equally random?
I would imagine that with a CSPRNG such as isaac, (Which has passed TestU01) that the result would not add any randomness since isaac produces numbers indistinguishable from truly random values.
The concern I have is if this would cause less “randomness”.

Is finding a minimal set of seed variables for a complete deduction of a system of equations NP-complete?

Suppose we have a set of variables $ V$ . We also have a set of equations $ E$ , which are sets of at least two variables. We don’t know anything about these equations, except if we know all but one of the variables in an equation, we can deduce the missing one.

Does there exist a set of variables $ R \subseteq V$ with $ |R| \leq k$ such that revealing these variables allows us to deduce all variables?

Is this problem NP-complete? What if all equations have degree $ \leq d$ ?

I’m ultimately interested in the search version of this problem (where we actually need to find minimal $ R$ ).

Is it possible to transfer data with a really unique seed of a psudo random number generator

I have thinking about this idea for over 5 years and i don’t have the complete technical knowledge to fully grasp the idea I’m having.

The premise of the idea is to have an extremely high base number system like base 85 / Ascii85.

Then use that high base number to express an extremely verbose seed for a pseudo random data generator.

Then using your data generator, generate out data to a specified length of characters.

The business case for this would hopefully be a way of transferring data in an extremely compressed format that is actually just a function expression of how to calculate out your large set of data.

So for example if you want to move 10 gigabytes of data, you somehow serialize that 10 gigabytes down into a random seed that propagates back out into the same 10 gigabytes again.

The reason for something like Ascii85 is so that you could express a high amount of unique permutations.

This idea is probably completely crazy and or incorrect, but i have wondered about it for so long i really wanted some advice on it.