Finding the possible positions of chess knight mathematically relative to a given position From this website I found the following question: 

A chess board’s 8 rows are labelled 1 to 8, and its 8 columns a to h. Each square of the board is described by the ordered pair (column letter, row number).
(a) A knight is positioned at (d, 3). Write down its possible positions after a single move of the knight.
(b) If R = {1, 2, ..., 8}, C = {a, b, ..., h}, and P = {coordinates of all squares on the chess board}, use set notation to express P in terms of R and C
(c) A rook is positioned at (g, 2). If T = {2} and G = {g}, express its possible positions after one move of the rook in terms of R, C, T and G.

For (a) is there anyway mathematically to list all the possible positions of the knight? I could for example, use a chess board to determine all the possible positions of the knight. 
About (C) I completely don't get it. 
The answers are provided in the website, however, I'm interested in how to solve them. 

a)  The eight or fewer positions of a knight at $(x,y)$ after a move are $\{(x \pm 1, y \pm 2\} \cup \{x \pm 2, \pm 1\}$ or if you really want to be fancy $\{x \pm a, y \pm (3 - a)|a \in \{1,2\}$ and the terms are within 1 to 8 $\}$.
But as there are only eight positions it's easier and clearer to just list them:  (d,3)=>  (c,1)(c,5)(e,1)(e,5)(b,2)(b,4)(f,2)(f,4) 
b) $P = R \times C = \{(a,b)|a \in R; b \in C\}$.
c)  Possible positions are $\{(x,2)\}\cup \{(g,y)\}= R\times\{2\} \cup \{g\} \times C = R \times T \cup G \times C$  
