This is the question I am attempting:

This is the provided solution:

I am not able to arrive at the final solution.
Question 1
The part where my solution differs is at (I). I have: $$ \frac{2n}{\sum\limits_{i=1}^nx_i -\sum\limits_{i=1}^n y_i } = \frac{2n}{n\bar{x}-n\bar{x}} = \frac{2n}{n(\bar{x}-\bar{y})}=\frac{2}{\bar{x}-\bar{y}}$$
How do I get the $+$ in the denominator?
Question 2
Furthermore, assuming that (I) is correct I am not able to get the last equality in (II). I got $$\left(\frac{1}{2}\right)^{2n}\frac{(\bar{x}+\bar{y})^{2n}}{(\bar{x}\bar{y})^n}$$. What rules can I use to further simplify this expression?
Question 3
Lastly, if I assume (II) is true, I am still not able to get (III). The furthest I got is: $$ -4n\log(2) + 2\log(\bar{x}+\bar{y}) - \log(\bar{x}) + \log(\bar{y})$$. I have to idea how to combine the last 3 terms into a single expression like to the solution did. Please help.
I'm not entirely sure the reason behind the $\pm$ issue in your first request, I think this is a typo. For your second I wonder if it has (for reasons beyond me) been re-written as \begin{eqnarray} \left(\frac{1}{2}\right)^{2n}\frac{(\bar{x}+\bar{y})^{2n}}{(\bar{x}\bar{y})^n} &=& \left(\frac{1}{2}\right)^{2n}\frac{(\bar{x}+\bar{y})^{2n}}{(\sqrt{\bar{x}\bar{y}})^{2n}} \\ &=& \left(\frac{1}{2}\right)^{2n}\left(\frac{\bar{x}+\bar{y}}{\sqrt{\bar{x}\bar{y}}}\right)^{2n} \end{eqnarray} As you can see I can't describe why the final answer in the printed answer is not of a power of $2n$. I think this is in error in your book/article. However, following the calculation through, we find; \begin{eqnarray} \log r( x,y) &=& -2n \log 2 + 2n log \left(\frac{\bar{x}+\bar{y}}{\sqrt{\bar{x}\bar{y}}}\right) \\ &=& -2n \log 2 + 2n log \left( \frac{\sqrt{\bar{x}}}{\sqrt{\bar{y}}} + \frac{\sqrt{\bar{y}}}{\sqrt{\bar{x}}} \right) \\ &=& -2n \log 2 + 2n log \left( \sqrt{\frac{\bar{x}}{\bar{y}}} + \sqrt{\frac{\bar{y}}{\bar{x}}} \right) \end{eqnarray} The above result is now found by multiplying it by 2. The penultimate line in the above formulation was obtained by making use of the identity \begin{equation} \frac{a}{\sqrt{a}} = \sqrt{a} \end{equation} For $a \neq 0$.
Any other issues, please let me know, Best, A.