Let's determine the pairs of positive integers $(x, y)$ for which

$$
x^{y}-y^{x}=1
$$
The most crucial moment in our solution will be to show, using various estimates of the expression $x^{y}-y^{x}$, that its value is greater than 1 in "most cases," or smaller. From the remaining "few" pairs $(x, y)$, it will then be easier to select the solutions. During the estimates, we will use the fact that for any positive $d$ and natural number $n$, the following holds:

$$
\left(1+\frac{d}{n}\right)^{n} < e^{d}
$$

Let $x=y+d$, where $d \geq 1$. Suppose $y \geq 3$; then

$$
y^{d} \geq 3^{d} > e^{d} > \left(1+\frac{d}{y}\right)^{y}
$$

Therefore,

$$
x^{y}-y^{x} = (y+d)^{y} - y^{y+d} = y^{y} \left( \left(1+\frac{d}{y}\right)^{y} - y^{d} \right) < 0
$$

This implies that $x^{y} < y^{x}$. Since $x > y$, the only possible value for $x$ is 3, and this is indeed a solution with $y=2$. $x=4$ is not a solution, and if $x \geq 5$, we will show by induction that $2^{x} - x^{2} > 2$ (i.e., the left side of the equation is less than $-2$). For $x=5$, this is true; assume it is true for some $x > 4$, then from $2^{x} - x^{2} > 2$,

$$
2^{x+1} - (x+1)^{2} = 2 \cdot 2^{x} - \left(\frac{x+1}{x}\right)^{2} x^{2} > 2 \cdot 2^{x} - \frac{36}{25} x^{2} > 2 \left(2^{x} - x^{2}\right) > 2 \cdot 2 > 2
$$

Thus, the inequality holds for all integers greater than 4. In the case $x > y$, the only solutions found are valid.

2. Case: $x < y$

$$
\begin{aligned}
x^{y} - y^{x} & = x^{x} \left( x^{y-x} - y^{y-x} \right) \\
& > x^{x} \left( x^{d} - y^{d} \right) \\
& > x^{x} \left( x^{d} - e^{d} \right) \geq 3^{3} \left( 3^{d} - e^{d} \right) \geq 3^{3} (3 - e) > 1
\end{aligned}
$$

Thus, the only possible values for $x$ are 1 and 2. If $x=1$, then the equation gives $y=0$, which is not a solution.

If $x=2$, then the equation is:

$$
2^{y} - y^{2} = 1
$$

In the examination of the first case, we showed that the left side of this equation is greater than 2 if $y$ is at least 5. This leaves $y=3$ and $y=4$, but neither is a solution.

The pairs of numbers that satisfy the equation are thus:

$$
x_{1}=2, y_{1}=1 \text{ and } x_{2}=3, y_{2}=2 \text{. }
$$