Posts from Quiz
Auto-translated
I haven't checked all cases, but at a glance, there's a double check everywhere, and it's possible to determine which bit is corrupted and its actual value.
However, this example turned out to be quite complex. Perhaps someone will find a simpler solution.
Added 2 minutes later
So, we can keep guessing.
Added 1 hour 2 minutes ago
Function F is a hash, which is also parity (0 - identical characters, 1 - different characters). The message itself is ABCD, and the numbers are the bit numbers. Bit 1: F(A, B) Bit 2: F(C, D) Bit 3: F(1, 2) The presence or absence of an error can be seen among the first three bits. Bit 4: F(A, D) Bit 5: F(B, C) Bit 6: A Bit 7: C If there is an error in the first three bits, we can still read the message. Let's assume there is no error there. We can check for an error in bits 4 and 5: We definitely know from bits 1 and 2 whether A and B are the same or different, and C and D are the same or different. That is, 00, 01, 10, or 11. If bits 1 and 2 have values of 00 or 11, then bits 4 and 5 should also be either 00 or 11 (both combinations of identical values are allowed). For 01 and 10, the unknown values, if there is no error, should also be 01 and 00. If there is an error among bits 4 and 5, we still construct the message using bits 1, 2, 6, and 7. Let's assume there is no error. The error is in A, in C, or there is no error at all. If there is no error at all, then by substituting A and C into functions 1, 2, and 3, 4, we get the original message in both cases, and it will be the same. If it is different, then by inverting either A or C, we can absolutely accurately determine F(A, C). I don't know why, but it seems that by solving a system of equations with this function and the functions from bits 1-2, 4-5, we can find out whether the error is in A or C. But it seems not, but I'm too lazy to think about it anymore. But I have improved the previous result. I can read the message in 5 cases of a corrupted bit and in the case of no error, and only in the case of corruption of two specific bits do I have 2 message options, and I know about it. We can also try, but take the control bit (bit 3) as F(2, 6).
Okay, let's go back to message transmission and the "checksum".
Only in the checksum, we XOR not pairwise, like Uranus, but the first bit with each of the following ones.
Message: i1 i2 i3 i4
We transmit:
bit1: i1
bit2: i2
bit3: i3
bit4: i4
bit5: xor(bit1, bit2)
bit6: xor(bit1, bit3)
bit7: xor(bit1, bit4)
I'll check for all variants a little later.
Added after 2 hours 58 minutes
Hmm, there are still ambiguities.
This option is also not working.
Знание некоторых закономерностей освобождает от изучения многих фактов.
Мечты сбываются рано или поздно, так или иначе.
Well, I did have HOGs in one case, but I called them parity for two bits.
But the idea itself is interesting, to transmit a function instead of the message itself.
Added 1 hour 2 minutes ago
Function F is a HOG, it's also parity (0 - identical characters, 1 - different characters). The message itself is ABCD, the numbers are the bit numbers.
Bit 1: F(A, B)
Bit 2: F(C, D)
Bit 3: F(1, 2)
It shows the presence/absence of an error among the first three bits
Bit 4: F(A, D)
Bit 5: F(B, C)
Bit 6: A
Bit 7: C
If there is an error in the first three bits, we can successfully read the message. Let's assume there is no error there.
We can check for an error in bits 4 and 5:
We definitely know from bits 1 and 2 whether A and B are the same or different, and C and D are the same or different.
That is, 00, 01, 10 or 11.
If bits 1 and 2 have values 00 or 11, then bits 4 and 5 should also be either 00 or 11 (both combinations of identical values are acceptable).
For 01 and 10, the unknown values should also be 01 and 00 in the absence of an error.
If there is an error among bits 4 and 5, we still construct the message using bits 1, 2, 6, 7. Let's assume there is no error. The error is in A, in C, or there is no error at all.
If there is no error at all, then by substituting A and C into functions 1, 2 and 3, 4, we get the original message in both cases, and it will be the same. If it's different, then by inverting either A or C, we can determine F(A, C) with absolute certainty. I don't know why, but it seems that by solving a system of equations with this function and the functions from bits 1-2, 4-5, we can find out whether the error is in A or C. But it seems not, but I'm too lazy to think about it anymore. But I have improved the previous result. I can read the message in 5 cases of a corrupted bit and in the case of no error, and only in the case of corruption of two specific bits do I have 2 message options, and I know about it.
We can also try, but take the control (3rd bit) as F(2, 6).
This is the best so far, although I haven't read what Sesame wrote yet. Here, you can definitely detect that there was an error! But still, for example...
According to your algorithm, the combination 0000 is encoded as the message 0000000,
and the combination 1111 is encoded as the message 0000011.
But let's say we received the combination 0000010 :(
Yes, it's clear that one bit, or even more, has been corrupted - it's the sixth or seventh bit. But how do we know whether we transmitted 0000 and corrupted the sixth bit from 0 to 1, or 1111 and corrupted the seventh bit from 1 to 0???
Added 11 minutes ago
yes, indeed. In my solution, in case of bit5 failure, there is an ambiguity. So it's not suitable.
okay, let's go back to transmitting the message and a "checksum".
Only in the checksum, we XOR not pairwise, as Uranium does, but the first bit with each of the following.
Message: i1 i2 i3 i4
We transmit
bit1: i1
bit2: i2
bit3: i3
bit4: i4
bit5: xor(bit1,bit2)
bit6: xor(bit1,bit3)
bit7: xor(bit1,bit4)
I'll check for all options later.
Added 2 hours 58 minutes ago
meh, there are still ambiguities.
This option is also not working.
bit1=xor(i1,i2)
bit2=xor(i1,i3)
bit3=xor(i1,i4)
bit4=xor(i2,i3)
bit5=xor(i2,i4)
bit6=i2
bit7=i1
Oops, I made a mistake; I had a reversed XOR in the checks. But it doesn't matter, the check also works with the correct XOR. They operate symmetrically.
Hmm, but this algorithm seems to work:
bit1=xor(i1,i2)
bit2=xor(i1,i3)
bit3=xor(i1,i4)
bit4=xor(i2,i3)
bit5=xor(i2,i4)
bit6=i2
bit7=i1
Oops, I made a mistake; I had a reverse XOR in the checks. I was wrong. That is, 1 when the operands are the same. But never mind, it also passes the check with a normal XOR. They work symmetrically.
According to your algorithm, the combination 0000 is encoded as the message 0000000,
and the combination 1111 is encoded as the message 0000011.
But let's say we received the combination 0000010 :(
Yes, it's clear that one bit, or even more, has been corrupted – the sixth or seventh bit. But how do we know whether we transmitted 0000 and corrupted the sixth bit from 0 to 1, or 1111 and corrupted the seventh bit from 1 to 0???
So far, Uranus has proposed the best option.
Perhaps the answer involves some kind of trick, like: if the first character is 0, then only transmit six bits (and who said there must be seven?).
In any case, I suggest thinking about this direction as well.
Знание некоторых закономерностей освобождает от изучения многих фактов.
Мечты сбываются рано или поздно, так или иначе.
Perhaps the issue lies in some kind of trick related to: if the first character is 0, then only six bits are transmitted (but who said there must be 7?).
In general, I suggest considering this direction as well.
No, all 7 bits are transmitted!
Added after 33 seconds
They must be 7!
Or do we really need to pass these unfortunate i1, i2, i3, i4 to avoid loss, and then do XOR(i1, i2), XOR(i1, i3), XOR(i1, i4)?
That results in three XOR operations. Although, I still see that it doesn't work; we can come up with an example. Sigh.
Знание некоторых закономерностей освобождает от изучения многих фактов.
Мечты сбываются рано или поздно, так или иначе.