Null := `Sex is independent of Voting`: Alternative := `Sex and Voting are dependent`: c11 := (2792-2731)^2/2731.: c12 := (3591-3652)^2/3652.: c21 := (1486-1547)^2/1547.: c22 := (2131-2070)^2/2070.: X2 := c11+c12+c21+c22; Obs_table := matrix(3,3,[679,103,114,63,10,20,42,18,25]); R1 := 679+103+114:R2:=63+10+20:R3:=42+18+25: C1:=679+63+42:C2:=103+10+18:C3:=114+20+25:N:=evalf(R1+R2+R3): Exp_table := matrix(3,3,(i,j)-> round(R.i*C.j/N)); X2 := 30.96: