(b) We assume that origin is situated at the $O_{1}$
$\therefore\ x_{1} = 0,m_{1} - m,$
$x_{2} = 3a,m_{2} = 2m$
$\therefore\ x_{CM} = \frac{m_{1}x_{1} + m_{2}x_{2}}{m_{1} + m_{2}}$
$= \frac{m \times 0 + 2m \times 3a}{m + 2m}$
$= \frac{6ma}{3m} = 2a$