Given I have a prime number p, and two sets of distinct integers {k0, k1, k2, ... , km} and {h0, h1, h2, ... , hm}. All integers in these sets are nonnegative and less than p.
I want to find a linear transformation between sets k and h.
$ak + b \equiv h\pmod p$
The order of elements doesn't matter, as long as I can find a bijective, linear transformation between the sets. In other words, values of a and b such that for each element ki in k, aki + b (mod p) corresponds to a different element in h.
My question is this: what are the set sizes m for which such a linear transformation is guaranteed to exist?
Obviously, m=1 and m=p are trivial, and there are p-1 transformations between k and h. I haven't found anyone else asking about this on the math StackExchange, and it doesn't appear to be a common question elsewhere. It's occurred to me that there may be a guaranteed solution for any set size, but in such a case I'd like to see a clear proof as to why.
In case the context helps or matters, I'm studying universal hashing and am trying to understand why it works. If there are no limitations on the size of m, that's sufficient to prove that universal hashing can't be broken. Obviously, there are other ways to prove that, but I understand modular arithmetic a bit more intuitively and am trying to approach from that angle.