Possible valid and invalid codewords
There's no such thing as a "valid" or "invalid" codeword. If a string of bits is a codeword in a particular code such as a Hamming code, it's "valid"; if it's not a codeword, it's "invalid".