The Aptitude–Achievement Function: An Aid for Allocating Educational Resources, with an Advanced Placement Example