Thermodynamics of Gambling Demons.

We introduce and realize demons that follow a customary gambling strategy to stop a nonequilibrium process at stochastic times. We derive second-law-like inequalities for the average work done in the presence of gambling, and universal stopping-time fluctuation relations for classical and quantum nonstationary stochastic processes. We test experimentally our results in a single-electron box, where an electrostatic potential drives the dynamics of individual electrons tunneling into a metallic island. We also discuss the role of coherence in gambling demons measuring quantum jump trajectories.