Affinity and anti-affinity