Simulation one value from categorical distribution
rdiscr(f)
f
An integer drawn from the categorical distribution