I once read the following problem: compute
$$\sum_{A,B\in\mathcal{P}(\Omega)}\operatorname{card}(A\cap B)$$ where $\Omega$ is a set of cardinal $n>0$ and $\mathcal{P}(\Omega)$ the set of the sets of $\Omega$.
At that time, I managed to prove that the sum was equal to $n\,2^{2(n-1)}$ with multiple inductions, which was very tedious.
Some time ago, someone showed a very efficient proof using the indicator function: $$\operatorname{card}(A)=\sum_{\omega\in\Omega} 1_A(\omega)$$ Then,
\begin{align}\sum_{A,B\in\mathcal{P}(\Omega)}\operatorname{card}(A\cap B)&=\sum_{A,B\in\mathcal{P}(\Omega)}\sum_{\omega\in\Omega} 1_A(\omega)1_B(\omega)= \sum_{\omega\in\Omega}\sum_{B\in \mathcal{P}(\Omega)} 1_B(\omega)\Big(\sum_{A\in\mathcal{P}(\Omega)}1_A(\omega)\Big) \\ &=\sum_{\omega\in\Omega} \sum_B 1_B(\omega) 2^{n-1} = \sum_{\omega\in\Omega} 2^{2(n-1)}=n\,2^{2(n-1)} \end{align}
I think it is hard to beat this proof (in terms of length), but I am curious if anyone here would end up with another proof.
I’d have expressed essentially the same idea verbally:
In that sum each $\omega\in\Omega$ gets counted once for each pair $\langle A,B\rangle\in\Omega\times\Omega$ such that $\omega\in A\cap B$. There are $2^{n-1}$ sets $A\subseteq\Omega$ such that $\omega\in A$, so there are $2^{2(n-1)}$ such pairs. Thus, each of the $n$ elements of $\Omega$ gets counted $2^{2(n-1)}$ times, for a total count of $n2^{2(n-1)}$.