This article presents a thorough, step-by-step mathematical derivation of Ant Colony Optimization (ACO) tailored specifically for solving Subset Selection Problems. ACO, inspired by the foraging behavior of ants, has proven its efficacy as a metaheuristic for combinatorial optimization, and this derivation focuses on its application to subset selection scenarios. Beginning with an exploration of the foundational principles of ACO, the derivation delves into the adaptation of these principles to address subset selection challenges, emphasizing the formulation of the objective function, pheromone updating mechanisms, and solution construction procedures. The mathematical rigor is complemented by intuitive explanations, bridging the theoretical and practical aspects of ACO. Additionally, the article highlights the algorithm's versatility in handling diverse subset selection objectives, showcasing its adaptability to various problem domains. In essence, this comprehensive derivation provides readers with a profound understanding of ACO's inner workings, enabling them to apply and customize the algorithm effectively for subset selection problems in different contexts.