Just expand on, say, the first row:

For the rest, I recommend looking at the 2 by 2 and 3 by 3 versions and trying to see a pattern.

2. Matrix in which the diagonal is "a" and all the rest is "b"

a , b, ... , b

b , a,

.

.

.

b , ... , a

3. Matrix in which the diagonal is "0". Above the diagonal is "-1" and "1" is below the diagonal. (Need to separate to 2 cases when n is odd and when n is even)

0,-1,...,-1

1,0

.

.

.

1,... 0

4.

1,2,...,n

2,3,...,n+1

.

.

.

n,n+1,...,2n-1