The Math That Predicted the Arab Spring