Transformations on Words and q-Calculus