Artificial intelligent assistant

get new base price base on this two items? A sample first: 1) ProductA - purchased 100 quantity at 100 each - so the base price is \$100 2) ProductA - purchased another 100 quantity but this time at \$150 each. If we combine the two, the new base price would be \$125 correct? I just know that this is correct but I don't know it was derived. Anyone here would care to show me how? What if we have this scenario instead? * Purchased 100 items for \$100 each - base price is \$100 * Again we purchased 15 items for \$150 each - the new base price for this is I don't know.. What is the new base price for this item?

I doubt the question will be retained, still (it is an application of Weighted Mean):

$$((p*q) + (s*t) / (q+t))$$

Where,
p - Price of item 1
q - Qty of item 1
s - Price of item 2
t - Qty of item 2

So,

$$((100*100)+(125*100))/(100+100)) = 125$$

The solution to the second part of the question is left as an exercise to the reader. ;)

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 1d1df919167116b012b5ce9d4e401e00