Binary-search patterns for answer spaces, order statistics, and optimization.