Take a person with mental issues and a violent past, who in poor NYC areas could be someone like Alexander Bonds.

Couple that person with an anti-police narrative and generations of racial discord, such as the fatal shootings by white NYPD officers of innocent black New Yorkers — including 10-year-old Clifford Glover in Queens in 1973, 15-year-old Randolph Evans in Brooklyn in 1976 and 22-year-old Amadou Diallo in the Bronx in 1999.

The result is equally innocent NYPD victims such as Officers Rafael Ramos and Wenjian Liu in 2014, and last week Officer Miosotis Familia, who was killed inside her patrol car by Bonds and whose funeral is today.

These tragedies reflect long-standing, seemingly insoluble crises between black New Yorkers and the NYPD that cannot be resolved by anodyne words, such as those offered by Mayor Bill de Blasio.

“A female police officer attacked out of nowhere is clinging to her life,” he said shortly after Familia was shot. “The commissioner and I met with her family and it’s a very, very difficult moment for all of them.”

Then while hundreds of cops and ordinary citizens massed outside Familia’s 46th Precinct in the Bronx, the mayor winged off to the G-20 summit in Germany in his quixotic pursuit to lead a progressive agenda. His actions vis-à-vis the NYPD are also quixotic. Many blamed him for helping to create a climate of violence that led another mentally disturbed black man from Baltimore to come to NYC and assassinate Ramos and Liu in their patrol car in Brooklyn.

Since then, de Blasio has become the NYPD’s “biggest supporter,” as an NYPD official said anonymously to speak freely about the mayor. He backed hiring 1,300 more officers, and he supports the bulletproofing of NYPD vehicles, such as the one Familia sat inside when she was killed.

At the same time, he sandbagged Commissioner James O’Neill after a white sergeant fatally shot Deborah Danner in October — an emotionally disturbed 66-year-old Bronx black woman who police say attacked the officer with a bat.

Last month, Bronx District Attorney Darcel Clark indicted Sgt. Hugh Barry on a charge of second-degree, or intentional, murder. That’s an overcharge.

The result will be more hostility between black New Yorkers and the NYPD.