Two planets have radii R1 and R2 and densities d1 and d2 respectively. The ratio of the acceleration due to gravity on them will be :
R1d2: R2d1
R1d1: R2d2
R12d1:R22d2
R1d12:R2d22
g=GMR2=Gd43πR3R2=4πGdR3 ⇒g1g2=d1R1d2R2