check_valid_k function

Check if max K exceeds the number of observations