The Mathematics of Writing