We had seen that if there are r rows and c columns, then the degrres of freedom would be (r-1)*(c-1). As per this, in Question 4.21 (b), the degrees of frredom would be 2. In the solution, it is given as 4 i.e., number of cells - number of estimated parameters - 1. Are these two different methods of testing the hypothesis? Please let me know if my understanding is wrong.
Yes! They are different. In part (i) there we test independence between flower color and leaf type.. Hence used contingency table.... In part (ii) there we test goodness-of-fit for given model, so that degrees of freedom.