Random Number Output Based On Probability Distribution of Outputs I Want

For each position in a wave I want to assign it a number - 1, 2 or 3 based on a number generator outputting 1, 2 or 3. I need to specify the probability that the number generator will create 1, 2 or 3. For example 10% chance of a 1, 30% chance of a 2 and 60% chance of a 3. I can't figure out how to code this. Any help would be greatly appreciated.

C
make /N=1e5 w = abs(enoise(100)); w=1+(w>10)+(w>40)
// to check output:
sort w w; display w


displayhelptopic "enoise"

Brilliant. Thanks!

And the thing i needed to look up and understand from your code was:

 displayhelptopic "Operators"