Binary Detection Systems Minimizing the Average Risk