I'm having a problem with the entire Chi-square thing..

I do have answers to these but I'm not sure how to work them out..

If you could help that would be great! :)

1st part:
A,B,C are schools. Is the choice of math programs followed independently by school? Write the hypotheses.

2nd part:
There is a table with X,Y,Z for rows and S,M,H for rows
XS:28,XM:44,XH:14
YS:20,YM:24,YH:17
ZS:51,ZM:66,ZH:20
show that this table has 4 degrees of freedom and show that expected frequency for YM is 28.78 correct to 2 decimal places.

3rd part:
find the complete Chi-Square statistic..
(I want to know how to get the expected for each cell of the table)

X^2 = Σ[(O-E)^2/E]

E = (row total)(column total)/(grand total)