Try Ithy free
Save

Published · Updated

How ten yes-or-no tests can identify one item out of a thousand

Ten binary outcomes distinguish up to 1,024 possibilities. Give each item a unique ten-bit number and run one test per bit to identify a single marked item in one round.

Assign each item a code

Label 1,000 items from 0 to 999. Write each label using ten bits, adding leading zeroes. For each bit position, put the items whose corresponding bit equals one into that test group.

Decode the result

Suppose only the groups worth 16, 4 and 1 test positive. Add those place values to identify item 21. If item 0 is valid, all-negative results mean 0 under the assumption that one marked item is present and all tests are reliable.

What the design assumes

Each test must report whether its group contains the marked item. The simple scheme assumes exactly one marked item and no errors. Multiple marked items can produce the same combined outcomes as another code, so the same decoding rule would not identify them.

Reference

Ithy binary and decimal conversion tool

Ask Ithy a follow-up