Percentage purity of Ba(MnO4)2 sample that completely reacts with given H2O2? $\pu{40 g}$ $\ce{Ba(MnO4)2}$ (mol. wt. = 375) sample containing some inert impurities in acidic medium is completely reacted with $\pu{125 mL}$ of $\pu{3 M}$ $\ce{H2O2}$. What is the percentage purity of the sample?


I actually found this question in a book, I found its solution but I cannot properly understand it. This is the first equation given: 

Since milliequivalents of $\ce{Ba(MnO4)2}$ = milliequivalents of $\ce{H2O2}$
$$(w/375)\times10\times1000 = 3\times125\times2 $$ 

I understand the RHS as $3\times125$ gives number of millimoles which multiplied by n-factor gives milliequivalents. But where does the LHS come from? And what is $w$? In the next line it is given 

$$ \text{percentage purity} = (w/40)\times100 $$ 

where the value of $w$ is taken from the first equation. Would someone please explain this to me?
The question does not demand to solve it using "equivalents," I'm going to attempt to solve the problem in universal way, using moles. As OP correctly suggested, this reaction of $\ce{Ba(MnO4)2}$ and $\ce{H2O2}$ is a redox reaction. Since the reaction has taken place in acidic medium and has completely reacted (assuming observation is made by appearance so assuming it was judged by clear solution), the two half reactions should be:

$$
\begin{align}
\ce{MnO4- + 8H+ + 5e- &amp;-&gt; Mn^2+ + 4H2O} &amp; E^\circ &amp;= \pu{1.507 V} \\ 
\ce{H2O2  &amp;-&gt; O2(g) + 2H+ + 2e-} &amp; E^\circ &amp;= \pu{-0.695 V}
\end{align}
$$

Thus, total redox reaction can be written as:

$$\ce{2MnO4- + 6H+ + 5H2O2 -&gt; 2Mn^2+ + 5O2(g) + 8H2O} \quad E^\circ_\mathrm{rxn} = \pu{0.812 V}$$

The positive $E^\circ_\mathrm{rxn}$ means the reaction is spontaneous. And it also shows that you need $\pu{5 mol}$ of $\ce{H2O2}$ to completely react with $\pu{2 mol}$ of $\ce{MnO4-}$. Since $\pu{1 mol}$ of $\ce{Ba(MnO4)2}$ contains $\pu{2 mol}$ of $\ce{MnO4-}$, it is correct to say that $\pu{5 mol}$ of $\ce{H2O2}$ would completely react with $\pu{1 mol}$ of $\ce{Ba(MnO4)2}$. 

Suppose that $\pu{40 g}$ of impure sample contains $x~\pu{g}$ of $\ce{Ba(MnO4)2}$. Then, amount of of $\ce{Ba(MnO4)2}$ in the sample is

$$\frac{x~\pu{g}}{\pu{375 g\cdot mol-1}} = \frac{x}{\pu{375 mol}}.$$

To completely react with that amount, you need

$$\left(5\cdot\frac{x}{375}\pu{mol}\right)~\text{of}~\ce{H2O2}.$$

Thus,

$$5\times\frac{x}{375}\pu{mol} = \pu{3\frac{mol}{L}}\times\pu{125 mL}\times \pu{10^{-3} \frac{L}{mL}} = 3\times \pu{0.125 mol} \label{eq:1}\tag{1}$$

$$\therefore x = \pu{\frac{ 3\times 0.125 \times 375}{5} g} = \pu{28.1 g}$$

Thus,

$$\text{percentage of $\ce{Ba(MnO4)2}$ in the $\pu{40 g}$ of sample} = \frac{28.1}{40}\times 100 = 70.2$$

Note that, the equation $\eqref{eq:1}$ is exactly the same as yours (with minieq.)