Calculation of Tolerance Based on a Minimum Cost Approach