Explanation:
it eats 1/20 of a bag each week
so, the ratio is 1/20 / 1
now we have 5/8 of a bag to be eaten in x weeks. and that has to have the same ratio.
so,
5/8 / x = 1/20 / 1 = 1/20
5/8 = x/20
20×5/8 = x
100/8 = x
25/2 = x
x = 12.5 weeks
the dog will finish this in 12.5 weeks.