As a research supervisor he was full of ideas and exciting problems. As an examiner he could set fiendishly difficult questions. His constant aim was to increase problem-solving ability in the young. This once took the form of a non-examinable course devoted solely to difficult problems. Later he visited various parts of the country lecturing on the enfeeblement of mathematical skills by modern mathematics and by "similar soft intellectual trash in schools and universities".

One of his great strengths was an ability to pinpoint the basic mathematics underlying a scientific problem and to develop a useful theory. A notable example was his paper (with S. R. Broadbent) on "Percolation Processes", written in 1957 and motivated by a problem to do with the spread of gas molecules though a porous solid. Unlike in previous studies of particles moving randomly in space, in this problem the randomness existed solely in the porous medium.

Largely through Hammersley's influence, percolation is now a huge area of research in both mathematical probability and statistical physics, with many applications in the physical and natural sciences, a typical example being the spread of blight though an orchard.

Closely related was the easily stated but horrendously difficult "self avoiding walk" problem. This concerned the behaviour of a non-intersecting random walk in a crystal lattice. It has many applications, particularly in the polymer industry, but complete answers of the type Hammersley sought in the early 1960s have yet to be found, though several of his results are now considered classics.

From his earliest days Hammersley had great respect for "bare hands" numerical work, and the insights it gave into actual behaviour in the random processes he was studying. This could involve enormous calculations on what are today seen as primitive machines.

In the early 1960s the Oxford mainframe computer, although physically huge, had far less storage space than a modern calculator. Large simulations needed to be written in machine code, and a typical run could take 24 hours. These experiences in large-scale computing on relatively tiny machines provided the case studies for his ground-breaking work Monte Carlo Methods (1964) written with D. C. Handscomb.

Now in its fifth edition, it has been a major influence in spreading these techniques.

John Michael Hammersley was born in Helensburgh in 1920 and was about five years old when the family moved to Bishop's Stortford. He went on a scholarship to Sedbergh and from there, again as a scholar, to Emmanuel College, Cambridge, in 1939.

His undergraduate career was interrupted by military service from 1940 to 1945.

While in the Army he developed a range of technical expertise in radar and gunnery, and ended up responsible for the radar installations of the gun sites defending Scapa Flow. When he was put in charge of the computations analysing the performance of anti-aircraft equipment, he introduced a reform of which he was proud, replacing the seven-figure tables of trigonometric functions with four-figure ones which were amply accurate. He also told of how he "winkled" desk calculators out of the Treasury, which was keeping them in a cupboard for future indeterminate use. He ended the war as a major.

Back at Cambridge he graduated as a wrangler, but was disappointed to miss his half-blue for skiing by one place. However, he was in a joint Oxford-Cambridge team which, hardly surprisingly, lost to the combined Swiss universities.

In 1948 he joined the three-man department of design and analysis of scientific experiment in Oxford, then the university's sole provision of statistical services. He taught for Trinity College until 1955 when he moved to the Atomic Energy Research Establishment at Harwell as its principal scientific officer.

In 1959 he returned to Oxford -to Trinity and to the Institute of Economics and Statistics. He continued his research even after his retirement in 1987, publishing on the dendritic growth of crystals and the growth of Eden clusters.

As well as holding doctorates from Oxford and Cambridge, he was awarded the Von Neumann Medal (1966), the Gold Medal of the Institute of Mathematics (1984) and the Polya Prize of the London Mathematical Society (1997). He was elected a Fellow of the Royal Society in 1976 and was Rouse Ball Lecturer at Cambridge in 1980.

He was a gentleman of the old school, with very high standards. Curiosity and originality pervaded his whole life; he was always stimulating and wonderfully entertaining company.

Away from his mathematics he was a cultured man, fond of poetry and devoted to his family. He was happily married to Gwen for 53 years, and she and his two sons survive him.

John Hammersley, mathematical statistician, was born on March 21, 1920. He died on May 2, 2004, aged 84.

© The Times, 2004