rand('state',0); randn('state',0); numgames=100000; % Team 1 is the receiving team maxfg(1)=43; pmaxfggood(1)=0.5; midprobpoint(1)=35; gimmeyardage(1)=20; aim(1)=93; maxpunt(1)=33; sigma(1)=7; lambda(1)=7; % Team 2 is the kicking team maxfg(2)=55; pmaxfggood(2)=0.5; midprobpoint(2)=43; gimmeyardage(2)=20; aim(2)=93; maxpunt(2)=53; sigma(2)=9; lambda(2)=7; ybeginot=20; winner=zeros(numgames,1); for i=1:numgames score=0; team=1; y=ybeginot; while score==0 yend=driveend(y); if yend==2000 score=1; elseif 100-yend+18 <= maxfg(team) length=100-yend+18; outcome=fg(length,maxfg(team),pmaxfggood(team),midprobpoint(team),gimmeyardage(team)); if outcome==1 score=1; else if team==1 team=2; else team=1; end y=max(20,100-yend+8); end else y=punt(yend,aim(team),maxpunt(team),sigma(team),lambda(team)); if team==1 team=2; else team=1; end end end winner(i)=team; end % This is the probability that the receiving team wins the game (2*numgames-sum(winner))/numgames