According to wikipedia, a perfect hash function is a hash function that uses algorithms that has a certain random aspect to their logic. It is suppose to be collision-free.
However due to the pigeon hole principle where given a set of all possible preimages M & a set S where S is the set of all possible hash values resulting from H(M) = (S) & set M is bigger than set S. How does a perfect hash function have collision-resistant in this case?
Based on the answer given by poncho the pre-images are known beforehand & thus the hash function is structured in such a way that there exist a unique hash value for each message. However my confusion exist is that given a message space where each message is for example at least (4 bits long = 16 possibilities) & the hash value is return as (2 bits long = 4 possibilities) value. How can this still possibly be collision-resistant?
Summary, in a perfect hash function:
Must the bit length of the hash value be long enough to cover N number of messages?
Does it not simply make a perfect hash function as a specified lookup table for a set of predetermined message?
Another side question is in the wikipedia page there is a mention of a minimal perfect hash function. Is a hash function that distributes the hash value uniformly across S (Where S is the set containing all possible Hash value resulting from message space M)