"Much Apu About Nothing"

Season 7 / Episode 23 (17:23)

but why does the American flag have precisely 47 stars?

Because

this particular flag is ridiculously out of date.