Statistics for Error-Detecting and Error-Correcting Using Hamming and Cyclic Codes