binary pattern rank