The housing crisis unlocks the reasons for Scotland’s political dysfunction with the elegance of a Pythagorean equation.

The parts of the equation break down like this: first, Westminster austerity puts severe pressure on the Scottish Government when it comes to budgetary decisions. Let’s call this "X".

Second, the Scottish Government responds with cuts of its own. Let’s call this "Y".

Third, these Scottish Government cuts are often ill-thought-out and badly planned and considered. Let’s call this "A".

Fourth, in order to avoid public anger for the cuts it’s inflicted, the Scottish Government hides behind Westminster, pushing all the blame onto the UK Government. Let’s call this "B".

The result is policy disaster, which we can call "F".

The equation for Scottish political dysfunction can therefore be expressed as (X + Y) x (A + B) = F … for fail.

Alison Watson, the head of Shelter Scotland, summed up the dysfunction when I spoke to her last week. “Scotland has a constrained fiscal environment in which to make very difficult decisions,” she said. “We absolutely get that. But whether the pie is big or small, politicians decide how to carve it up.”

Ms Watson was talking to me about the catastrophic state of housing and homelessness in Scotland. There are currently 10,000 children homeless and in temporary accommodation.

Those figures emerged last Tuesday. That same day, the Scottish Government cut 26% - roughly £200 million - from the affordable homes budget.

You cannot reduce homelessness without building more social housing. It’s an arithmetical certainty.

READ MORE: Neil Mackay talks to Shelter boss Alison Watson about Scotland’s housing crisis

READ MORE: Neil Mackay on how Humza Youaf has broken the social contract with the Scottish people

READ MORE: Neil Mackay on why Scotland is a land of small ideas and even smaller people ​

Yet, the Scottish Government talks grandly about its plans to end homelessness and build social housing.

Again, it’s a mathematical equation. You cannot achieve X (reduce homelessness), unless you do Y (build social homes). And you cannot achieve Y (build social homes) if you do Z (cut the housing budget). The government’s approach to social policy defies logic.

Ms Watson said that whilst the Scottish Government has “made decisions that are worsening the situation”, we must also accept that “years of austerity policies have played their role. This is about Westminster, Holyrood and councils”.

She was even-handed with blame.

Yet here’s her kicker: “What’s particularly galling is the Scottish Government cutting the housing budget and then blaming Westminster for decisions it made.

“Why is the Scottish Government singling out the housing budget for savage cuts when homelessness is at an all-time high? The level of political dissonance is worrying.”

Ms Watson said the Scottish Government “cannot throw up its hands and say we’re having to make 26% cuts to housing, because of 4% cuts in our capital budget from Westminster - 4% cuts don’t mean they must cut so badly. It’s bad choices, wrong priorities”.

You can see why she took the unprecedented step, as leader of one of Scotland’s most respected and influential charities, of accusing Humza Yousaf of “gaslighting” Scotland and having “no credibility” on tackling child poverty, another SNP ambition.

If there are 10,000 kids homeless - up 3% - government has clearly failed. Ms Watson said Mr Yousaf has broken the “social contract” with children.

We’ve been trapped in this political maze for years. Westminster creates bad conditions; the SNP, and latterly Greens, make matters worse as they’ve no understanding of what integrated social policy means; and the Scottish Government avoids culpability for its mistakes by pointing south.

Repeat ad nauseam, ad infinitum. It’s a cursed political landscape, that continually fails the most vulnerable.

We can’t break the cycle as the SNP still has its large, hardline base which puts independence first. After speaking out, Ms Watson was accused - as she expected - of being some unionist lackey. Nationalists threatened to starve Shelter of donations.

The Herald: Around £200m has been cut from the affordable homes budgetAround £200m has been cut from the affordable homes budget (Image: PA)

If the SNP’s base isn’t shooting messengers and silencing critics with abuse, it’s engaged in grotesque whataboutery. Ms Watson should have praised the SNP, they claimed, as homelessness is worse in England.

Perhaps these nationalist partisans should be made to tell every one of Scotland’s 10,000 homeless children to dry their eyes as life is much worse in England.

Nationalists of this stripe display an almost sociopathic lack of empathy for others. It’s "‘I’m alright, so why should I care about homeless kids? I want independence".

Children can’t eat flags.

Let’s be clear, temporary accommodation means families with children living in one room in cheap hotels. In Scotland, that can continue for two years. Families have been told to use showers for drinking water.

However, even claiming matters are "better" in Scotland could well be false. Shelter discovered that Scotland is "exporting" homeless families to England for accommodation.

People are committing crimes to get jailed so they’ve a roof over their head. That’s how bad it is.

This pattern of failure is replicated across all social policy. Scotland’s public servants are at the end of their tether: teachers, police, social workers, doctors and nurses.

Such grotesque failure is an open goal for extremists, the far-right in particular. The tactics they can deploy don’t need to be spelt out.

It’s not as if there isn’t still plenty of fat to cut in Scotland, from the right places. We could save £2m right now by ending the disgraceful practice of chauffeuring Scottish judges around in luxury cars as if they’re Hollywood A-listers.

Then there’s all those fat-cat quango boss super-salaries.

Rein in the rich, protect the poor. That should be the only motto for government today.

What does the SNP do, though? Rather than engaging some intellect, it’s now embarked upon more narcissistic, meaningless introspection.

Depute leader Keith Brown is pondering whether the party should withdraw from Westminster.

How about doing some real work for the money we pay you and fixing the most catastrophic of all Scottish Government mistakes, the council tax freeze?

Most of the £100m saved to households through the freeze goes to the well-off. The SNP is obsessed with protecting its middle-class vote.

Households with children in poverty will see only £3m in savings. Yet they’ll be the ones bearing the brunt of the decline in public services caused by the freeze.

The Government could have used the money instead to - oh, I don’t know - maybe build some social housing? Tackle child poverty? Remove kids from temporary accommodation?

Ministers don’t need to be mathematical geniuses, but a basic understanding of arithmetic would be nice.