As with the other problem, I would start this as an algebra problem before making it a programming problem. In the previous problem we had 1 equation, so we could assign any random value to all but one of the weights, and then solve for the final weight. This case is the same, but we have a system of 2 equations, so we assign random values to 9 of the 11 weights and solve for the other 2.
eq'n 1 weighted average: 38.81=A=sum(wi*xi) <-- Should already know how to solve this for w1 from earlier today.
eq'n 2 weights: 1=Wtot=sum(wi)
Shall I give you a chance to try the system of equations yourself? (A tutorial for simple systems of equations if you need an algebra refresher:
https://www.purplemath.com/modules/systlin1.htm )
Bookmarks