This paper is concerned with certain connections between the ensemble of n
x n unitary matrices - specifically the characteristic function of the rand
om variable tr(U) - and combinatorics - specifically Ulam's problem concern
ing the distribution of the length of the longest increasing subsequence in
permutation groups - and the appearance of Painleve functions in the answe
rs to apparently unrelated questions. Among the results is a representation
in terms of a Painleve V function for the characteristic function of tr(U)
and (using recent results of Balk, Deift and Johansson) an expression in t
erms of a Painleve' II function for the limiting distribution of the length
of the longest increasing subsequence in the hyperoctahedral groups.