Is there a way to figure out the price of specific items by only knowing the totals of different combinations of them?

I don't understand why this question would get downvoted, this is a really interesting question.

__

There are two main approaches that come to mind, graph theory and linear algebra. I think the linear algebra better. Suppose your store sells n products and you have k receipts. Label your products 1,2,3,...,n.

To each of your receipts, you can assign a vector in R^n by putting the number of times the ith product was bought in that particular receipt in component i of your vector. Where it gets interesting is whether all your products are bought on a discrete basis or not, for example, can you sell 25.9393493 pounds of rice? Or are your components going to be integers? Either way, name this set of vectors of all your receipts H.

Now, the prices you're after can be represented by an nxn diagonal matrix (call M), where the (i,i)th entry represents the price of product i. Thus, for any vector h in H, you have that Mh (matrix-vector multiplication) = the cost of that receipt.

You will be able to know the exact price of every product if and only if span(H) = R^n. As a proof:

Suppose span(H) = R^n. Then the standard basis vectors of R^n (which are the exact vectors you're after) can be written as linear combinations of vectors in H. Suppose you want to know the price of the ith product your store sells, and further suppose there is some linear combination of vectors of H, called W such that W = i. You have enough information to compute MW = Mi, but then that would tell you what the (i,i)th entry of M is, so you know the price of i.

Suppose now that span(H) != R^n. Then, H is not a basis for R^n. So H does not contain any basis for R^n. So there exists some standard basis vector of R^n that you can't compute as a linear combination, and so you can't get the price.

/r/math Thread