The entropy of a code with probabilities is defined and as a consequence the concept of conservation of entropy in lossless coding emerges in a natural manner. For any given probability distribution ( p l , p 2 , . . . , p~) all the dzstinct decompositions of the associated entropy function h(pl , p 2 , . . . , p~) , as a function of entropies of iower order, are obtained from the terminal uncertaint y of the distinct rooted trees with leaf probabilities (Pl 1P2r ' ' . I P T ) 0-7803-5030-8/98/$10.00 01998 IEEE