The boy can dispose of each question in two ways. He may either solve it or leave it. Thus the number of ways of disposing of all the questions = 25.
But this includes the case in which he has left all the questions unsolved.
Hence the total number of ways of solving the paper = 25 – 1 = 31.