In the theory of data compression, a universal data compression algorithm is one that approaches the optimal compression ratio as the input length tends to infinity. Optimal compression ratios (i.e. bits per character) are only well-defined for stationary processes, and their properties can only be inferred from the input stream for ergodic data sources; a universal data compression algorithm compresses data from any stationary ergodic source well for sufficiently large inputs, without being given any knowledge about its properties a priori. The most commonly-used examples of such algorithms are LZ77 and LZ78 and arithmetic coding.<ref name=vanTilborg2000 />