Random Pun Generator

I didn't understand the math, so the teacher summed it up for me.