The probability of getting a math book for the first time is 4/ 10=2/5, and the probability of getting a non-math book for the second time is 6/9=2/3. The probability of getting a physics book and a chemistry book for the first time is 3/ 10, and the probability of getting a subject book without it for the first time is 7/9, so the probability of getting different subjects twice is:
2/5*2/3+2*(3/ 10*7/9)=4/ 15+7/ 15= 1 1/ 15
For reference only!