He needs 500/50=<<500/50=10>>10 bags of flour
That cost 20*10=$<<20*10=200>>200
He needs 10*.2=$<<10*.2=2>>2 worth of salt
So everything cost 1000+200+2=$<<1000+200+2=1202>>1202
He makes 20*500=$<<20*500=10000>>10,000 selling tickets
So he makes a profit of 10000-1202=$<<10000-1202=8798>>8798
#### 8798