I would like to generate random numbers, from 1 to 10, based on the following weights:
1 → 3%
2 → 18%
3 → 22%
4 → 16%
5 → 11%
6 → 9%
7–> 7%
8 → 6%
9 → 4%
10 → 4%
(i.e.: 1 would come up 3% of the time, 2 would come up 18% of the time, etc.)
I’m not sure how to do this. Generating the random numbers is no problem but I don’t know how to apply the weighting to the generation process.
Background on the project at hand: I’m a graphics artist and I’m sometimes asked to create various designs for clients. I usually don’t have the clients text when I begin my design process. I would like to create “greeking” text to fill out my layouts with. The above weights represent the frequency that words of a given character count come up in the “typical” written word. I can generate sentences with a random number of “words” and paragraphs with a random number of sentences (both of those are simple random number generations between given ranges), but I haven’t figured out this part of the process yet.
Thanks in Advance,
Brad Bumgarner, CTA