TO SUM up recent research predicting a mixed-race future for humanity, biologist Stephen Stearns of Yale University turns to an already intermingled nation. In a few centuries, he says, we will all "look like Brazilians". Brazil shares with the United States a population built from European immigrants, their African slaves and the remnants of the Amerindian population they displaced. But with many more free blacks during the era of slavery, no "Jim Crow" laws or segregation after it ended in 1888 and no taboo on interracial romance, colour in Brazil became not a binary variable but a spectrum. Even so, it still codes for health, wealth and status. Light-skinned women strut São Paulo's upmarket shopping malls in designer clothes; dark-skinned maids in uniform walk behind with the bags and babies. Black and mixed-race Brazilians earn three-fifths as much as white ones. They are twice as likely to be illiterate or in prison, and less than half as likely to go to university. They die six years younger—and the cause of death is more than twice as likely to be murder.

Such stark racial inequality is actually an improvement on the recent past (except for the gap between homicide rates, which has grown with the spread of crack cocaine). A strong jobs market, better-targeted government spending and the universalisation of primary schooling have brought gains to poor Brazilians, whatever their colour. Even so, Brazil's government is turning to affirmative-action programmes to hurry change along—just as the United States considers abandoning them.

During the past decade several public universities have introduced racial preferences piecemeal. Last April the supreme court decided that they did not contravene constitutional equal-rights provisions—which was all that the government had been waiting for. In August it passed a law mandating quotas for entry to all of the country's 59 federal universities and 38 federal technical schools. The first cotistas, as beneficiaries are known, started their courses this year.

By 2016 half of all places in federal institutions will be reserved for state-schooled applicants. Of these, half must go to students from families with incomes below 1017 reais ($503) a month per person—a cut-off that is much higher than the Brazilian average. Each must allocate quota places to black, mixed-race and Amerindian students in proportion to their weight in the local population (80% in Bahia, a state in Brazil's north-east; 16% in Santa Catarina in the country's south). Some states are considering similar rules for their own universities.

Brazil does not require private universities to take race into account. Nor does it require private companies to do so when hiring. A few states have racial quotas when hiring civil servants, and there is talk of something similar at the federal level. But the real action, for now, is in public universities.

Going to university in Brazil is not a mass experience, as in the United States. And only a quarter of places are in public institutions. Other government education programmes, such as creche-building in poor neighbourhoods, better literacy training for teachers and subsidies for poor students who attend private universities, will improve the lives of many more black Brazilians than the quota programme. But public universities are more prestigious—and barred from charging fees by the constitution. That their places have long gone disproportionately to the 12% of Brazilians who are privately educated, most of them rich and white, is hard to swallow.

The supreme court decided that quotas were an acceptable weapon in the fight against the legacy of slavery. That view is now mainstream in Brazil. Just one congressman voted against the new law, and a recent opinion poll found nearly two-thirds of Brazilians supported racial preferences for university admissions (though even more were keen on reserving places for the state-schooled and poor with no regard for colour). But even supporters worry that by encouraging Brazilians to choose sharp-edged racial identities, quotas will create tensions where none existed before.

Brazilians' notions of race are indeed changing, but only partly because of quotas, and more subtly than the doom-mongers fear. The unthinking prejudice expressed in common phrases such as "good appearance" (meaning pale-skinned) and "good hair" (not frizzy) means many light-skinned Brazilians have long preferred to think of themselves as "white", whatever their parentage. But between 2000 and 2010 the self-described "white" population fell by six percentage points, while the "black" and "mixed-race" groups grew.

Researchers think a growing pride in African ancestry is behind much of the shift. But quotas also seem to affect how people label themselves. Andrew Francis of Emory University and Maria Tannuri-Pianto of the University of Brasília (UnB) found that some light-skinned mixed-race applicants to UnB, which started using racial preferences in 2004, thought of themselves as white but described themselves as mixed-race to increase their chances of getting in. Some later reverted to a white identity. But for quite a few the change was permanent.

Opponents of quotas worry that ill-prepared students will gain entry to tough courses and then struggle to cope. Such fears make sense: any sort of affirmative action will bring more publicly educated youngsters into university—and in Brazil, the difference between what they and their privately educated counterparts have learnt is vast. In global education studies, 15-year-olds in Brazil's private schools come slightly above the rich-world average for all pupils. Most of those in its public schools are functionally illiterate and innumerate.

Surprisingly, though, neither the State University of Rio de Janeiro nor UnB—the two earliest to adopt quotas—have found that cotistas did much worse than their classmates. For some highly competitive courses, such as medicine at UnB, the two groups had quite similar entrance grades. And for some of the least selective courses, the overall standard was not high. But even when the starting gaps were wide, most cotistas had nearly caught up by graduation.

One possible explanation is that cotistas with a given entrance grade were in fact more able than non-cotistas, since the latter were more likely to have had intensive coaching in test techniques. Another is that cotistas worked harder: both universities found they skipped fewer classes and were less likely to drop out. "Cotistas take their studies much more seriously than those who thought a university place was theirs by right," says Luiza Bairros, the state secretary for policies to promote racial equality. "They know how important this opportunity is, not just for them but for their whole family."

Brazil's racial preferences differ from America's in that they are narrowly aimed at preventing a tiny elite from scooping a grossly disproportionate share of taxpayer-funded university places. Privately-educated (ie, well-off) blacks do not get a leg-up in university admissions. But since racial quotas are just starting in Brazil, it is too early to say what their effects will be, and whether they will make race relations better or worse.