Answer the question
In order to leave comments, you need to log in
How to solve such a problem in Boolean algebra?
I ran into an online test, there are some points in the task that are incomprehensible to me.
Which statements are true for the sequence of numbers generated by the algorithm? (only one answer)for i = 0..2^k-1 output(i^(i>>1)) Где ^ - побитовый XOR >> - сдвиг на один бит вправо
1. The next number is always greater than the previous one
2. The i-th bit of the next number stores the modulo two sum of all bits of the previous number whose position numbers are less than or equal to i.
b_i = ( \sum_{j=0} ^ {i} a_i ) % 2
3. The bit representation of the next number differs from the previous one in only one bit.
4. Without the first element, the sequence is the following:
seq(2^k)
seq(2^k) = seq(2^{k-1}) 2^k seq seq(2^{k-1})
seq(1 ) = 1
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question