I need a function that returns True or 1 or whatever for a given probability. For probabilities of the form p=1/n where n is an integer this is easy but for p=m/n this seems to be more difficult. For p=3/10 it could be achieved with
r=RandomInteger[{1, 10}];
If[r==1||r==2||r==3,c=1,c=0]
So c=1 will be returned with p=3/10 but I am wondering if there is not a standard function for that purpose. Any ideas?