Concepts4
⚙️AlgorithmIntermediate
Double Counting
Double counting is the strategy of counting the same quantity in two different ways to derive an equality or an efficient algorithm.
#double counting#contribution technique#handshake lemma+12
⚙️AlgorithmIntermediate
Contribution Technique
The contribution technique flips perspective: compute how much each element contributes to the total, then sum these contributions.
#contribution technique#monotonic stack#sum of subarray minimums+12
∑MathIntermediate
Linearity of Expectation Applications
Linearity of expectation says the expected value of a sum equals the sum of expected values, even if the variables are dependent.
#linearity of expectation#indicator variables#expected inversions+12
∑MathIntermediate
Expected Value
Expected value is the long-run average outcome of a random variable if you could repeat the experiment many times.
#expected value#linearity of expectation#indicator variables+12