Picture two children with the same abilities but different upbringings.

One is taught that if he wants something, he has to work for it.

The other gets more allowance each year, no matter how well or badly he behaves.

Which child will grow into a more resilient, capable adult?

Local governments are much the same.

When they’re forced to earn what they spend by growing their economies, attracting new residents and delivering value for tax dollars, they produce better results — while cities accustomed to bailouts become complacent.

New York learned this the hard way: Fifty years ago, the city essentially stood bankrupt.

Mayors over the preceding two decades had consistently overspent, assuming that state or federal aid would eventually fill the city’s budget holes.

They didn’t.

When the banks finally stopped lending to Gotham in 1975, its accumulated shortfall had ballooned to $5 billion, or 42% of its $12 billion annual revenues.

The state’s Financial Control Board took over city finances and imposed strict cost controls, forcing a long-overdue reckoning.

By the time the board relinquished oversight a decade later, the city’s governing philosophy had matured.

Under hard-headed Mayor Ed Koch, the city prioritized the interests of its residents rather than those of its employees.

Koch dug New York out of its fiscal mess through responsible decision-making.

He grew the economy and tax base by embracing job growth on Wall Street, rebuilt abandoned housing in The Bronx, cleaned up graffiti on subways and partnered with private groups to improve parks and business districts.

In short, austerity proved that disciplined management could revive a failing city.

The state’s fiscal guardrails enacted in the wake of the 1975 crisis, such as an annual balanced-budget requirement, continue to protect the city against government overreach.

This history serves as a warning to Mayor-elect Zohran Mamdani: Ignore fiscal reality at your peril.

Unlike his ideological compatriot Bill de Blasio, Mamdani won’t have the benefit of a booming local economy to paper over his administration’s inefficiencies.

Get opinions and commentary from our columnists

Subscribe to our daily Post Opinion newsletter!

Thanks for signing up!

His success — or failure — will thus largely rest on his ability to do more with less.

In an October breakfast with local business leaders, Mamdani vowed, “Make no mistake, my friends: When I am mayor, this city is going to innovate.”

Embracing innovation involves accepting that productivity-enhancing tools like artificial intelligence will require city employees to adapt.

That’s a feature, not a flaw, if the goal is better delivery of city services.

But it means Mamdani will need to secure maximum managerial flexibility through his collective-bargaining negotiations with the city’s public unions.

The political temptation, however, will be to protect existing municipal jobs, as New York state has done.

Late last year, when Gov. Kathy Hochul signed the LOADinG Act into law, my colleague Ken Girardin explained that it effectively bans state agencies from using automation — including AI — to perform tasks now done by employees.

Shielding workers and outdated processes from technological change won’t make New York City more affordable, or its government more capable.

Mamdani should resist that temptation.

Instead, he should use the latest innovations to make city government nimbler, more responsive and more effective.

For example, over the past five years 311 calls have surged — especially complaints about illegal parking, blocked driveways, noise and trash.

AI could prioritize the most urgent calls, determine which agencies are needed to resolve them, and rank the highest-priority tasks for agency employees.

A similar approach could apply to housing: AI tools could scan every housing-development application, identify where they’re stuck in bureaucratic limbo and help the administration clear those bottlenecks.

Some routine building inspections could be handled through photo and video submissions, rather than in person, something the city’s Department of Buildings piloted in 2021 and Los Angeles now uses.

Inspectors freed from such low-risk work could be redeployed to conduct targeted audits, ensuring safety-critical compliance.

Technological assistance could thus ease delays in obtaining certificates of occupancy, getting new housing to market faster and placing much-needed downward pressure on rents.

AI can likewise overhaul the city’s convoluted, months-long procurement process, speeding up contract awards and reducing administrative costs.

And by analyzing workflows, overtime patterns and staffing redundancies, AI tools can help agencies deploy their budgets more efficiently, freeing up resources for Mamdani’s agenda.

Such an approach would redirect city government away from narrow departmental goals and toward addressing residents’ problems — what it should be doing.

It’ll take strong leadership to convince city workers, and their unions, to adapt.

Like the responsible child, they can rise to the challenge — but only if the mayor pushes them to do it.

John Ketcham is director of cities and a legal policy fellow at the Manhattan Institute.