(a) Nitrogen (2, 5) has 5 valence electrons and each hydrogen has 1, so the molecule has 5+3=8 valence electrons. Nitrogen needs 3 more electrons to complete its octet, so it shares one electron with each of the three hydrogen atoms. This uses 3 of nitrogen's electrons; the remaining 2 stay on nitrogen as a lone pair.
- Shared pairs: 3 (one N–H bond to each hydrogen)
- Lone pairs: 1 (on the nitrogen atom)
Count: 3 shared pairs (6 electrons) + 1 lone pair (2 electrons) = 8 electrons. Nitrogen has 8 electrons around it, and each hydrogen has 2 (the duplet of helium).

(b) The number of bonds an atom forms is the number of electrons it needs to share to complete its outer shell. Carbon (2, 4) has 4 valence electrons and needs 4 more to reach an octet, so it shares all four of its electrons with four hydrogen atoms: four bonds and no lone pair. Nitrogen (2, 5) has 5 valence electrons and needs only 3 more, so it forms three bonds; its other two electrons are not needed for bonding and remain as a lone pair. So carbon is tetravalent, while nitrogen in ammonia is trivalent.