  We propose a prequential or sequentially predictive formulation of the work
extraction where an external agent repeats the extraction of work from a heat
engine by cyclic operations based on his predictive strategy. We show that if
we impose the second law of thermodynamics in this situation, the empirical
distribution of the initial microscopic states of the engine must converge to
the Gibbs distribution of the initial Hamiltonian under some strategy, even
though no probability distribution are assumed. We also propose a protocol
where the agent can change only a small number of control parameters linearly
coupled to the conjugate variables. We find that in the restricted situation
the prequential form of the second law of thermodynamics implies the strong law
of large numbers of the conjugate variables with respect to the control
parameters. Finally, we provide a game-theoretic interpretation of our
formulation and find that the prequential work extraction can be interpreted as
a testing procedure for random number generator of the Gibbs distribution.
