Planck's Quanta

Physics students often ask how Max Planck's concept of energy quanta explains the shape of the blackbody radiation curve at all frequencies. How is it if we make the assumption E=hf we are able to avoid the prediction of classical wave theory that an infinite amount of energy is released at high frequencies (the ultraviolet catastrophe) ? 

What is Planck's quantum hypothesis?  

In 1901 Max Planck proposed that the vibrating atoms in the walls of hot objects can only have a discrete set of energy values. The energy of the oscillator is said to be quantised as it can only have certain quantities of energy given by the equation E=nhf where n=1,2,3.... The energy emitted by the atoms is in bundles of value hf where f is the frequency of oscillation and h is Planck's constant.

How does quantisation explain the shape of the blackbody radiation curve?

The first point to note is that not all of the atoms in the hot object are vibrating with the same energy. The number of atoms vibrating at energy E is proportional to e raised to the power of -E/kT  where k is Boltzmann's constant and T is the kelvin temperature. The exponential factor is a statistical factor that describes the spread of vibration energies throughout the object in much the same way as there is a range of heights of people in the population. The second point to note is that when the average vibration energy of an atom is calculated the energy quantisation rule (E = nhf) causes a geometric series to be formed that has a limiting sum and so the ultraviolet catastrophe is avoided. The result is that a very large number of atoms in the hot object vibrate at low frequencies, a large number of atoms vibrate at intermediate frequencies and a relatively small number vibrate at high frequencies. The energy-frequency graph therefore has a peak in the midrange (where most of the energy is released due to the large number of vibrating atoms in this range) and is small in height at the extremities (since a very large number of atoms vibrating at a low frequency gives a low energy output and a small number of atoms vibrating at a high frequency also gives a low energy output).

He (Planck) believed that what the equations were telling him was that the packages of electromagnetic radiation could only be emitted or absorbed in amounts of hf, but that the radiation itself was a classical wave. A rough analogy might be with the relationship between a cash machine and money. The cash machine can only dispense money in multiples of $10-what you might call money elements.
— Erwin Schrodinger and the Quantum Revolution by John Gribbin, Bantam Press 2012, page 74