# Probability that one random variable is greater than another

Suppose I have two random variables:

Control = BetaDistribution[24,141]


I can sample from this easy enough with RandomVariate[Var, 10]  and calculate the probability that one of the distributions is greater than a constant, e.g. Probability[x <= .2, x \[Distributed] Var].

But how do I calculate $$P(Var>Control)$$. Many thanks!

Very similar:

Probability[
control < var, {control \[Distributed] BetaDistribution[24, 141],


1191614106688032995829016253297371 / 1700223091652404809206230640390474

(roughly 0.7)

Verify numerically:

control = BetaDistribution[24, 141]

• Thanks! That's what I was looking for. One more question. How would I do it with a declared variable -- I'm not sure on the syntax there, e.g. something like: Control = BetaDistribution[24,141]; Var = BetaDistribution[30,151]; Probability[Control < Var, {Control, Var}] Sep 18 at 15:29
• control = BetaDistribution[24, 141]; var = BetaDistribution[30, 151]; Probability[c < v, {c \[Distributed] control, v \[Distributed] var}] Sep 18 at 15:36