Imagine a computer program that could accurately predict whether the thunderstorm forecast for tomorrow is likely to cause a power failure and if so precisely where; or whether a downpour two days from now will bring flooding or provoke life-threatening mudslides in a specific part of town. While city officials could not prevent the natural catastrophes, they could implement disaster management plans earlier and focus resources to deal better with the effects — for example, deploying personnel to expected problem spots to render immediate assistance or to aid evacuation.

The ability to manage a crisis better by predicting emergency needs and deploying resources accordingly is already a reality for Rio de Janeiro, which earlier this year set up an Intelligent Operations Center using computer programs that rely on algorithms developed by I.B.M. And more cities are expected to follow suit soon.

“We now have a hub for information on anything that has an impact on the city’s day-to-day life,” said Carlos Roberto Osorio, Rio’s secretary for conservation and public services. “With this system, the information is treated quickly and the response is much faster. So the city becomes more intelligent, it becomes more agile and at the end of the day it becomes a safer city for our citizens.”

Guruduth Banavar, vice president and chief technology officer of the global public sector unit at I.B.M., said computer algorithms helped to analyze complicated data that the human brain alone cannot sort through. “These algorithms, collectively called analytics, can use past historical and current data in a given situation to predict the most likely scenario that will develop and suggest the best way to react to the current event,” he said.