First, you need to a way to generate candidates of varying abilities. There are all sorts of tough questions related to measuring intelligence, but let's side-step those and make something like IQ. By construction, IQ is normally distributed with a mean of 100 and a standard deviation of 15.
function generate_candidates(;n=1)
return 100 .+ (15 .* randn(n, 1))
end
With that, make the initial team and find the "bar" for a new hire: team = generate_candidates(;n=10)
bar = median(team)
To replace a candidate, you just sit in a loop, "interviewing" candidates until one exceeds the bar. candidates_seen = 1
while (new_candidate = generate_candidates(n=1)[1]) < bar
candidates_seen += 1
end
Once you find that person, you kick someone out of the team and replace them with the new candidate. I did it at random, but eliminating the lowest performer only exaggerates the effect. team[rand(1:length(team))] = c
Having done that, you need to recalculate the now-raised bar: bar = median(team)
We repeat this process a small number of times to simulate turn-over within a team. Since it's random, you want to repeat the entire process a number of times too. Complete code: https://gist.github.com/mrkrause/e33c589b901b4b8c96f940ea0a4...I had a hunch this process would be exponential, and it certainly looks that way if you plot the results. This was meant as a quick-and-dirty way to check that: there are some tricks that might speed up the simulation and it might even be possible to do the whole thing analytically (but it's Friday afternoon).
FWIW, I highly highly recommend this sort of noodling around for building intuitions. At work, we recently spent a year and $$$ collecting some brain data, and a dumb model like this was the key to figuring out what was going on.