The Mathematics of Trust