I am confused on how to find a function from a set that is also a 3-to-1 correspondence? I have a homework problem that asks me to find a function from the set $\{1, 2, \ldots, 30\}$ to $\{1, 2, \ldots, 10\}$ that is a $3$-to-$1$ correspondence, I am confused on how to even derive a function from the sets that also are $3$-to-$1$ correspondence. In class we have had $k$-to-$1$ rule examples but never done $3$-to-$1$ or any $x$-to-$1$ problems so I am confused on how to apply it to my homework.
I will rewrite the problem for context:
Find a function from the set $\{1, 2, \ldots, 30\}$ to $\{1, 2, \ldots, 10\}$ that is a $3$-to-$1$ correspondence. (You may find that the division, ceiling or floor operations are useful).

The 'obvious' way to do this would be to send $1,2,3$ to $1$, then $4,5,6$ to $2$ and so on, so $28,29,30$ goes to $10$. This would be $f(n) = \lceil \frac{n}{3} \rceil$.
Another (possibly neater) idea would be $1,11,21 \rightarrow 1$, then $2,12,22 \rightarrow 2$ etc. This would be $f(n) = n$
(mod $10$).
In fact, there are many different possible answers - most will not have a neat closed form like these, but any partition of $\{1, \ldots, 30\}$ into $10$ groups of $3$ can be such a function, by sending the first group of $3$ to $1$, the 2nd group to $2$ and so on
