The above is an estimation question. Estimation is when you judge the results obtained from a sample and make a rough calculation. The answer obtained might not be exactly right, its based on a judgement.
In this a sample was taken and out of 80 books, 6 of them were history books. The assumption made then is that for every 80 books taken randomly , 6 of them will be history. Using this assumption ; 21 360 books in the library, for every 80 books - 6 history books then for 21 360 books - 6 / 80 * 21360 = 1602 history books
The answer is that 103 math books were sold and 309 biology books were sold because if you multiply 103 by 3 you will get 309 but then you will still need to add the 103 that we found in the first place which would all add up to 412