Tomorrow, thousands of New York City students are slated to take the Specialized High Schools Admissions Test (SHAST), which determines whether they will be admitted to elite public schools such as Stuyvesant High School and the Bronx School of Science.

As Kyle Spencer of the New York Times reported in a recent story, many Asian American students have excelled at the exam, which is the sole determinant of admissions, while black and Latino students, on the whole, have not. At Stuyvesant High School, according to a recent report put out by the NAACP Legal Defense and Education Fund and the Community Service Society of New York, just 1 percent of students are black and 2 percent Latino in a city where the public schools are 27 percent black and 40 percent Latino.

The Times story makes clear why the use of a merit-based exam has appeal. For many low-income Asian immigrants, studying for the test and succeeding is a way out of poverty. One student who is the son of Bangladeshi immigrants notes, “Most of our parents don’t believe in ‘gifted.’ It’s all about hard work.” Mayor Michael Bloomberg defended the process, saying “You pass the test, you get the highest score, you get into the school—no matter what your ethnicity, no matter what your economic background is.”

But, of course, the matter is not so simple. Educational opportunities are enormously unequal in American schools, and a single test will, to a considerable degree, reflect those inequalities of opportunity.

Is there a way out? A way to honor hard work and merit but also recognize inequalities of opportunity and produce economic, racial, and ethnic diversity in top schools? Chicago might provide a good answer.

In 2008 and 2009, I worked with Chicago public schools to develop a system that bases admission to selective schools on a combination of test scores, grades, and socioeconomic status. Today, 30 percent of students are admitted to selective schools based on raw test scores and grades, but then the rest are admitted based on being the highest-ranking students academically within their socioeconomic group.

To create the groups in the Chicago system, city census tracts are divided into four tiers based on several socioeconomic factors. Originally, the socioeconomic factors included (1) median family income, (2) percentage of single-family homes, (3) percentage of homes where English is not the first language, (4) percentage of homes occupied by a homeowner, and (5) level of adult educational attainment. More recently, a sixth factor—school achievement scores by attendance area—was added.

The notion is that it is actually more meritocratic to consider not just what a student achieves but also what obstacles she has had to overcome.

This program translates into a fair amount of racial diversity. At Walter Payton, the top Chicago school, the NAACP LDF and Community Service Society report that 21 percent of students are black and 25 percent are Latino. These groups are still under-represented (black students constitute 41 percent of the Chicago student body, and Latino students 45 percent), but the school is far more diverse than New York City’s Stuyvesant, with its 1 percent black and 2 percent Latino population.

It may be hard for prideful New Yorkers to look to Chicago for answers, but America’s Second City has a fair and reasonable way out of the Stuyvesant dilemma.