I have this problem to set up:

The color of a traffic light is green 40%, yellow 10% and red 50% of the time.
I started with random numbers but figure I have to label these random numbers so they fall respectfully with the colors percentages. I can't
figure our the formula to make it work

green 0.1000 0.4999
yellow 0.0000 0.0999
red 0.5000 0.9999

Green .1000-.4999 Yellow .0000- .0999 Red .5000-.9999
Random# Result

0.115020978 0.0000 0.0999
0.44301443 0.1000 0.4999
0.584649944 0.5000 0.9999
0.444234756
0.815282943
0.523755545