Well, my student had a cool result that I simply could not explain. In her code, she wants to create random circles (in WPF) with random colors. She made the typical mistake of starting out creating more than one random number generator, but naked with me, please.
This is the code:
Random cir = new Random(); Random color = new Random(); for (i = 0; i < 100; i++) { int r = cir.Next(0, 50); diameter = r * 2; int posx = cir.Next(0, (510 - diameter)); int posy = cir.Next(0, (280 - diameter )); byte c1 = (byte)color.Next(255); byte c2 = (byte)color.Next(255); byte c3 = (byte)color.Next(255); SolidColorBrush usedcolor = new SolidColorBrush(Color.FromRgb(c1,c2,c3 )); Ellipse circle = new Ellipse(); circle.Height = diameter; circle.Width = diameter; circle.Margin = new Thickness(posx, posy, 0, 0); circle.Stroke = usedcolor;
This will always generate the same effect: the colors look “grouped”, you will always get the same colors in the same region. Two examples: 
I understand that two random generators are created in the quasi-exact same moment and therefore have the same seed and are basically “synchronized”. However, since we require different ranges each time, I thought this would lead to uncorrelated numbers, but I'm clearly mistaken. (Range does not affect? Does Random.Next always produce a number from 0 to 1, and then expand it (denormalise?) To the desired range?)
Even with a simple call to another Next () parameter in a circus or color (for example, color.Next (1);) it generates a completely random shape at will, and not a cold, but undesirable effect.
So, my main question is: why are these colors “grouped” and what aspect of random number generation and “synchronized” generators do I miss?
Hope this explanation is complete and someone can help me. Thanks a bunch!
PS Here the desired result (using 1 Random or adding a useless Next () - call) 