Let (R,m) be a complete discrete valuation ring with the finite residue field R∕m= Fq. Given a monic polynomial P(t)∈R[t] whose reduction modulo m gives an irreducible polynomial P‾(t)∈Fq[t], we initiate an investigation of the distribution of coker(P(A)), where A∈Matn(R) is randomly chosen with respect to the Haar probability measure on the additive group Matn(R) of n×n R-matrices. In particular, we provide a generalization of two results of Friedman and Washington about these random matrices. We use some concrete combinatorial connections between Matn(R) and Matn(Fq) to translate our problems about a Haar-random matrix in Matn(R) into problems about a random matrix in Matn(Fq) with respect to the uniform distribution. Our results over Fq are about the distribution of the P‾-part of a random matrix A‾∈Matn(Fq) with respect to the uniform distribution, and one of them generalizes a result of Fulman. We heuristically relate our results to a celebrated conjecture of Cohen and Lenstra, which predicts that given an odd prime p, any finite abelian p-group (i.e., Zp-module) H occurs as the p-part of the class group of a random imaginary quadratic field extension of Q with a probability inversely proportional to |AutZ(H)|. We review three different heuristics for the conjecture of Cohen and Lenstra, and they are all related to special cases of our main conjecture, which we prove as our main theorems.