Next time your computer has a memory error, you could blame it on unwelcome visitors from outer space - cosmic rays.

Every second, 100,000 high-energy cosmic-ray particles from distant parts of the Galaxy hit each square metre of the the Earth's atmosphere. Some of these energetic particles zap computer chips, leading to once-only glitches or 'soft fails'. These events are not common, but neither are they rare: computer manufacturers are understandably worried about things that affect the reliability of their products.

The cosmic rays that strike the Earth first have to get through the protective envelope of the Earth's atmosphere. Few are energetic enough to penetrate the atmosphere - equivalent to a slab of concrete four metres thick. Instead, they interact with nitrogen and oxygen atoms in the upper atmosphere, producing natural nuclear reactions that lead to 'cascades' of secondary particles, some of them radioactive, that rain down as particle 'showers'. Altitude is important. Cosmic-ray flux is highest at 15 kilometres above the surface, below which the atmosphere absorbs an increasing amount of cosmic rays and their products. Nevertheless, eight cosmic-ray showers touch each square metre of the Earth's surface each second.

For twenty years, James F. Ziegler of IBM Research at Yorktown Heights, New York, and his colleagues have been working on how cosmic rays and other sources of radiation affect computer performance. Writing in a recent issue of IBM's Journal of Research and Development, Ziegler shows how cosmic-ray intensities vary across the Earth's surface. His gazetteer of major cities all over the world, rated by cosmic-ray intensity, should give a guide to where cosmic-ray watchers should - and should not - place their computers.

For reference, Ziegler gives New York City a rating of a single intensity unit. This is about average. Cities in southern Asia - Bombay, Calcutta, Bangkok and Rangoon - suffer only half the cosmic-ray intensity of New York. For those worried about cosmic rays, these are the best places to have a computer. Cities in South America, though, are prone to cosmic-rays: La Paz, Bolivia, suffers more than eight times the intensity of New York City.

What causes this variation? Two factors are important. The first, as already mentioned, is altitude. The higher a location is above sea level, the less atmosphere exists above it to shield it from cosmic-ray showers. So, while atmospheric pressure at sea level, in New York, is around 1030 millimetres of mercury (mmHg), it is only 852 mmHg in Denver, the 'mile-high' city, which at 5280 feet (1625 metres) above sea level, has a cosmic-ray intensity more than four times that in New York. Leadville, Colorado, is higher still, at 10200 feet (3138 metres), and experiences cosmic radiation almost 13 times as intense as in New York. It so happens that La Paz is located at an altitude of 11910 feet (3662 metres), in the Andes.

Why, then, does Leadville experience more cosmic rays than La Paz, which is higher? This is where the second factor comes into play. This is something called 'geomagnetic rigidity', the minimum energy a cosmic-ray particle needs to have to penetrate to sea level at a given location. This depends on the geometry of the Earth's magnetic field which, apart from the atmosphere, is the principal determinant of cosmic-ray impact at ground level.

Because cosmic-ray particles often carry an electric charge, the speed and angle at which they penetrate the Earth's magnetic field can vary enormously. Rather than plummet straight down to Earth, they adopt a sinuous course, making their way through the tangles and snares of the magnetosphere like a bee trying to pilot a course through an open window. On the whole, they find it easier to penetrate near the magnetic poles than at lower latitudes. This is because, near the poles, magnetic field-lines are vertical, so a particle can pass through as if between the vertical fibres of a carpet. At lower latitudes, magnetic field-lines are horizontal, so particles coming in vertically tend to bounce off, unless they are powerful enough to bore their way through.

In this way, tropical regions tend to be more geomagnetically 'rigid' - resistant to penetration - than temperate or polar ones. This explains the discrepancy between La Paz and Leadville - a particle that hits La Paz has to have six and a half times as much energy as one reaching Leadville. La Paz, for all its altitude, lies in a more 'rigid' part of the magnetic field, so it experiences fewer high-energy cosmic ray impacts, even though it lies at a higher altitude than Leadville.

It also explains why Bombay, Calcutta, Bangkok and Rangoon are the most cosmic-ray-free cities on Earth. Not only do they lie at sea level, but they also happen to lie in the region where the geomagnetic rigidity is the highest of anywhere on Earth.