Affirmative action refers to policies that aim to improve opportunities for historically marginalized groups, particularly in education and employment. One of the primary objectives of affirmative action is to address the effects of past discrimination and promote greater diversity within institutions. Given this context, what is the primary purpose of affirmative action?