ring in discrete mathematics