As I mentioned above, I am not sure what the variable $r$ is. If we ignore that, or assume the questioner wanted to say its the risk free interest rate, then it has no effect on the number of paths.
Then it is clear that after 50 steps going from \$1024 to \$2500 requires a net of 4 up movements with the given $x=y^{-1}=1.25$. Thus the number of steps without the barrier constraint is $\phantom{a}^{50} C_{23}$.
We need to subtract from this the number of paths that cross \$3125 and yet end up on \$2500. For each such path, there is one that passes through \$3125 at the same place but then is reflected across the line \$3125 to end up on \$3906.25. In other words the reflected path has a net 6 up movements. An example of this method is shown below. The numbers used are for a different problem. 
So the number of such paths is $\phantom{a}^{50} C_{28}$. However, recall these are the paths we need to exclude as they crossed the barrier.
Thus the number of paths consistent with ending up on \$2500 having never crossed \$3125 is
$$
\phantom{a}^{50} C_{23}- \phantom{a}^{50} C_{28}
$$
This is not the same as that asked in the question because of the difference in the first term but I suspect that is a typo.