He died of a heart attack, his family said.
In 1947, while a researcher at Bell Telephone Laboratories, Mr. Hamming devised techniques for finding and correcting a single error in a string of data, as well as finding two errors and correcting one of them; the techniques became known as the Hamming Codes. Initially used by Bell in computers and telephone switches, such error correction has become common in microprocessors and digital signal processors.
Mr. Hamming was born on Feb. 11, 1915, in Chicago and earned a bachelor of science degree from the University of Chicago, a master's degree from the University of Nebraska and a doctorate from the University of Illinois, all in mathematics. He was an assistant professor at the University of Louisville when in 1945 he was recruited to join the Manhattan Project, in Los Alamos, N.M. There he managed the computers used in building the first atomic bombs.
When the war ended, Mr. Hamming was offered a job at Bell Telephone Laboratories, but he remained at Los Alamos for six more months, until most of the other scientists had left. ''I wanted to figure out what had happened there, and why it had happened that way,'' he said in a 1993 interview with I.E.E.E. Spectrum, the journal of the Institute of Electrical and Electronic Engineers.
At Bell he soon fell in with a group of similarly talented mathematicians, all around age 30. ''We were first-class troublemakers,'' Mr. Hamming told Spectrum. ''We did unconventional things in unconventional ways and still got valuable results. Thus management had to tolerate us and let us alone a lot of the time.''
In addition to error correction, Mr. Hamming did pioneering work in digital filters while at Bell Labs. One such device was named after him: the Hamming Window. It was an electronic tool that allowed a user to look at a small portion of a signal, like part of a frequency spectrum, without leakage from other parts of the signal. Like his codes, Mr. Hamming's digital filters became indispensable parts of the digital engineer's tool kit.
''If you don't work on important problems, it's not likely that you'll do important work,'' was a favorite axiom of Mr. Hamming's, and he told Spectrum that his discoveries were the high point of his life. ''The emotion at the point of technical breakthrough is better than wine, women and song put together,'' he said.
Mr. Hamming shunned a management role at Bell, transferring subordinate researchers to other jobs as soon as they were assigned to him. With the conviction that scientists do their best work in their youth, he decided to retire early from Bell, at age 61, after 30 years. He then began second and third careers, as the author of several books on computing and as a full-time teacher at the Naval Postgraduate School in Monterey. He retired from the school in June after 21 years.
At the school, Mr. Hamming was known as a professor who felt mathematics should be fun. ''The purpose of computing is insight, not numbers,'' he told students. Mathematics ''is the language of precise thinking,'' he said.
The development of the Hamming Codes was recognized in 1996 by the Eduard Rheim Foundation of Germany, which presented Mr. Hamming the $130,000 Eduard Rheim Award for Achievement in Technology. The Richard W. Hamming Medal, accompanied by a $10,000 prize, was created in his honor by the I.E.E.E. in 1986; he was the first recipient.
Mr. Hamming was also honored with the Harold Pender Award from the Moore School of Electrical Engineering at the University of Pennsylvania for his work in algebraic coding theory, the Emmanuel R. Piore Award from the I.E.E.E. for work in information processing and the Turing Prize from the Association of Computing Machinery.
Mr. Hamming is survived by his wife, Wanda, of Monterey.
By LAWRENCE M. FISHER, January 11, 1998 © The New York Times Company