For the first problem, we know that 25 out of 80 tokens are black. To find the percentage all we have to do is divide 25 by 80, which equal 0.31. To convert this to percentage form, you move the decimal two places to the right, giving you 31%.
And for the second problem you do the same thing. Divide 5 by 16, giving you 0.31. Convert that into percentage, also giving you the percent of 31%.