  We analyze a periodic optimal finite-time two-state information-driven
machine that extracts work from a single heat bath exploring imperfect
measurements. Two models are considered, a memory-less one that ignores past
measurements and an optimized model for which the feedback scheme consists of a
protocol depending on the whole history of measurements. Depending on the
precision of the measurement and on the period length the optimized model
displays a phase transition to a phase where measurements are judged as
non-reliable. We obtain the critical line exactly and show that the optimized
model leads to more work extraction in comparison to the memory-less model,
with the gain parameter being larger in the region where the frequency of
non-reliable measurements is higher. We also demonstrate that the model has two
second law inequalities, with the extracted work being bounded by the change of
the entropy of the system and by the mutual information.
