microsoft/ALEX

The meaning of expected shifts approximation formula

Losk-x opened this issue · 0 comments

// ((n-1)/2)((n-1)/2 + 1) = n^2/4 - 1/4

The paper said that in the assumption that "inserts are done according to the existing key distribution", the "average number of shifts for inserts is computed as the average distance to the closest gap in the Gapped Array for all existing keys".

I dont know how to deduce this formula (n-1)/2 * ((n-1)/2+1) from above. Can anybody explain it in detail? Thanks.