GBN window size=4.
At one transmission we can send 4 frames.
1st transmission:: 1,2,3,4
2nd : ${\color{Red} 5},6,7,8$
3rd:$5,{\color{Red}6},7,8$
4th :$6,7,{\color{Red}8},9$
5th :8,9,10.
Total transmissions(X) =19.
SELECTIVE REPEAT:
1st :1,2,3,4
2nd:${\color{Red} 5},6,7,8$
3rd:$5,{\color{Red} 9},10$
4th :9.
Total transmission(Y)=12
Hence X+Y=19+12=31