I'm reading about pollard rho's algorithm for computating the discrete log. To comprehend the algorithm, I do a concrete example, but obviously I'm making a mistake.
In general: Let $G = \langle g \rangle$ be a cyclic group of order $m$, let $x \in G$ and we want to find $\log_g x$. After finding a collision $x^{\nu_i} g^{\mu_i} = x^{\nu_j} g^{\mu_j}$, we have $x^{\nu_i - \nu_j} = g^{\mu_j - \mu_i}$ and if $\nu_i - \nu_j$ and $m$ are coprime, there is a $\lambda$ with $(\nu_i - \nu_j) \lambda \equiv 1 \bmod m$ leading us to $x = g^{(\mu_j - \mu_i) \lambda}$, so $\log_g x = (\mu_j - \mu_i) \lambda$.
Example: Let $G = \mathbb Z/101 \mathbb Z$ where $3$ is a primitive root. The goal is to calculate $\log_3 87$ (which should be $40$ since $87 \equiv 3^{40} \bmod{101}$). Doing the algorithm, the first collision is $5 \equiv 87^2 \cdot 3^{16} \equiv 87^4 \cdot 3^{36}$. So, $87^{-2} \equiv 3^{20}$ and since $-2$ and $101$ are coprime, there is a $\lambda$ satisfying $-2 \lambda \equiv 1 \bmod 101$, namely $\lambda = 50$.
Having $87^{-2} \equiv 3^{20}$ and $-2 \lambda \equiv 1 \bmod 101$, we should have $x = 3^{20 \cdot 50} = 3^{500} \equiv 1$... but $x = 87 \not\equiv 1$. Where is the mistake?
The problem is that you are using the wrong modulus for the exponents. You are really working in the multiplicative group $(\mathbb{Z}/101)^\times$ which is cyclic of order 100, not order 101, so $m$ in your earlier notation is 100 not 101.