Recipe/Theory/Linear algebra

From Open Food Facts wiki
Revision as of 12:56, 24 February 2025 by Aleene (talk | contribs) (Created page with "I have been puzzled by the fact that many of the solutions we find are exact (variance 0). This would imply that the LS-fit found an exact solution, which is only possible for...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

I have been puzzled by the fact that many of the solutions we find are exact (variance 0). This would imply that the LS-fit found an exact solution, which is only possible for a determined system of equations. The answer lies in the bound ingredients. A bound ingredient puts two ingredients together and treats them as one. This reduces a product with 8 ingredients and 6 nutrients to one of 6 ingredients. And this makes the problem determined. There is no longer need for fitting and one can just solve the remaining 6 equations. And indeed if I solve those equations, I get the same results as the LS-fit.

So we have been overcomplicating things. The LS-fit always seems to reduce the complexity. If we can find out how it does this, the recipe question is reduced to a linear algebra problem. Whether one can reduce the complexity of the equations is related to the rank of the matrix (read ingredients). Two ingredients that are to similar decreases the rank, which allows the LS-fit to reduce the number of ingredients used. And then linear algebra can be used to find the recipe.

For an overdetermined system (more ingredients than nutrients) there is theoretically no single solution. The recipe stretching confirm this. Stretching breaks the bound ingredients, but then bounds another ingredient. And this gives again an exact solution. When one stretches to much even bounding does not help and one needs a LS-fit to find a solution. Where lies these break points? If we can define these break points, we could define a range of possible recipes for product. I suspect this can be solved mathematically.

Determined systems

These are products where the number of ingredients equals the number of nutrients.

Underdetermined systems

These are products where the number of ingredients is less than the number of nutrients.

Overdetermined systems

These are products where the number of ingredients is more than the number of nutrients.