(namely, the record in the encoder head) problems mentioned in the last section. However, the first problem reappears in a new incarnation: The [*total*]{} length of say $N$ signals is unknown and the encoder is not sure about the number of qubits that he should use. A solution to this problem is to use essentially the law of large numbers. If $N$ is large, then asymptotically the length variable of the $N$ signals has a probability [*amplitude*]{} concentrated in the subspace of values between $N ( \bar{L}- \delta)$ and $N ( \bar{L} + \delta)$ for any $\delta > 0$ [@schumacher; @jozsa; @fuchs]. Here $\bar{L}$ is the weighted average length of a Huffman codeword. One can, therefore, truncate the signal tape into one with a [*fixed*]{} length say $N (\bar{L} +
\delta)$. \[‘0’s can be padded to the end of the tape to make up the number if necessary.\] Of course, the whole tape is not of variable length anymore. Nonetheless, we will now demonstrate that this tape can be a useful component of a new coding scheme—which we shall call quantum Huffman coding—that shares some of the advantages of Huffman coding over block coding. In particular, assuming that quantum gates 