clear; clc;

N = 1e5;
m = 0;
for i = 1 : N
    s = 0;
    n = 0;
    while s < 1
        s = s + rand(1);
        n = n + 1;
    end
    m = m + n;
end
m / N