Mathematics of marginal seats