(Courtesy of Priceonomics)

White students are no longer the majority in U.S. public schools this school year for the first time ever. It's a sign of things to come, to be sure. Families from all over the world are immigrating to the United States, and the white share of the population as a whole is declining.

It's also a reminder of the past. For decades, a combination of discriminatory housing and zoning rules and underinvestment by government in certain schools and districts has meant that even where white children go to public schools, they still attend different schools than do children of color.

A fascinating new demographic analysis of San Francisco's school system reveals these facts in detail. White children account for 29 percent of the city's population age 19 or younger, but only 13 percent of students in public schools. Many of the rest are presumably attending private school.

There are more white children in elementary schools, but as they grow older, they leave the public schools. Their parents may be putting them in private high schools or moving into a suburban school district, writes Rosie Cima of Priceonomics, the data-gathering firm in San Francisco that conducted the analysis using Census estimates and records from the San Francisco Unified School District.

Not only that, but the district's school "lottery," intended partly to promote diversity in classrooms, has apparently had the effect of concentrating white students in the best elementary schools, as more educated and more affluent families navigate the system of rules for assigning students to schools with greater success.

"The story of our efforts at student assignment is the story of unintended consequences," Rachel Norton, who sits on the district's board, told Jeremy Adam Smith of San Francisco Public Press earlier this year. Segregation in the schools has increased under the district's new system, which went into effect in 2011.

"In some ways, it's a perfect mismatch of intent and results," Norton said.

It isn't just white students who are concentrated. As the chart below shows, while there are some examples of genuinely diverse public elementary schools in the city, there are also quite a few where one racial or ethnic group of student predominates.

(Courtesy of Priceonomics)

In fairness, some San Francisco families might prefer to send their kids to more segregated schools. Smith reports that many Chinese parents want their children to go to an elementary school where Mandarin is taught. Likewise, immigrants from Mexico might feel more comfortable sending their children to a school where the other parents speak Spanish, as well.

In other cases, though, parents might not realize that their choices are putting their children at a disadvantage by sending them to schools where test scores are lower. If they decide they want to try to get their kid into one of the sought-after classrooms at a school like Gratton Elementary, where most students are white, the district's application process can be an obstacle. Some parents might not be familiar with the rules, and even if they are, figuring how to rank their choices on the application takes time for planning, research and visiting schools.

(The Washington Post. Source: California Department of Education data for '12-'13 academic year)

This problem is not unique to San Francisco, of course. In Washington, D.C., families who can afford it hire consultants to help them manage the District's school lottery.

Students take notes at Woodrow Wilson High School in Washington. (AP/Charles Dharapak)

The examples of Washington and San Francisco reveal the dilemmas of the movement toward school choice. Proponents argue that by allowing parents to choose schools for their children, the most effective instructional models will succeed, while schools that are failing to educate kids will be forced to close. Choices, however, are only an advantage for those families with the time and expertise to make good ones.

In San Francisco, it looks as though giving parents some measure of choice in where their children go to school has led to segregation in the schools, which in the long term can only result in gross educational inequities. Socioeconomically secure groups will see to it that the schools their children attend are adequately supported. They'll have more influence over elected officials apportioning resources among schools, and they can make up deficiencies with private donations.

Yet if San Francisco were to ignore parents' requests in order to enforce diversity, it's likely that even more white children would disappear from the public schools, resulting in greater segregation overall.

There would be a way out of this catch-22 if housing in the Bay Area, as in so many other metropolitan regions in the United States, were more integrated. As my colleague Emily Badger has argued, affordable housing would create more diverse neighborhoods, allowing districts to simply send children to the schools near their homes without fear of grouping disadvantaged students together. If parents were unhappy with a school, it would be easy for them to move to another part of town. Everyone in the community, regardless of race or wealth, would have a financial reason to insist on educational excellence, since better schools not only benefit kids but improve a neighborhood's desirability and raise land values.

San Francisco's famously restrictive zoning rules, however, have raised housing prices, making truly diverse neighborhood schools of this kind basically unimaginable today. In short, promoting diverse classrooms while allowing students choices means addressing the national trends of rising inequality of income and residential segregation, which is a lot to ask of a school board.