 For example, for a categorical random variable "X" that can take on the nominal values "red", "blue" or "green", the real-valued function formula_119 can be constructed; this uses the Iverson bracket, and has the value 1 if formula_6 has the value "green", 0 otherwise.Then, the expected value and other moments of this function can be determined.A new random variable "Y" can be defined by applying a real Borel measurable function formula_121 to the outcomes of a real-valued random variable formula_6.