Statistical physics of design