PYTHON · NUMPY
Bits, trits, and the best radix

Numpy only, deterministic, under two seconds. Two computations: (1) how many bits a symbol carries in each radix, and (2) the radix-economy cost of representing every integer up to N. Fill the single gap, then run — PASS confirms log2(3)~1.585 AND that base 3 beats base 2 on average.

You read

the arrays and values already in scope

You change

the code you write in each cell

Fixed

the dataset and the checks that grade you