Let $\displaystyle A $ be people who are high risk, $\displaystyle B $ be people who are medium risk, and $\displaystyle C $ be people who are low risk.
Lets say $\displaystyle P(A) = p, \ P(B) = q, \ P(C) = r $ and the proportion of those in $\displaystyle A $ is $\displaystyle \hat{p} $, those in $\displaystyle B $ is $\displaystyle \hat{q} $ , and those in $\displaystyle R $ is $\displaystyle \hat{r} $, where $\displaystyle \hat{p} + \hat{q} + \hat{r} = 1 $.
So $\displaystyle P(\text{high risk and in the group}) = p(\hat{p}) $
$\displaystyle P(\text{person at risk}) = p(\hat{p}) + q(\hat{q}) + r(\hat{r}) $ and
$\displaystyle P(\text{randomly chosen person is high risk}) = \frac{ p(\hat{p})}{p(\hat{p}) + q(\hat{q}) + r(\hat{r}) } $?