Answer: 170 HES and 90 XOM
Hi! Let's say you bought A HES shares, and B XOM shares. As you invested $22,240, yo have that:
[tex]22,240 = A*80 + B*96[/tex] (80 and 96 are the initial prices)
3 months later those prices decreased to 64 and 80, and you sold your shares at those prices, then:
[tex]18,080 = 64*A + 80*B[/tex]
This is a system of two linear equations and two unkowns A, B. You can solve it getting A from first equation:
[tex] A = (22,240-B*96)/80 [/tex]
And then replacing A into the second equation you can find the value of B. Then replacing B in the third equation you get A.