Skip to content

Instantly share code, notes, and snippets.

@mrkrause
Last active July 9, 2021 19:51
Show Gist options
  • Select an option

  • Save mrkrause/e33c589b901b4b8c96f940ea0a480b6e to your computer and use it in GitHub Desktop.

Select an option

Save mrkrause/e33c589b901b4b8c96f940ea0a480b6e to your computer and use it in GitHub Desktop.
Trivial simulation to see if "bar raising" exponentially increases # of interviews
using Statistics
using Plots
function generate_candidates(;n=1)
return 100 .+ (15 .* randn(n, 1))
end
N_HIRES = 100
N_REPS = 1000
time_to_hire = zeros(N_HIRES, N_REPS)
for rep= 1:N_REPS
team = generate_candidates(n=10)
for i = 1:N_HIRES
bar = median(team)
n_seen = 1
while (c = generate_candidates(n=1)[1]) < bar
n_seen += 1
end
team[rand(1:length(team))] = c
time_to_hire[i, rep] = n_seen
end
end
plot(mean(time_to_hire, dims=2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment