Here is a problem from Cut The Knot:
Ambassadors at a Round Table
$2n$ ambassadors are invited to a banquet. Every ambassador has at most $n-1$ enemies. Prove that the ambassadors can be seated around a table, so that nobody sits next to an enemy.
Solution
The analysis at the Cut The Knot site takes a 'shallow dive' into graph theory (nodes and edges) and geometry (circles, regular polygons, and vertices) to describe the algorithmic solution. Here we derive it using the language of elementary set theory, although many of the details will be left for the reader to fill in.
In the next section we develop some general theory. In the last section an algorithm is constructed that can be applied to the seating problem (it is left to the reader to understand why this model works).
General Theory
Let $A$ be a set with $n \ge 2$ elements. Recall that bijective transformations of $A$ are also called permutation of $A$.
Here we are interested in the cyclic permutations on $A$ and $k\text{-cycles}$. where $2 \le k \le n$.
We'll call any cycle of maximum length $n$ a seating arrangement of $A$.
Let $\sigma$ be a seating arrangement $A$. If $a \in A$ the injective function $\sigma'$ restricted to $A \setminus \{a\}$ is a partial function. The function can be understood as a trajectory
$$\tag 1 {\sigma}^1(a) \mapsto {\sigma}^2(a) \mapsto \dots \mapsto {\sigma}^{n-1}(a) \mapsto {\sigma}^{n}(a) = a$$
The trajectory is of length $n$, starting at ${\sigma}^1(a)$ (not in the range of ${\sigma'}$) and ending at $a$ (not in the domain of ${\sigma'}$).
In general, an injective sequence $(a_i)_{\, 1 \le i \le k}$ with $2 \le k \le n$ defines a trajectory $\tau$ in a natural way,
$$\tag 2 \tau(a) = a_{i+1}, \text{when } a = a_i, \text{ for } i \lt k$$
The transition ${\tau}^{j}(a) \mapsto {\tau}^{j+1}(a)$ in a trajectory is called a step to the right. The same terminology can be used when working with cycles and we can also take steps to the left (but not always possible with a trajectory). Also, we can extend the cycle notation to trajectories,
$$\tag 3 \tau = Œ|\, a_1 a_2 \dots a_k \,þ \text{ where } a_1 \text{not in range and } a_k \text{ not in domain of } \tau $$
We have the following result.
Proposition 1: Every injective partial transformation on a finite set $A$ with no fixed points defines a partition on $A$ that corresponds to a decomposition of the transformation into $k\text{-cycles and/or trajectories}$.
Now consider a symmetric homogeneous relation $\rho$ on $A$. If $\sigma$ is a permutation of $A$, let $\Gamma(\sigma, \rho)$ denote the number of elements that belong to both the graphs of $\sigma$ and $\rho$. We have the following,
$$\tag 4 \Gamma(\sigma, \rho) = \Gamma(\sigma^{-1}, \rho)$$
The Algorithm
Let $A$ be a finite set with $2n$ elements with $n \ge 2$ and $\rho$ a symmetric homogeneous relation on $A$ that does not intersect the diagonal $\Delta_A$. Suppose that for every $a \in A$, the set $\rho(a)$ has at most $n - 1$ elements.
Let $\sigma$ be any cyclic permutation of $A$ of length $2n$, i.e. a seating arrangement.
If $\Gamma(\sigma, \rho) \gt 0$, using cyclic notation we can write
$$\tag 5 \sigma = \big ( \; a \, \sigma(a) \dots \sigma^{2n-1}(a) \; \big ) \text{ where } (a,\sigma(a)) \in \rho$$
Taking steps to the right of $\sigma(a)$ look for $\sigma^k(a)$ with $(a,\sigma^k(a)) \notin \rho$ and $(\sigma(a),\sigma^{k+1}(a)) \notin \rho$. A simple counting argument shows that such a $2 \le k \lt 2n-1$ can be found.
The trajectory
$$\tag 6 Œ|\, \sigma(a) \dots \sigma^k(a) \,þ $$
can be inverted
$$\tag 7 Œ|\, \sigma^k(a) \dots \sigma(a) \,þ $$
With
$\quad J = \big\{(a,\sigma^k(a)), (\sigma(a),\sigma^{k+1}(a))\big\} \cup [Œ|\, \sigma^k(a) \dots \sigma(a) \,þ]$
and
$\quad R = \big\{(a,\sigma(a)), (\sigma^k(a),\sigma^{k+1}(a))\big\} \cup [Œ|\, \sigma(a) \dots \sigma^k(a) \,þ]$
define
$$\tag 8 \sigma' = \big [ \sigma \cup J \big ] \setminus R$$
It is not difficult to demonstrate that $\sigma'$ is a permutation and is also in fact a seating arrangement. It can also be shown that
$$\tag 9 \Gamma(\sigma', \rho) = \Gamma(\sigma, \rho) -1 \text{ OR } \Gamma(\sigma', \rho) = \Gamma(\sigma, \rho) -2$$
By the Principle of Infinite Descent the algorithm terminates with $\Gamma = 0$.