If there's one piece of science that every kid knows, it's that twanging a ruler on the edge of the desk makes a noise, and by changing the amount of overhang will change the pitch. Give anyone a new ruler, and the first thing they'll do is twang it, to see how it sounds. This is an interesting fact of life.
To intellectualise this pastime we can say that we are discovering the relationship between wavelength and frequency (the longer the ruler overhang, the lowest the frequency of the note), and that we're listening for the timbre (pronounced tam-ber), which indicates the character of an individual sound, and is why a violin and piano sound different when playing the same note. This is less interesting fact of life.
Step 1: Prepare the rules
You will notice that some lengths do not produce notes at all. Very short distances just produce a click, while very long ones make no sound at all. To make a complete octave, the overhang of the lowest note will need to be twice as long as the shortest (highest note), so if the rules you're using only make sounds between 5cm and 8cm you won't get a full octave.
TIP: Hold the rule to the desk as tightly as possible to produce the best audio fidelity (read: twang) possible.