Think : it is very simple. you have invited 15 couples and you and your roommate you are total 32 persons.
Now you alone you must shake hands with all your invitees who are 31 total therefore the total hand shake you will do will be 31.
Now what you did everyone has to do...and since there are 32 invitees including you the total shake hands apeared to be 32x31= 992
But you must take into consideration that you and the person x ( anyone from the guests) you have shaked hands twice.
therefore you must divide 992 by 2 to find the exact number 496 shakes.
in this shakes is included the shake with your roomate as well.