5 is CORRECT. It takes at least 5 literals to represent m31 because 5 literals are required to form 2^5 = 32 minterms. Also observe that the minterm code for m31 is 11111; since (11111)2 =(31)10. Thus 5 literals (variables or their complements) are required to support this 5 bit code.