Premium problem101. Variance of a Correlated Ensemble

Medium Locked

n models each have error variance v, and every pair of them is correlated rho. Return the variance of their average error.

Var(eˉ)=vn(1+(n−1)ρ)\mathrm{Var}\left(\bar{e}\right) = \frac{v}{n}\bigl(1 + (n-1)\rho\bigr)

This is the central fact about ensembling. At ρ=0\rho = 0 the variance falls like 1/n1/n; at ρ=1\rho = 1 it does not fall at all. Averaging models that make the same mistakes buys you nothing.

Input

n = 10
v = 1.0
rho = 0.0

Output

0.1

Premium problem

This one's part of Premium. Unlock the full Probability track plus every other premium problem on the site.

Implement solve(...)