$$\text{Let }\space S\subset\{1,2,\ldots,101\}\text{ s.t }\space|S|=52.\\\text{Prove that there exist different values }a,b,c\in S\text{ s.t }\\a+b=c.$$
That question appeared at my last Discrete math exam.
One of the solutions I've tried to understand is defining a function $F$ from $S$ to $\{1,2,\ldots,50\}$ so $F(n)$ returns $n$ if $n\leqslant50$, otherwise it returns $m-n$ while $m$ is the maximum value at set $S$.
I can’t figure why this works, I mean, I know it works, but I want to be able to use the same idea at similar variations.
edit: F is defined from S\{m} to {1, ..., 50}
Here is a hint on how to proceed:
First your function $F$ needs to be adjusted to be $F:S \rightarrow \{1,2,\dots,51\}$ given by $F(n) = n + 1$ if $n \le 50$ and $F(n) = m - n + 1$ for $n > 50$. Verify this function is well defined (I just added 1 to the function you gave.)
Then consider what the pigeonhole principal gives when considering the number of inputs of $F$ (as the letters/pigeons) and the number of possible output of $F$ (as pigeonholes.)
Be careful to keep in mind is that $S$ contains exactly 52 distinct elements.