First we create an equation based on the information given.Since each jeweller gives out 3 gems, our equation is 5r + s + p + d = 7s + r + p + d = 97p + r + s + d = 2d + r + s + p.
This simplifies to 4r = 6s = 96p = d.
We can also deduce from this equation that:
r = 3s/2 = 24p = d/4
s = 2r/3 =16p = d/6
p = r/24 = s/16 = d/96.
These are the relative values of each gem.
Then we calculate the value of each jewellers gems down to their starting gem. E.g The one with rubies to start with we calculate his value in rubies.
1st jeweller: Value: 5r + s + p + d. s = 2r/3. p = r/24 & d = 4r. So the value of his gems is 5r + 2r/3 + r/24 + 4r which comes to 9 17/24 rubies. Start: 8 rubies. End: 9 17/24 rubies. So he gained 1 17/24 rubies.
2nd jeweller: Value: 7s + r + p + d. Value in s: 14 9/16 s Start: 10s End: 14 9/16s Gain: 4 9/16s
3rd jeweller: Value: 97p + r + s + d Value in p:233p. Start: 100p End: 233p Gain: 133p.
4th jeweller: Value: 2d + r + s + p Value in d 2 41/96 d Loss: 2 55/96 p
So our answers are
The relative values of each gem are
r = 3s/2 = 24p = d/4
s = 2r/3 =16p = d/6
p = r/24 = s/16 = d/96.
4r = 6s = 96p = d.
And the jewellers gained/lost
1st: 1 17/24 rubies gained
2nd:4 9/16 sapphires gained
3rd:133 pearls gained
4th: 2 55/96 diamonds lost.
Thanks for reading and I hope you like my solution.