The math is impossible because not all information is available. You don't have future sight and the information you need to derive from is lagging. Its temporally bound to a point in time in the past.
Additionally, the process involves optimizing production from the production raw materials all the way to the end products. This includes knowing about and re-optimizing in the cases where something locally fails sometimes in the absence of people reporting it (non-deterministic).
In non-market systems, shortages cause death, and the only way to avoid shortages is to overproduce by a healthy margin, and even then that doesn't account for those unpredictable events (i.e. for example, like a shipping area catching fire and the nitrogen fertilizer blowing up in Beirut destroying all stored cargo nearby; who could have predicted that).
Anyone saying this is possible isn't a credible source. There is over 100 years of study into this problem by some of the best in their fields, and it remains unsolved.