solve rx + (1 - r)*(1 - x) == 1/2