Reinforcement Learning: Foundations, Algorithms, and Real-World Applications