by Румен Симеонов » Wed Apr 19, 2023 7:25 am
The prolem might not be clearly enought stated and needing some justification. ,,Bit pair" ,,in an integer" could mean, according to my understanding, a number [tex]x[/tex] written or ,,appropriately kept" ,,in an integer variable" [tex]n[/tex] having in 2-adic system 2 digits, possibly with leading zeros. If this agreed then [tex]x\in \{ 0,1,2,3 \}[/tex] and a possible solution could be the ,,arithmetic": [tex]n:=n(n-1)(n-2)(n-3)[/tex]. or even simpler ,,arithmetic": [tex]n:=0+0[/tex]. If the 2 bits are not the first 2 right to left, then i don't see purely arithmetic function performed on the variable [tex]n[/tex] which solves the problem, always keeping the other bits of [tex]n[/tex] unchanged. Moreover, in such a case, the input would not be simply [tex]n[/tex] but needs to be more complex indicating the position of the two bits, after justifying the problem. It also needs justification if shifting bits is considered as arithmetic operation, depending on the computer language you have in mind, but didn't disclose to us.