The function SelectRandomBit randomly selects a bit showing the state defined by PreCondition. If PreCondition is TRUE the random selection is performed among the TRUE bits, else one of the FALSE bits is selected.
The function returns the index of the selected bit (0 to Size) or a value of -1 if no bit of the given precondition is available.