Question
How can I randomly generate one of two states, with the probability of 'red' being generated 10% of the time, and 'green' being generated 90% of the time?
Background
Every 2 second either a green or a red light will blink.
This sequence will continue for 5 minutes.
The total number of occurrences of a blinking light should be 300.
Random.NextDouble returns a number between 0 and 1, so the following should work:
random.Next(10)
will randomly return the numbers 0..9 and there is 10% chance of it returning 0.