How is a random number generated at runtime?

algorithm, c#, programming-languages, random

Solution

You may checkout this article. According to the documentation the specific implementation used in .NET is based on Donald E. Knuth's subtractive random number generator algorithm. For more information, see D. E. Knuth. "The Art of Computer Programming, volume 2: Seminumerical Algorithms". Addison-Wesley, Reading, MA, second edition, 1981.

Problem

Since computers cannot pick random numbers(can they?) how is this random number actually generated. For example in C# we say, ``` Random.Next() ``` What happens inside?

Original source

Related problems