20.12.2019, 15:36
When you say after 7 weighings there are 4 possible situations, this is not quite correct:
12&AB - 3 - 45&CD - 6 - 78
is not the same as
12&AC - 3 - 45&BD - 6 - 78,
because in the first case you know the order of A&B as well as C&D, while in the second case you don't know the order of A&C or B&D.
Same for
12&A - 3 - 45&B - 6 - 78&CD
vs
12&A - 3 - 45&C - 6 - 78&BD.
However, in both cases your algorithm still works, no harm done.
12&AB - 3 - 45&CD - 6 - 78
is not the same as
12&AC - 3 - 45&BD - 6 - 78,
because in the first case you know the order of A&B as well as C&D, while in the second case you don't know the order of A&C or B&D.
Same for
12&A - 3 - 45&B - 6 - 78&CD
vs
12&A - 3 - 45&C - 6 - 78&BD.
However, in both cases your algorithm still works, no harm done.