To analyze the amortized cost of the ith TableInsert operation, let
numi denote the number of items stored in the table after the ith operation
sizei denote the total size of the table after the ith operation
denote the potential after the ith operation
Initially, num0 = 0, size0 = 0, and = 0.
Consider two cases based on whether a table expansion is done.
No expansion: