Ask Claude about this

Aggregating Averages: Linearity of Expectation

Expected Value of Individual Events

As discussed before, the Expected Value (E[X]) of a random variable X represents its long-run average. For a single event with a certain probability of occurring and an associated value (e.g., cost or gain), we can calculate its expected value.

For an event that either happens (with value V₁ and probability p) or doesn't happen (with value V₂ and probability 1-p), the expected value is E = V₁ × p + V₂ × (1-p).

Linearity of Expectation

A very powerful property of expected values is the Linearity of Expectation. It states that the expected value of a sum of random variables is equal to the sum of their individual expected values, regardless of whether the variables are independent or not.

E[X + Y] = E[X] + E[Y]

More generally, for N random variables X₁, X₂, ..., XN:
E[X₁ + X₂ + ... + XN] = E[X₁] + E[X₂] + ... + E[XN]

This property is extremely useful for calculating the expected total outcome (like total cost or total winnings) when multiple independent (or even dependent) events contribute to the total.

Rideshare Voucher Expected Cost

MODERATE

A rideshare company gives N riders a $5 voucher each. Each rider uses the voucher with an independent probability p. What is the expected total cost to the company for these vouchers?

Business Decision: If the company expects to make an average profit of $2 per rider after accounting for voucher costs, what would be the maximum probability 'p' they could tolerate for voucher usage if N=1000 riders?

 

Nerchuko Academy · Free DS Interview Prep