A modern human is exposed to numerous stresses associated with an intensive lifestyle, the impact of aggressive factors of man-made habitat, high rates of urbanization, etc. This led to the need to correct a considerable part of the lifestyle, as well as approaches to nutrition. It is especially topical for children and youth, since during this period all the body systems are initiated and formed, ensuring its normal operation throughout the rest of life. One of the key tasks of preserving and improving the health of the population, especially in childhood and adolescence, is the need for balanced nutrition in terms of the proportion of nutrients consumed. These include proteins, fats and carbohydrates, as well as the number of macro- and microelements, such as iron, copper, zinc, etc. We will present an example of calculating the optimal food ration from the point of view of material costs, satisfying the required balanced nutrition of children and adolescents. It is studied by algorithmic means from the standpoint of a statistical approach to the task of the initial physico-chemical data on the composition of the product.