Calculating maximum data rates
The difference between the two formulas arises from the fact that the Nyquist formula uses the number of encoding levels that was explicitly given (16 levels implies 4 bits/baud), while the Shannon formula is the theoretical maximum based on the SNR of the channel (40 dB implies about 6.64 bits/baud).

3000 Hz &times; 2 baud/cycle &times; 4 bits/baud = 24000 bits/sec

3000 Hz &times; 2 baud/cycle &times; 6.64 bits/baud = 39840 bits/sec