Solution:
Key idea: Electrons fill 1s, 2s, 2p, 3s, 3p in order. The number of electrons lost or gained to reach a noble-gas configuration is the valency.
(a)
Step 1 — X (Z = 12). Filling 12 electrons in the order 1s, 2s, 2p, 3s gives:
1s2, 2s22p6, 3s2
X is magnesium.
Step 2 — Y (Z = 17). Filling 17 electrons in the same order, continuing into 3p, gives:
1s2, 2s22p6, 3s23p5
Y is chlorine.
(b)
Step 3 — Valencies. X loses its two 3s electrons to form X2+ (valency 2). Y gains one electron to form Y− (valency 1).
Step 4 — Balance the charges. One X2+ needs two Y−, so the formula is XY2 (that is, MgCl2).
(c)
Step 5 — Read the configuration. 1s2, 2s22p6, 3s23p6 has 18 electrons and a complete octet in the outer shell (argon). It neither loses nor gains electrons.
Therefore, (a) X: 1s2, 2s22p6, 3s2 and Y: 1s2, 2s22p6, 3s23p5; (b) XY₂; (c) the valency is zero.