firstly, you and your accomplice do not know what number is going to be given. so he/she can open a box, let say it is box #1 and the number is 10 in the box. then he can open another box which is the same number in the previous box, for this case, box #10. and check the number in the box and switch it with 1 whatever (s)he gets, let say he got 50. so u guarantee that at least one of the number and box number will surely be the match and it is not the one in the box #1.
firstly the chance of getting 1 from #1 is 1/100 for your accomplice, and he will not switch then, not getting 1 and gettin one from the box #10 is 99/100*1/99 = again 1/100. and not getting 1 from both then is 98/100 as a result.
so ur chance of getting one from number one is 2/100, and u know that at least one of the box has the same number as box and open the given number then. the chance of given number is different than your switched box is 99/100. and the chance of getting the same box as u switch is 1/99. so another 1/100 from here added.
as a result, take number 1, then take the number given, then take box as the same number in box#1 (u know that box has different number for sure), take always the box with the number in the previous box always not to encounter the box and the number different.
so 1-98/100*98/99*97/98.... (50 times) = the new outcome ( edited: it will be much more complicated since i changed the algorithm as taking box according to previous nnumber in the previous box)
typing on the phone, so cant calculate :(