IT IS Republic Day in Mumbai, and an elderly nun addresses 1,000 silent schoolgirls gathered in the playground of Mary Immaculate Girls' School. If the writers of India's constitution could see the state of the country today they would weep, she cries, but this school offers hope. Local parents in the tatty surrounding district agree. They will do almost anything to get their children into the oversubscribed school, even though it charges its primary pupils $180 a year when the state school across the road is free. From the Mumbai slums to Nigerian shanty towns and Kenyan mountain villages, tens of millions of poor children are opting out of the state sector, and their number is burgeoning.

Despite a rapid rise in attendance since 2000, 72m school-age children across the world are still not in school, half of them in sub-Saharan Africa and a quarter in South and West Asia. The United Nations reckons it would cost $16 billion a year to get the remaining stragglers into class by 2015—one of its big development goals. Yet a free education is something that many parents will pay to avoid.

In India, for example, between a quarter and a third of pupils attend private schools, according to the OECD, a Paris-based think-tank (and others have private tutors). In cities the proportion is more like 85%, reckons Geeta Kingdon, who conducts research in Mumbai and elsewhere for the Institute of Education in London.

A government decision in 2007 to make primary schooling compulsory and free boosted private-school numbers. Many parents became disenchanted with state-school teachers who failed to show up or taught badly—by, for example, failing to correct errors. Surveys by Pratham, a Mumbai-based charity, suggest that standards in state schools slipped as the system expanded, whereas in the private sector they have held up.

In China, too, low-fee private schools have emerged, but less because the state schools are bad than because migrants lose the right to a free state education for their offspring. In Beijing alone some 500,000 migrant children cannot get into a state school. Many are taught in unlicensed private schools which, unlike their Indian equivalents, tend to be down-at-heel compared with state provision.

Desk job

In African countries such as Ghana, Nigeria and Uganda teaching is all too often a sinecure, not a vocation. Governments have built many new schools, but cannot dismiss even the worst teachers. Poor instruction by teachers who physically beat their pupils is rife. In private schools the parents are choosy customers. They care more about the quality of instruction than the snazziness of the premises.

James Tooley of the University of Newcastle has pioneered the study of cheap private schools in poor countries. He has also set some up. His research, published in 2009 in a book called “The Beautiful Tree”, often surprised local officials who were unaware such schools existed. Mr Tooley describes classes in the front rooms of people's houses, often as an extension of basic child care. Most are run for profit—though even these may offer free places for orphans and other needy children.

But the private sector faces problems from bossy bureaucrats, especially in India. It is illegal there to operate a school for profit, so schools that charge fees must act as charities first and businesses second. The Right to Education Act, which came into effect in 2010, compels all independent schools to register with the government on pain of closure (surveys suggest that only about half bother to do so). The same law also compels private schools to take a quarter of their students from poor families. Many have resisted, not least because the subsidies that were supposed to pay for the places have not been forthcoming. Some state courts have ruled that private-school teachers must have the same high pay as state ones, and have mandated budget-busting facilities such as large playgrounds and libraries.

Big aid organisations and charities have long been sceptical of the private schools, arguing that they increase inequality and undermine state provision. Tove Wang of Save the Children, a charity, doubts if private schools, however plentiful, can ever cater for the very poorest. She points to research indicating that poor parents go private only when state schools are dire; if the publicly financed ones improved, she argues, they would be more popular.

But it remains a striking fact that some of the poorest people in the world make big sacrifices to pay for education, and get good value for their money. That is a tribute to diligence and entrepreneurship, just as the failure of the public schools highlights sloth and greed.