Data Structures · Hash tables and probabilistic performance
Throw n balls independently and uniformly into n bins
Problem
Throw \(n\) balls independently and uniformly into \(n\) bins. Let \(X_i\) be the number of balls in bin \(i\), and let \(X=\max_i X_i\). You may use linearity of expectation and Markov’s inequality. You may not use Chernoff bounds, moment-generating functions, or the known \(\Theta(\log n/\log\log n)\) maximum-load theorem. (a) Prove that \(\mathbb{E}[X_i(X_i-1)]=1-1/n\) for each \(i\). (b) Prove that \(\mathbb{E}[X_i^2]\le 2\). (c) Let \(Y\) be the number of bins with \(X_i\ge\sqrt n\). Using Markov’s inequality on a random variable built from the \(X_i\) (specify it), prove that \(\Pr[X\ge\sqrt n]=O(1/\sqrt n)\) for \(n\ge 1\), or give any bound of the form \(\Pr[X\ge\sqrt n]\le c/\sqrt n\) with an explicit constant \(c\). (d) Deduce that \(\mathbb{E}[X]=O(\sqrt n)\). (Use \(X\le n\) always, and split the expectation according to whether \(X\ge\sqrt n\).)
Hint
\(X_i(X_i-1)\) counts ordered pairs of distinct balls in bin \(i\).
Check your work
Work the problem yourself first. Then open it in Training to check your answer and read the full worked solution.
The answer check and full solution for this problem come with ProofAnvil Practice membership ($19 USD monthly). See membership. Or start with the free Data Structures sample problem: Try the free sample problem.
More Data Structures practice problems
- Let V be a dynamic array of n elements stored in a buffer of capacity c, with the…Abstract data types, representation, and invariants
- A ring buffer (circular array) of fixed capacity C≥ 1 stores a sequence of at most C…Abstract data types, representation, and invariants
- Let L be the doubly linked list with values [10, 20, 30, 40, 50], and let I be a…Arrays, linked structures, stacks, queues, and amortization
- Consider BST deletion of a node zSearch trees and balanced trees
- Let T be a BST whose nodes contain only key, left, and right fields (no parent…Search trees and balanced trees
- Consider a hash table T of size m = 11 that resolves collisions by chainingHash tables and probabilistic performance
- `Bubble-Down`(A,i,n) is specified as follows on a 1-based array that is a complete…Heaps, priority queues, and disjoint sets
- The fat-node method of partial persistence stores, in each field of each node, a…Graph representations and traversals
- A duplicate minimum must sit on the min-stack, or one pop forgets the otherArrays, linked structures, stacks, queues, and amortization