The acceleration due to gravity on a large body is given by:
acceleration = (gravitational constant * mass of body) / radius²
For b, this is:
g = GM/r²
M = gr²/G
For a,
g(a) = 1/6 g
r(a) = 1/4 r
M(a) = g(a)r(a)²/G
M(a) = 1/6 g * (1/4 r)²/G
M(a) = gr²/96G
The fraction is given as:
M(a) / M = (gr²/96G) / (gr²/G)
M(a) / M = 1/96
The mass of planet a is 1/96 of the mass of planet b.