Confused over Stopband attenuation and stopband ripple
I understand that the stopband ripple can be given by the following:
  
  Stopband ripple = −20log10(δs) 40 = −20log10(δs) δs=0.01


Where does that come from? I have never heard the term "stopband ripple". 

Stopband attenuation of 40 dB means that in the stop band any level of -40dB OR LESS is allowed. How much less than -40dB or where it hits -40dB isn't a controlled variable. -50dB, -60dB etc all are fine.