Finding amounts of ingredients in a food based on nutrients Imagine that there are 50 ingredients, $I_{(1-50)}$, cake can possibly be made out of. Our friend makes a cake from unknown amounts of these ingredients. Therefore the cake $C$ is composed as such:
$C = \sum\limits_{n=1}^{50}{k_{random}I_{n}}$
Where $k_{random}$ is a random positive real number of any amount, and may be zero.
The ingredients $I_{(1-50)}$ each have certain known nutrition components — let's assume each ingredient is composed of 10 nutrients, where each nutrient is the mass of that nutrient in the ingredient.
Our friend gives us the final nutritional values for the cake $C$. Even though we do not know the ingredients, can we find them out and their amount from the list of nutritional values?
The way I see it, the 10 nutritional components of the cake $C$ are constrained in such a way that they cannot be totally random (unless we have ingredients that are pure nutrients, because then each nutrient can independently vary).
Extra questions: In what cases can we know and not know the ingredients? What if the amount of ingredients changes, or the amount of nutrients changes? What if there is some small error?
 A: Let me make sure I understand how this works.
Our friend makes a cake using $a_1$ grams of ingredient $1$, $a_2$ grams of ingredient $2\dots a_{50}$ grams of ingredient $50$.
All that we know is that $a_i$ is a non-negative real number, these are the only constraints.
We also know for each $i$, which are the nutritional values of ingredient $i$, so for each gram of ingredient $i$ we have $i_1$ grams of nutrient $1$, $i_2$ grams of nutrient $2\dots i_{10}$ grams of nutrient $10$. The $a_i$'s are also non-negative numbers and we know the all before hand.
Our task, is given the nutritional values of the cake, to figure out each $a_i$.
So basicaly we can consider each ingredient $i$ as a nonzero vector in $\mathbb R^{10}$ . So we have $50$ vectors $v_1,v_2\dots v_{50}$ in $\mathbb R^{10}$, then we are given another vector $c$ in $\mathbb R^{10}$ (the cake)and we are asked to find the values of $a_1,a_2\dots a_{50}$ so that $a_1v_1+a_2v_2+\dots a_{50}v_{50}=c$.
So the question is , when are the $a_1,a_2\dots ,a_{50}$ uniquely determined? It depends on the actual values of $v_1,v_2\dots v_{50}$ and $c$. But it is unlikely that the $a_i$'s are going to be unique.
Some observations: Cake $c$ can be made with the ingredients if and only if $c$ is in the span of $v_1,v_2\dots v_{50}$.
Secondary observation: No matter what the nutritional properties are there will always be a cake for which we cannot deduce the quantitities of the ingredients.
Proof:
Since $v_1,v_2\dots v_{50}$ is Linearly dependent there is a vector that is a linear combination of the other vectors. Let that vector be $v_1$ without loss of generality. Then we have $v_1=\lambda_2 v_2+\lambda_3 v_3\dots \lambda_{50} v_{50}$, since the vector is nonzero some of the $\lambda_i$ are nonzero.
Now, if all of the $\lambda_1$ are non-negative then notice that if we set $c=v_1$ then we have two possible ways to express $c$, as $v_1$ or as $\lambda_1v_1+\lambda_2v_2+\dots \lambda_{50}v_{50}$.
If some $\lambda_i$ is negative let the smallest be $-j$. Then the cake $c+j(v_2+v_3+\dots v_{50})$ also has two representations, $v_1+jv_2+jv_3+\dots j_{50}v_{50}$ or $(\lambda_2+j)v_2+(\lambda_3+j)v_3\dots (\lambda_{50}+j)v_{50}$.
In any case we have found a cake which has more than one possible "mix". Therefore we cannot figure out the quantities of each ingredient that where used to make that cake.
A: Let $I_i$ be 10 dimensional vectors that represent the amount of each nutrient in one unit of ingredient $i$. 
Similarly, let $\mathbf{C}$ be a 10 dimensional vector representing the total nutritional composition of your cake.
We can represent this algebraically using matrices:
Let $\mathbb{I}$ be the $(10 \times 50)$ matrix of column ingredient vectors and $\mathbf{k}$ be a 50-dimensional vector of ingredient quantities. Then we have:
$$\mathbb{I}\mathbf{k}=\mathbf{C}$$
Now, $\mathbb{I}$ is a rectangular matrix, and hence the column vectors are not linearly independent. Recalling the formal definition of linear independence, we know that:
$$\exists \mathbf{c} \in \mathbb{R}^{50}:\mathbb{I}\mathbf{c}=\mathbf{0}, \mathbf{c}\neq \mathbf{0}$$
Therefore, $\mathrm{dim}\; \mathrm{null}(\mathbb{I})>0$, and $\mathbf{c} \in \mathrm{null}(\mathbb{I})$. Now, lets assume that we have found a solution $\mathbf{x}: \mathbb{I}\mathbf{x}=\mathbf{C}, \mathbf{x}>\mathbf{0}$. Let $\mathbf{b}\in \mathrm{null}(\mathbb{I})$ be one of the infinite number of vectors in the null space, with $||b||\ll ||x||$ (to ensure that $x+b$ remains in the positive orthant. Then, by the definition of a null space:
$$\mathbb{I}(\mathbf{x}+\mathbf{b})=\mathbb{I}\mathbf{x}+\mathbb{I}\mathbf{b} = \mathbf{C}+\mathbf{0} =\mathbf{C}$$
So, we have found another solution. We can do this for all vectors in the null space, so we have an infinite number of solutions.
Therefore, if the system has one solution, then it has an infinite number of solutions. Thus, you cannot deduce the recipe from the nutrient quantities alone: $\mathbf{C}$ with either be in the subspace spanned by a subset of the ingredients or it will not be.
A: The linear algebra part of the problem has been sufficiently beaten to death here, but I will note that if we're considering the actual problem of making a cake (as opposed to an abstract linear algebra problem being described in terms of cakes) then we have a lot of inequalities coming from physics and chemistry that will substantially reduce the solution space.
The simplest of these is that you can't have a negative amount of any ingredient.  But that's just the beginning.  For instance, you can probably replicate the nutritional data of flour by combining corn starch and peanut butter with a few other ingredients in smaller amounts, but if you try to use those to replace the flour in a recipe then what winds up coming out of the oven is not going to be a cake.  So, on the plus side, you get way more equations from the chemistry, which gives you a better chance of narrowing down the possibilities.
On the downside, though, note that many ingredients (flavoring, say) which are added in small amounts are not going to move the nutrition data a detectable amount.  So there's not going to be any effective way of reverse-engineering that. In this sense, the real-world problem is somewhat worse than the idealized linear algebra problem.
A: You can set this up as a system of linear equations in the amounts of the possible ingredients. The answers to your question hinge on the properties of this system. What happens with small changes in composition, and similar questions, is essentially to ask about the numerical stability of the solutions to the system, and so on.
