Does transforming a hash improve its distribution?

A catalogue computes an exact nonnegative integer code C(k)C(k) for each key kk. A developer proposes replacing


h(k)=C(k) mod 12h(k)=C(k)\bmod12


with


g(k)=(5C(k)+7) mod 12.g(k)=(5C(k)+7)\bmod12.


Both functions return indices from 0 through 11, and arithmetic has no overflow. Which statements hold for every possible collection of keys? Select all that apply.

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Hash Codes and Hash Functions Questions: