Using Linear Programming to Construct Better Criteria for Closing the   Detection Loophole in Epr Experiments
  I formulate the problem of closing the detection loophole as a constrained optimization problem. Numerical methods can then be used to maximize the detector efficiency subject to the constraint that there exists a local realist explanation for the quantum correlations observed in the EPR experiment in question. Any detector efficiency larger than this maximum rules out all local realist explanations, and hence closes the detection loophole. 
James H. Bigelow