Given:
8000 homes
color flyers : $0.08 each
black and white flyers : $0.05 each
budget of $500
c + b = 8,000
0.08c + 0.05b = 500
c = 8,000 - b
0.08(8,000 - b) + 0.05b = 500
640 - 0.08b + 0.05b = 500
-0.03b = 500 - 640
-0.03b = -140
b = -140 / -0.03
b = 4,667 black and white flyers
c = 8,000 - b
c = 8,000 - 4,667
c = 3,333 colored flyers
0.08(c) + 0.05(b) = 500
0.08(3,333) + 0.05(4,667) = 500
266.64 + 233.35 = 500
499.99 = 500
500 = 500