Abstract. Given a probability distribution on a totally ordered set, we define for each a related distribution on the symmetric group , called the QS-distribution. It is a generalization of the q-shuffle distribution considered by Bayer, Diaconis, and Fulman. The QS-distribution is closely related to the theory of quasisymmetric functions and symmetric functions. We obtain explicit formulas in terms of quasisymmetric and symmetric functions for the probability that a random permutation from the QS-distribution satisfies various properties, such as having a given descent set, cycle structure, or shape under the Robinson-Schensted-Knuth algorithm.