Both Pythagoras and Ptolemy believed that the intervals between notes in music should be ratios of small integer numbers. This is known as Just Intonation. Pythagoras liked them to derived from octaves (2:1) and perfect fifths (3:2), which is 3-limit tuning. Ptolemy was more flexible, and his scales are in 5-limit tuning.
But how did they measure the relative frequency of two notes? How did they even know that the pitch they heard was a result of the frequency of vibrations?
Today, I can make a recording of a note on the flute with Audacity (audio software), and then look at the waveform to see that it repeats 440 times per second. Alternatively, I can use an electronic tuner that will instantly tell me the notes frequency.
But Pythagoras died in 495 BC, and Ptolemy died in 170 AD, so they obviously didn't have these technologies. So how did they measure the frequency of sounds and the ratios between them?