(a) Atomic number of sodium atom = 11
In Na+ ion, there are only 10 electrons. The electronic configuration is 2 , 8. Therefore, the number of valence electrons in sodium ion is 8.
(b) Atomic number of oxygen atom = 8
In O2- ion, there will be 10 electrons, as it has gained two electrons. The electronic configuration is 2, 8. Therefore, the number of valence electrons in O2- is 8.