% % Written by: % -- % John L. Weatherwax 2006-12-31 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- close all; clc; clear; n = 1000; [probs,mi,mv] = eval_prob_best_selection(n); figure; plot( 1:(n-1), probs, '-o' ); xlabel('number of prescreening interviews'); ylabel('probability of picking the optimal secretary'); addpath('~/Matlab'); ms = 1:(n-1); vline( ms(mi) ); text( ms(mi)*(1+.1), mv*(1-0.5), ['optimal m=',num2str(ms(mi)),'; n=',num2str(n)] ); saveas(gcf,'../WriteUp/Graphics/example_prob_best_calc.eps', 'epsc'); % Plot what the optimal fraction of the candidates to interview is each value of n % ns = 10:1000; opt_fraction_of_candidates_to_interview = zeros(1,length(ns)); for ni = 1:length(ns), [probs,mi,mv] = eval_prob_best_selection(ns(ni)); opt_fraction_of_candidates_to_interview(ni) = mi/ns(ni); end figure; plot( ns, opt_fraction_of_candidates_to_interview, '-o' ); xlabel('number of total candidates (n)'); ylabel('optimal fraction of candidates to interview'); saveas(gcf,'../WriteUp/Graphics/opt_fraction_to_interview.eps', 'epsc');