The problem of increased reliability of parts is solved in the direction of obtaining the characteristics of their surface layer, providing the highest possible wear resistance. Tolerances on the accuracy of the machine, set on the basis of its functionality, are divided into tolerances for the manufacture of the machine and wear tolerances. In order to increase the reliability of products, they strive for the greatest possible tolerance for wear, increasing the accuracy of parts manufacturing. As a result, the costs of manufacturing the machine unnecessarily increase. The dependence of the rate of wear of parts on the roughness and hardness of their surfaces is extreme; therefore, the task of determining the parameters of the surface layer of the parts is optimization. The use of the wear rate of rubbing surfaces is justified as an optimization criterion. The technique and algorithm for assigning the parameters of the surface layer, providing a minimum rate of wear of the mating surfaces are presented. To solve this problem, a random search method was used. A method for calculating the tolerances for the manufacture and wear of mated parts operating under friction conditions is proposed.