The complete question is
Two bags are to be put altogether with $5$ red and $7$ white balls, neither bags being empty. How must one divide the balls as to give a person who draws one ball from either bag the least chance of drawing a red ball?
Let $a$ be number of red balls and $b$ be number of white balls in in bag 1. Similarly, $c$ and $d$ are the red and white balls in bag 2. I need to minimise
$$p = 0.5 (\frac{a}{a+b} + \frac{c}{c+d})$$
$0.5$ being the probability of picking one of the two bags. Beyond this point I am stuck. More related to optimization than probability I guess. Can anyone explain the approach to this problem?
Thanks in advance
Vikrant