It is very fascinating that the principles of Artificial Intelligence, that were proposed many decades ago, have remained to be the foundations of many of the modern-day techniques, and a brief summary of these principles is given in the paper itself. While this truism is valid for problem solving and game playing, in the context of this paper, we emphasize that it is also pertinent for the so-called partitioning problems. In this paper, we consider the general partitioning problem that has been studied for decades. Unlike the heuristic and search strategies, our attention focuses on learning automata (LA) and reinforcement learning methods, and their powerful ability to solve problems in stochastic environments. These render the latter tools to be applicable to various complex tasks. As we shall explain, LA have been employed for partitioning, and in particular, the paradigm of Object Migration Automata (OMA) has offered state-of-the-art adaptive methods for solving grouping and partitioning problems. However, because the number of possible partitions is combinatorially exponential, and of the NP-hardness of the underlying tasks, the existing state-of-the-art OMA algorithms can only solve problems of equal-sized groups. To resolve this, in this paper, we propose two new OMA variants that can solve both equally and unequally sized partitioning problems. The key here is to provide additional information to the algorithms, and in doing so, to expand the solution space. The first variant, the Greatest Common Divisor OMA (GCD-OMA), relaxes the constraint of having equally sized groups by mapping the actions onto a larger state space, and thus permitting it to solve problems where the group sizes have a GCD that is greater than unity. Subsequently, we propose a second variant named the Partition Size Required OMA (PSR-OMA) to make the algorithm more versatile. The PSR-OMA can handle groups of arbitrary sizes when the group sizes are known a priori. We demonstrate the proposed algorithms' strength in solving stochastic grouping problems through extensive simulations, even with high noise levels. The GCD-OMA and the PSR-OMA represent the current state-of-the-art when it concerns resolving the extremely complex problem of partitioning and can be used in any of the numerous applications in which the OMA itself has been utilized .