Oh dear, I'm afraid the penny just isn't dropping for you on this! Don't take it the wrong way, it'd be much easier if you were sitting across a table from one of us!
In the first case above, you've sold stock that cost 50k, for 100k, and you've got none left. So you clearly have made a profit of 50k.
In the second case, you bought 50k of stock, sold some of it for 100k, and still have 20k of it left. So you have clearly made 70k of profit.
The question you have actually asked is, given that you have made X amount of profit already (be it 50k or 70k as above, which one is actually irrelevant at this point as it has already happened!), what happens if you now go and buy more stock...
And what we are all telling you is that if you buy say 40k of stock, TODAY, then it changes the figures as follows:
Sales value 100,000 - this doesn't change, as you haven't sold anything
Less the result of the following:
Stock @ start of accounting year 0 - doesn't change (obviously, it's a historical figure)
+ Stocks purchased during the year 50,000 - becomes 90,000 (50k + 40k)
-Stocks on hand @ end of the accounting year 0 - becomes 40k (0 + 40k)
{Sum of above 3 values is deducted from sales value} (50,000) - doesn't change because all you've done is increase purchases +40k, and closing stock -40k.
Profit before overheads 50,000 - still the same.