PHP /数学百分比百分比[关闭]

I am working out what the changes of a horse winning a race is from the previous records of each horses.

Horse 1 has won 5% of his races

Horse 2 has won 7% of his races

Horse 3 has won 12% of his races

Now if 3 horses are running in this final race, how do I split 100% between these 3 horses?

By doing this I guess :

5 + 7 + 12 = 24

Horse 1 :

5 * 100 / 24 = 20.83

Horse 2 :

7 * 100 / 24 = 29.17

Horse 3 :

12 * 100 / 24 = 50

(20.83 + 29.17 + 50 = 100)