Characteristic polynomials of random matrices and random partitions