Adaptation, Learning, and Optimization