Encoding sets as real numbers