Mathematical Programming For Adaptive Experiments