سوال ۶۱ کنکور ارشد مهندسی کامپیوتر ۱۴۰۰
خانوادهٔ از توابع درهمساز را درنظر بگیرید که . برای آن که این خانواده یک خانوادهٔ درهمساز سراسری باشد، n حداکثر چند میتواند باشد؟ خانوادهٔ توابع سراسری است، اگر و فقط اگر بهازای هر دو مقدار u و v داشته باشیم: که m اندازهٔ جدول درهمسازی است.
پاسخ صحیح: گزینهٔ B — ۴
Each hash function maps keys into , so the table size is and universality requires, for every pair of distinct keys ,
The family has exactly two functions chosen uniformly, so for a pair this probability equals , which is , , or . The bound therefore means: for every pair, at most one of may map them to the same value — equivalently, no pair may collide under both functions.
Form the combined map
Two keys collide under both functions exactly when . To forbid any such pair, must be injective on the keys. Since the codomain has only elements, injectivity forces
is achievable. Give the four keys distinct -values:
so and . Every pair differs in at least one coordinate, so each pair collides under at most one function and holds throughout — the family is universal.
fails. By the pigeonhole principle, two of the five keys must share the same pair , so they collide under both and , giving .
Hence the largest possible is , option 2.
Exam trick: With functions each into a table of size , the joint map lands in buckets; universality (no pair forced to collide everywhere) caps at . Here .