All books

Professional

Apps About Coach Log in Start reading

Quantitative Finance · Glossary

What is Complementary counting?

Definition 10.1 The Interview Book · Chapter 10 — Probability I

Complementary counting computes the probability of an event through its complement, P(A)=1−P(Ac)\P(A) = 1 - \P(A^c), when the complement is a single simple case and the event itself is a union of many overlapping ones: “at least one”, “some two coincide”, “not all different”.

Examples

Example 10.2 (Colliding identifiers)

Thirty client order identifiers are drawn uniformly and independently from 10 000 values. The chance that all differ is ∏k=029(1−k/10 000)≈0.957\prod_{k=0}^{29}(1 - k/10\,000) \approx 0.957, so at least two coincide with probability about 0.043. The approximation 1−e−n(n−1)/(2N)1 - e^{-n(n-1)/(2N)} gives the same to three decimals, and it shows the scale: collisions become likely once nn is of the order of N\sqrt N.

Read in context →