Блог пользователя AAhaoxuan

Автор AAhaoxuan, история, 6 часов назад, По-английски

Given a sequence $$$( A )$$$ , where each element $$$( A_i )$$$ is a randomly chosen integer from $$$( 0 )$$$ to $$$( 2^k - 1 )$$$ , what is the probability that there exists a subsequence of $$$( A )$$$ whose XOR sum is equal to $$$0$$$ ?

  • Проголосовать: нравится
  • +3
  • Проголосовать: не нравится

»
6 часов назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

$$$\dfrac{1}{2^k}$$$

  • »
    »
    5 часов назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Can you please explain how?

    • »
      »
      »
      4 часа назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      Here's what I think: we notice that the each binary bit are independent, so we only need to calculate the probability of each bit.

      To make a bit's xor sum to $$$0$$$, you have to choose an even number of positions to be $$$0$$$ and the rest to be $$$1$$$, and the probability of such a number is $$$\dfrac{1}{2}$$$. Multiply the probabilities of all the bits together to give the answer: $$$\dfrac{1}{2^k}$$$

  • »
    »
    5 часов назад, # ^ |
    Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

    If $$$n=1$$$ ,It's right.

»
5 часов назад, # |
Rev. 3   Проголосовать: нравится +7 Проголосовать: не нравится

Let $$$n$$$ be the length of $$$A$$$. Numbers from $$$0$$$ to $$$2^k-1$$$ with $$$xor$$$ is a $$$k$$$-dimensional vector space over $$$\mathbb{F}_2$$$, therefore if $$$n > k$$$ it is guaranteed that $$$A$$$ has $$$0$$$-sum subsequence, because $$$A$$$ is linearly dependent collection of vectors.

If $$$n\leq k$$$ we can calculate the probability by counting number of linearly independent collections of length $$$n$$$: there are $$$2^k - 1$$$ ways to choose the fisrt vector, $$$2^k-2$$$ ways for the second... $$$2^k-2^t$$$ for the $$$t+1$$$'th vector, so overall number is $$$\prod_{i=1}^{n}(2^k-2^{i-1})$$$.

Then the needed probability is $$$1- \frac{\prod_{i=1}^{n}(2^k-2^{i-1})}{2^{nk}}$$$.

Correct me if I am wrong.

  • »
    »
    5 часов назад, # ^ |
      Проголосовать: нравится +3 Проголосовать: не нравится

    Thank you! It help me prove the probability of the Problem 799F randomization algorithm being correct.

  • »
    »
    5 часов назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    But the if $$$n\le k$$$,$$$2^k-2^{i-1}$$$ may be less than $$$0$$$.

    • »
      »
      »
      5 часов назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      Minimum of $$$2^k - 2^{i-1}$$$ reached when $$$i=n$$$ and $$$n = k$$$, so it's $$$2^k-2^{k-1} = 2^{k-1} > 0$$$.