This post looks at computing *P*(*X* > *Y*) where *X* and *Y* are gamma random variables. These inequalities are central to the Thall-Wooten method of monitoring single-arm clinical trials with time-to-event outcomes. They also are central to adaptively randomized clinical trials with time-to-event outcomes.

When *X* and *Y* are gamma random variables *P*(*X* > *Y*) can be computed in terms of the incomplete beta function. Suppose *X* has shape α* _{X}* and scale β

*and*

_{X}*Y*has shape α

*and scale β*

_{Y}*. Then β*

_{Y}*/(β*

_{X}Y

_{X}*Y*+ β

*) has a beta(α*

_{Y}X*, α*

_{Y}*) distribution. (This result is well-known in the special case of the scale parameters both equal to 1. I wrote up the more general result here but I don’t imagine I was the first to stumble on the generalization.) It follows that*

_{X}

P(X<Y) =P(B< β/(β_{X}+ β_{X}))_{Y}

where *B* is a beta(α* _{Y}*, α

*) random variable.*

_{X}For more details, see Numerical evaluation of gamma inequalities.

Previous posts on random inequalities: