First, remember that each package of buns contains 8 buns and each package of hot dogs contains 10 hot dogs we need to feed 500 people but the number of buns and hot dogs must be equal so:
We have to make 2 equations, the first one expressing how much full I will need to feed 500 people and the second one is the condition that the number of buns must be the same as the number of hot dogs, so:
Now that we have the two equations we have to solve them and fins the number of packages:
25 packages of buns and 31.25 packages of hot dogs are the minima you can buy to feed 500 people. But if you don't want to have any leftovers and the packages cant be bought partially you will need:
To multiply each number by 4 with the purpose to make x (the number of packages of buns) integer and 25 must be multiplied by the same number because both amounts must be equal so:
You need 100 packages of hot dogs and 125 packages of buns.