We are sending the maximum rate for 5 seconds,so we send 20 ∗ 5 = 100 Mb in 5 seconds. We can only send 150 Mb in any 10-second window, so 150 − 100 = 50 Mb, we can send in the remaining 5 seconds, so rate = 50/5 = 10 Mbps. Now, in order to ensure the bucket has enough tokens to sustain a 5-second burst at 20 Mbps, we require b = (M − rate) ∗ 5 = (20 − 10) ∗ 5 = 50 Mb bucket depth.
M-- maximum rate at which data can be send