Math Behind One Hot Encoding