jackrae is spot on. OTOH, the resistor values in either tutorial aren't terribly critical, so experiment. Try a 10K instead of 4.7K, then try two 10Ks in parallel and observe the difference in the circuit behavior. Piezo transducers are primarily a capacitive load, and so can draw large current spikes for brief intervals every time the pin toggles. The 100? resistor is to limit this inrush current so as not to exceed the limits of the microcontroller. A lot of people drive piezos without a resistor, I've done this a fair amount and no smoke yet, but using the resistor is definitely the conservative approach which will treat the MCU more gently.