Reducing ammount of bits required to identify an object

39 Views Asked by At

There are 20 unique 16-bit sequences $a_1, a_2, ..., a_{20}$: $$a_i = (a_{i,0}, a_{i,1}, ..., a_{i,15}), a_{i,k} \in \{0,1\}$$

Is there a method to select 5 ($=\lceil \log_2 20\rceil $) numbers $p, q, r, s, t$, such that sequences $$b_i=(a_{i,p},a_{i,q}, a_{i,r}, a_{i,s}, a_{i,t})$$

are all unique, ie. $$i\neq j \Rightarrow \exists k :\, b_{i,k}\neq b_{j,k} $$ ?

For example (simplified case - $5$ 8-bit sequences, 3 required numbers):

$a_1=11010111\\ a_2=10100101\\ a_3=10001011\\ a_4=10101101\\ a_5=01000110$

the answer should be $2,3,4$:

$b_1=010\\ b_2=100\\ b_3=001\\ b_4=101\\ b_5=000$

1

There are 1 best solutions below

2
On BEST ANSWER

No, not in general. A set of $5$ such numbers is not guaranteed to exist. For example:

1111 1111 1111 1111
0111 1111 1111 1111
1011 1111 1111 1111
1101 1111 1111 1111
1110 1111 1111 1111

1111 0111 1111 1111
1111 1011 1111 1111
1111 1101 1111 1111
1111 1110 1111 1111
1111 1111 0111 1111

1111 1111 1011 1111
1111 1111 1101 1111
1111 1111 1110 1111
1111 1111 1111 0111
1111 1111 1111 1011

1111 1111 1111 1101
1111 1111 1111 1110
0011 1111 1111 1111
1100 1111 1111 1111
1111 0011 1111 1111

$p=0$ is the only way to tell entries 1 and 2 apart.

$q=1$ is the only way to tell entries 1 and 3 apart.

$r=2$ is the only way to tell entries 1 and 4 apart.

$s=3$ is the only way to tell entries 1 and 5 apart.

$t=4$ is the only way to tell entries 1 and 6 apart.

But then there's no way to tell, say, entries 1 and 7 apart.

This also won't work in general for the simplified case you mentioned:

1111 1111
0111 1111
1011 1111
1101 1111
1110 1111

You're calculating the number of bits to use as $\lceil \log_2 n\rceil$, where $n$ is the number of bit sequences you have. But the number of bits in each sequence must also be taken into account.