system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: When a company goes public, how do they decide how many shares are available for people to buy, and what price?

So you're the latest Silicon Valley app, and you're going public. How does whoever is handling the IPO decide the company has X amount of shares and they're initially worth X amount? 

Is it basically an estimate, they assume that 1,000,000 shares will be sold at $1 rather than 100,000 at $10? But then if that's the case why not offer more than 1,000,000 l, why not make it 2,000,000 shares at $1.
gpt
Before companies go public they almost always do at least *one* round of private investing. 

Say you found a company, you own 100% of it. You do a round of investing where you sell off 10% for $500,000 to a private investor. You own 90% still, the investor owns 10%. When you go public, you're putting up some of  your 90%. It's priced so as not to devalue the original guy's investment. Meaning you shouldn't price it so that 10% is now only worth $10 instead of $500,000, because that would screw over the guy who gave that money originally.

You also don't want to price it too high because people might not buy it. 

There are a lot of ways to value a company. One way is to look at all the factors - how many assets do you own (buildings, printers, inventory, etc.), how much debt do you owe, how profitable are you, etc.