Symbolic computation of moments of sampling distributions