Question

I have a question about algorithm design.

Suppose I have S, R, and B these three bitstreams as below in an encoder, and the output is D.
My question is how to derive the S or B in decoder with the only given D and R.

My initial idea goes below with xor (^) operation, and D=1001.

Encoder:
S      |R      |X=S^R  |B      |D=X^B
0001   |1010   |1011   |0010   |1001

Moreover, in decoder, it receives only D and R as below,

Decoder:
D      |R      |
1001   |1010   |

yet basically X=S^R and X=B^D, thus S^R=B^D or said D^R = S^B. Hence, I have no idea about how to derive S and B separately.
Does any one can give an concept, or a thought, or an algorithm you known to deal with this.
Many thanks:)

Was it helpful?

Solution

You can't. D = S ^ B ^ R, given D and R, you can get S ^ B back (as you showed), but the rest of the information is just gone.

Of course it had to be gone: you have only 8 bits, you can't store 12 bits of information in there. If you could, you could recursively apply that transformation until you've compressed any arbitrary amount of information down to a single byte.

But, maybe you have some a-priory knowledge about S and B, or some useful relation between them or between one of them and R. If you have enough of that knowledge, you might be able to reconstruct S and B (for example, if B = R, then D = S so you know them all).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top