I also remembered that you can XOR more than two bits
And now I'll explain why the best algorithm was devised by Uranus.
Added 1 hour 4 minutes ago
I solved this puzzle quite a while ago, and after I posted it here, I kept thinking about how I solved it. :) Actually, when I solved it the first time, I calculated the bit values as follows: b5=b1+b2 b6=b1+b3 b7=b2+b3 and then, if the fourth bit was 1, I inverted all three additional bits, but that's the same thing. Yesterday, or rather, today, I went to bed, but instead of falling asleep, I started thinking about why my algorithm could determine which bit had an error, while others couldn't. And then I suddenly remembered two things!! And I immediately understood why! In the morning, I checked, and it turned out that I didn't even remember them correctly at night, but it was indeed like that! In my algorithm, it was possible to determine which bit had an error because each combination it produced differed from any other combination it produced by at least three bits, while in other algorithms, this was not the case!!! Here are the combinations and the number of bits by which each of them differs from any other for my algorithm! 0000 0000000 -334344343343447 1000 1000110 3-43433434434374 0100 0100101 34-3433434434734 1100 1100011 433-344343347443 0010 0010011 3443-33434474334 1010 1010101 43343-4343743443 0110 0110110 433434-347343443 1110 1110000 3443433-74434334 0001 0001111 43343447-3343443 1001 1001001 344343743-434334 0101 0101010 3443473434-34334 1101 1101100 4433423533-43546 0011 0011100 354233444635-433 1011 1011010 4374344343343-43 0111 0111001 47343443433434-3 1111 1111111 744343343443433- As you can see, any of my combinations differs from any other by at least three bits. And because of this, it turned out that if two combinations differ from each other by two bits, then it will be possible to understand that there was an error, but it will not be possible to understand where exactly. If by one, then it will not even be possible to understand that there was an error at all. Well, if there is a zero somewhere, then it may not be clear what was transmitted without any interference. :D After that, it became very easy for me to determine whether the proposed algorithm would work or not, and to find pairs of combinations where there would be uncertainty. (In general, when I first posted the puzzle, I grabbed my head: how will I determine whether the algorithm is suitable or not, and the first algorithm from Sesame already confirmed my fears :D) Now there are no problems with this. :) Here are the number of characters by which different algorithms differ. Uranus's algorithm 0000 0000000 -433463533443542 1000 1011010 4-33645333445324 0100 1010100 33-4354644334235 1100 0001110 334-536444332453 0010 0110101 4635-43335423344 1010 1101111 64534-3353243344 0110 1100001 354633-442354433 1110 0111011 5364334-24534433 0001 0001100 33443542-4334635 1001 1001001 334453244-336453 0101 1011010 4433423533-43546 1101 0110110 44332453334-5364 0011 0001101 354233444635-433 1011 1010111 5324334464534-33 0111 1011001 42354433354633-4 1111 0000011 245344335364334- Sesame's algorithm 0000 0000000 -424244424444464 1000 1000111 4-42424442444446 0100 0100100 24-4442444246444 1100 1100011 424-444244424644 0010 0010010 2444-42444642444 1010 1010101 42444-4244464244 0110 0110110 442424-464444424 1110 1110001 4442424-46444442 0001 0001001 24444464-4242444 1001 1100101 424444244-644244 0101 1011010 4424424446-44424 1101 0101011 44422444644-4442 0011 0011011 444224442444-446 1011 1001101 4424424442444-64 0111 1110010 42444424442446-4 1111 0000011 244444424442644- Menta's algorithm 0000 0000000 -446244424444442 1000 1110001 4-64424442444424 0100 1001110 46-4442444244244 1100 0111111 644-444244422444 0010 0101000 2444-44644422444 1010 1011001 42444-6444244244 0110 1100110 442446-442444424 1110 0010111 4442644-24444442 0001 0001000 24444442-4462444 1001 1100101 424444244-644244 0101 1011010 4424424446-44424 1101 0101011 44422444644-4442 0011 0011011 444224442444-446 1011 1001101 4424424442444-64 0111 1110010 42444424442446-4 1111 0000011 244444424442644- With any of the algorithms, you can determine that there was an error because there are no ones anywhere, but in Uranus's algorithm, there are fewer twos, that is, fewer uncertainties, when it is not clear which of the combinations was transmitted, so I said that he came up with the best algorithm. Let Sesame or Uranus come up with.