I am wondering if there is a way in Mathematica, a special function perhaps, which would return true or false based on a certain probability I give it. Like Prob[0.7] would return 1: 70% of the time and 0: 30% of the time. I could do something like this of course:

```
prob=10; (* 1% chance *)
val = RandomInteger[{1, 1000}];
If[val<= prob, True, False];

```

But this becomes slightly difficult when I need very specific probabilities like 0.21321312444. Or even variable probabilities which would come from a certain function returning different values every time step.