Because both X and Y have 12 protons, they have the same atomic number, which is magnesium. Because we only have 10 electrons in Y, the effect of nuclear charge on the electrons is greater than that on12 electrons. As a result, the radii of Y are smaller than those of X.
From electron arrangement
X – 1s2 2s2 2p6 3s2 = 2, 8, 2
Y – 1s2 2p2 2p6 = 2, 8
Since Y has fewer energy levels it’s atomic radius will be smaller than that of X.