Gaussian elimination and Xor equations

Source: Internet
Author: User

 for(i=1; i<=n;i++){   for(j=i+1; j<=n;j++)    if(a[j]>A[i]) swap (a[i],a[j]); if(!a[i]) Break;  for(j= -; j>=0; j--)    if(a[i]>>j&1)    {       for(k=1; k<=n;k++)        if(I!=k && (a[k]>>j&1)) a[k]^=A[i];  Break; }}

In this code think (Dan) test (Teng) for a week ...

UPD: like these two codes do the same thing? After that, the top of each number is only one 1. t_t who can tell me what the difference is between these two codes? What's the use? And why would you do that?

 for (int i=1; i<=n;i++)  for (int j=; j>=1; j--)    {if(a[i]>> (J1) & 1     {        if(!lb[j]) {lb[j]=a[i];  break;}         else a[i]^=lb[j];}    }

Let's prove why any one of the array of a after the elimination of the meta-selection corresponds to an alternative method of the original array? (SX problem, God Ben Please ignore t_t)

If we have a set s=[x,s-{x}], then a scheme selected for the set S can correspond to S ' =[x,{y^x|y∈{s-{x}}]

Make S-{x}=a,{y^x|y∈{s-{x}}}=b

Because if this program

1) Select X

i) In addition to the odd number of elements in a, then the scheme in S ' is not selected x, the corresponding element is selected in B

II) also select an even number of elements in a, then S ' Scheme corresponds to select X, select the corresponding element in B

2) do not select X

i) Select an odd number of elements in a, then the scheme in S ' is selected as x and the corresponding element in B

II) In addition to an even number of elements in a, then the scheme in S ' is not selected x, the corresponding element in B is selected

So this is one by one correspondence. So we can arbitrarily use a certain equation to take the different or other equations, selected and not selected or independent and legal.

Hey How do I think of the elementary transformation of matrices? )

Ask the great God to give a simple proof t_t

Gaussian elimination and Xor equations

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.