From the previous working, the unchanged number is 12.

• Original sum a + b = 9 × 2 = 18
• a = 12, so b = 18 − 12 = 6
• The number that was replaced by 8 is 6.

• Check: Replace 6 with 8: (12 + 8) ÷ 2 = 20 ÷ 2 = 10. ✓

Final Answer: 6