<3 Discrete math... makes up most of my favorite courses when I was in college.
Anyway, I've never really gotten into nervous habits for exams or whatnot. Sure I might be somewhat worried/anxious before it, but I'm relatively calm and relaxed for exams, despite generally cramming my ass off the night/hours before.
I usually only express "nervous habits" when I have to talk to peole. This is before talking to them, i.e. gathering my thoughts/preparing what to say. My go-to moves include the head scratch, shoulder scrath, leg scratch, back stretch, and finally, the head turn. Now this turn may be left or right, and I'm strill trying to figure out what causes the type of turn.

But once I actually get to the talking, I'm pretty okay.
Now that I think about it, this habit also applied for most of my brainstorming in general, from something like coding projects or reports to something smaller such as this forum post. So maybe it's not really nervousness... just a habit. :/
Jam it back in, in the dark.