To represent 50 different 'things' (e.g., states), you need 2log50 = 6 bits.
With 1 bit you can represent 2 things, with 2 bits 4 things, with 3 bits 8 things and so forth (it doubles everytime). 5 bits is not enough because then you're at 32, but 6 bits suffices because you then have 2^6 = 64 possibilities.
Your numbering could start at 000000=Wyoming, 000001=Arizona, 000010=Vermont. The numbering continues like 000011, 000100, 000101, etc. all the way up to 111111, that's the last number.