Problem 323
Bitwise-OR operations on random integers
Let y0, y1, y2,… be a sequence of random unsigned 32 bit integers
(i.e. 0 ≤ yi < 232, every value equally likely).
For the sequence xi the following recursion is given:
- x0 = 0 and
- xi = xi-1 | yi-1, for i > 0. ( | is the bitwise-OR operator)
It can be seen that eventually there will be an index N such that xi = 232 -1 (a bit-pattern of all ones) for all i ≥ N.
Find the expected value of N.
Give your answer rounded to 10 digits after the decimal point.
随机整数按位或运算
记y0、y1、y2、……是一系列32比特无符号随机整数。
(也就是说,0 ≤ yi < 232,其中每个数等概率出现)。
序列xi按如下方式递归定义:
- x0 = 0,以及
- 对于所有 i > 0,xi = xi-1 | yi-1。(|指按位或运算符)
可以看出,存在下标N,使得对于所有i ≥ N,xi = 232 -1(所有比特位均取1)。
求N的期望值。
将你的答案保留小数点后十位小数。