  We consider a channel-independent decoder which is for i.i.d. random codes
what the maximum mutual-information decoder is for constant composition codes.
We show that this decoder results in exactly the same i.i.d. random coding
error exponent and almost the same correct-decoding exponent for a given
codebook distribution as the maximum-likelihood decoder. We propose an
algorithm for computation of the optimal correct-decoding exponent which
operates on the corresponding expression for the channel-independent decoder.
The proposed algorithm comes in two versions: computation at a fixed rate and
for a fixed slope. The fixed-slope version of the algorithm presents an
alternative to the Arimoto algorithm for computation of the random coding
exponent function in the correct-decoding regime. The fixed-rate version of the
computation algorithm translates into a stochastic iterative algorithm for
adaptation of the i.i.d. codebook distribution to a discrete memoryless channel
in the limit of large block length. The adaptation scheme uses i.i.d. random
codes with the channel-independent decoder and relies on one bit of feedback
per transmitted block. The communication itself is assumed reliable at a
constant rate $R$. In the end of the iterations the resulting codebook
distribution guarantees reliable communication for all rates below $R + \Delta$
for some predetermined parameter of decoding confidence $\Delta > 0$, provided
that $R + \Delta$ is less than the channel capacity.
