We need to find how many students failed in the exam.

Suppose that x students’ failed in the exam.

Therefore (26 — x) students passed in the exam.

Again, let us consider that total score of the passing students were y, and total score of the failed students were z.

Then the mean score of those who passed was 78,

\(\displaystyle{\frac{{{y}}}{{{\left({26}-{x}\right)}}}}={78}\)....(i)

The mean score of those who failed was 26,

\(\displaystyle{\frac{{{z}}}{{{x}}}}={26}\)....(ii)

The mean of all score was 72,

\(\displaystyle{\frac{{{y}+{z}}}{{{26}}}}={72}\)....(iii)

From the equation (iii)

\(\displaystyle{\frac{{{y}+{z}}}{{{26}}}}={72}\)

\(\displaystyle{y}={z}={1872}\)

\(\displaystyle{z}={1872}-{y}\)

Putting \(\displaystyle{y}={1872}-{26}{x}\) in the equation (i)

\(\displaystyle{\frac{{{y}}}{{{\left({26}-{x}\right)}}}}={78}\)

\(\displaystyle{\frac{{{1872}-{26}{x}}}{{{\left({26}-{x}\right)}}}}={78}\)

\(\displaystyle{1872}-{26}{x}={78}{\left({26}-{x}\right)}\)

\(\displaystyle{1872}-{26}{x}={2028}-{78}{x}\)

\(\displaystyle{78}{x}-{26}{x}={2028}-{1872}\)

\(\displaystyle{52}{x}={156}\)

\(\displaystyle{x}={3}\)

Therefore, 3 students failed in the exam.