The situation can be represented by the above diagram
7 students play basketball, that is,
x + y = 7 (eq. 1)
13 students play baseball, that is,
y + z = 13 (eq. 2)
10 students who play neither sport.
x + y +z = 26 - 10
x + y +z = 16
Substituting with equation 2,
x + 13 = 16
x = 16 - 13
x = 3
Substituting with equation 1,
3 + y = 7
y = 7 - 3
y = 4
Then there are 4 students that play both sports. Therefore, the probability that a student chosen randomly from the class plays both basketball and baseball is: 4/26 = 2/13