In core reading Page 39 chap 3 , we have no of degree of freedom formula as (r-2q+s). Where r denotes no of triplets,q denotes no of pairs and s denotes no of states. Now in this question r = 12 as observed,s= 3 but q= 6 and not 3.So df will be calculated as (12-6*2+3)=3 the critical value of chi square 3 at 5% is 7.815. PS : I don't think it should be 8 as given in the solution.