Entropy formula for random transformations