Randomness as a Resource