Collision counts and collision probability

A test selects a hash function at random for seven fixed, distinct identifiers. Across the possible selected functions, each identifier's hash code is equally likely to be any integer from 0 through 19, and the seven codes are independent. Once selected, the function remains fixed for later evaluations.


A collision occurs when distinct identifiers receive the same hash code. Calculate both quantities below for the initial random selection:

  • The expected number of colliding unordered pairs, to two decimal places.
  • The probability of at least one collision, as a decimal to four decimal places.
Your answers

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: