Who is good at maths?

This is the solution I wrote to the problem presented in Part 1.

Part 2: the solution

Let:

I said to the programmer who had presented the problem: ‘Now, you said that the total of all probabilities must be equal to one, so we have’:

w+b+m+r=1(1) w + b + m + r = 1 \qquad{(1)}

At this point another programmer who had come over to my desk said: ‘How the hell do you solve an equation with four unknowns?’

‘Well, first, we have more information, because he said that for every wizard, there should be two bladesmiths. This means that it is twice more probable to be a bladesmith than a wizard’, i.e.:

b=2w(2) b = 2w \qquad{(2)}

Similarly:

m=4w(3) m = 4w \qquad{(3)}

r=8w(4) r = 8w \qquad{(4)}

‘Since bb, mm and rr can be expressed in terms of ww, we really have only one unknown, ww’. Which we solve by substituting eq. 2, eq. 3 and eq. 4 into eq. 1:

w+2w+4w+8w=1 w + 2w + 4w + 8w = 1

15w=1 15w = 1

w=115(5) w = \frac{1}{15} \qquad{(5)}

Having found the value of ww, we trivially find the values of bb, mm and rr by substituting eq. 5 back into eq. 2, eq. 3 and eq. 4:

b=2w=2×115=215 b = 2w = 2 \times \frac{1}{15} = \frac{2}{15}

m=4w=4×115=415 m = 4w = 4 \times \frac{1}{15} = \frac{4}{15}

r=8w=8×115=815 r = 8w = 8 \times \frac{1}{15} = \frac{8}{15}