Item1 Price: $1
Item2 Price: $2
WAP (weighted average price): $1.5
Correct Answer: 50% of item 1 and 50% of item 2 would have a WAP of $1.50
But how would I calculate the percentage of each needed to back into a weighted average price of $1.79 for example (where the percentages of each aren't obvious)?
Let the price of item 1 be $p_1$ and the price of item 2 be $p_2$. Then if the weighted average price is $w$, we want to solve for the weight $\lambda$ such that $$w = \lambda p_1 + (1 - \lambda) p_2.$$ This gives us $$(p_1 - p_2) \lambda = w - p_2,$$ or $$\lambda = \frac{w - p_2}{p_1 - p_2}.$$
Note that $0 \le \lambda \le 1$ if and only if $p_1 \le w \le p_2$.
So for your example, $p_1 = 1$, $p_2 = 2$, and $w = 1.79$. Hence $$\lambda = \frac{1.79 - 2}{1 - 2} = 0.21,$$ which means that the weight is $21\%$ on item 1, and $79\%$ on item 2.