Mathsterbation is the act of masturbating when a maths problem or assignment becomes too difficult and/or tedious to complete. It is often practised when the subject has lost all hope in completing his maths and can see no other option.
Friend 1: Hey, what did you get for question 4?
Friend 2: *fap* *fap* *fap* Go Away!
Friend 1: Mathsterbation already? That's weak...