When atoms of different nonmetals combine, the nature of covalent bonding - sharing electrons - often dictates that a certain number of atoms of each of the different elements combine with one another in order for the bonding to work out just right. This establishes a certain ratio of atoms, which in turn establishes a certain value for the composition of the material, which makes it a compound. In short, the nature of covalent bonding dictates that atoms of nonmetal elements combine with one another to form compounds .
What causes elements to combine covalently in specific ratios of atoms? Returning to our first example, when H and Cl are mixed, each one "needs" one more electron to achieve octet/duet rule happiness. This is accomplished by sharing exactly one pair of electrons between exactly one H and exactly one Cl. So when the dust settles, H and Cl must be paired up in a 1:1 ratio.
The number of electrons a non-metal needs to satisfy the octet/duet rule is called its valence. (In "valence electron," the word is used as an adjective; now we are using it in a slightly different context as a noun). Hydrogen and the halogens all have valences of one. Oxygen and its group have valences of two, three for nitrogen and its group, and carbon four. Using this concept of valence, we can make some predictions about the basic structure of some compounds. We'll see that in action now. In the next section, we'll start branching out into a wider world of molecules.
Hydrogen has one electron in its outer shell and it needs one more electron. Carbon has four electrons in its outer shell and it needs four more electrons. The "need" ratio of H:C is one-to-four so a reasonable atom ratio would be four-to-one. Each hydrogen can give the carbon atom one electron. Since the carbon atom needs four electrons, it bonds to four hydrogen atoms. That gives us the formula for a compound between carbon and hydrogen of CH4. The structure they form can be seen below.
This approach should feel familiar to you from your study of ionic bonding. There, you balanced charges to find formulas - here you are balancing valence. It's good to note the similar pattern, but it's also dangerous to get too tied up in it, because covalent bonding is a lot slipperier than ionic bonding.
For example, with the elements K and S, there is only one possible compound they can make: K2S. However, with C and H, a huge array of compounds are possible, with C2H6, C3H4, and C6H6 just a few of the possibilities.
*Note that the "+" signs at right represent atoms being bonded, not charges
Next, let's consider hydrogen and nitrogen. Hydrogen has one electron and needs one more electron. Nitrogen has five valence electrons and needs three more electrons. Notice how three hydrogen atoms can move in and bond to the nitrogen to share electrons, form three covalent bonds and provide the electrons that nitrogen needs.
Since the nitrogen needs three electrons and each hydrogen has one, you end up with NH3 as the formula for the compound. Notice that not all of nitrogen's electrons got bonded. The nitrogen started with five electrons around it; two of them were paired up and three were not. Those three were shared with hydrogen; and each hydrogen, in turn, shared its one electron with the nitrogen. So the nitrogen ends up with eight electrons around it and each hydrogen ends up with two.
By now, you are familiar with the formula for water: H2O. You probably knew it before the course started; it is probably the most well-known chemical formula.
As you have probably already intuited, this formula, like those above, can be predicted from the valence of hydrogen and oxygen. Oxygen needs to make two bonds to get to a full octet, and hydrogen needs to make one. Thus, a 1:2 ratio of O to H.
This one is slightly more complicated; we no longer have hydrogen, with its nice simple bonding pattern. If we look at the elements involved, carbon (with its four valence electrons) needs four more to reach an octet. Oxygen has six, so its valence is two.
The ratio of valences here is 4:2, which simplifies to 2:1. So we expect to see a 1:2 ratio of carbon to oxygen, and indeed, that is what is observed. We get a formula of CO2.
In the previous examples, we always put the C/N/O atom in the middle, because hydrogen only ever makes one bond. In this case, we have an option of whether to put the C in the middle or one of the O atoms. For reasons we will get into later, we choose to put C in the middle.
In this case, we will not be able to simply make single bonds. Carbon needs four bonds, and each oxygen needs two. So each oxygen will need to be double bonded to the carbon. This gives us the structure at right.
Let's examine oxygen and nitrogen next. Oxygen needs two electrons. Nitrogen needs three electrons. By using the ratio, we can figure that we must have two nitrogen atoms and three oxygen atoms in order to have each element share the same number of electrons. Again the number of atoms of each element is just opposite the number of electrons needed by each element. Thus the formula for this compound is N2O3.
We won't try to figure out an electron dot diagram for this one because it does not have just one central atom. However, as a more advanced exercise, see if you can work out a structure that fulfills the octet rule of all five atoms involved. If you try this, you should be aware that this structure cannot be made by simply lining up atoms and pairing electrons into bonds. You will need to move electrons around a bit. Your goal should be to create a structure where all five atoms obey the octet rule. Give it a try!
As I have alluded to earlier, the framework of valence, while useful, has serious limits in predicting formulas. I mentioned above the multitude of compounds formed by carbon and hydrogen, which cannot be predicted simply using valence. Similar problems arise with carbon and oxygen: while CO2, above, is one compound they can form, they can also form CO. Nitrogen and oxygen, in addition to forming N2O3, can also form NO, NO2, N2O, N2O4, and other compounds.
You will not be expected to know or predict these diverse and seemingly random formulas. However, you will be expected to take a formula for any molecule with a single central atom and draw a Lewis structure for it. This will be the topic of the next section.