I'm confused with this so-called permanent shortage or surplus with price ceilings and floors, respectively.
It seems to me that if the government put a price ceiling on good x, there would be an initial shortage, but in the longer run supply would increase, albeit sold at an artificially lower price, because the demand must still be met and there is still money to be made.
If the government put a price floor on good y, there would be an initial surplus, but supply would then be decreased because producers would not keep producing that good if the product isn't being sold.
So it seems to me that given maximum and minimum price controls, there would be no such thing as a prolonged shortage or surplus.
We will assume that the price control is perfect, that is to say that there is nothing that people will offer up in place of money to make up the difference in cost, because that throws off the whole example and is a different matter completely.
As for the price ceiling the fact is that firms WILL NOT sell at a loss. Here we'll assume a perfectly competative, cost reflective price. Now so long as this is the case then producing any more after point Y will result directly at a lost because costs do not justify production at that price. Firms will not run at a loss. Perhaps in the long run the supply curve will shift to the right and the competative price will be the one where the price floor is, but I don't see why you think firms will produce when they are running at a loss. With this said, things get trickier when market power is involved.
As for price floors, you're perfectly right that wherever it is possible less of the product will be produced by firms and the supply curve will shift to the left, justifying the higher price, because allowing surpluses to stack up will almost certainly result in at least an oppurtunity cost for the firm. The problem is, of course, what happens if the price floor affects direct inputs, especially ones which need money to support a family, and therefore don't have anywhere to be redirected, and can't just sit indefinitely as reserves?
I hope that answers your question.
"It seems to me that if the government put a price ceiling on good x, there would be an initial shortage, but in the longer run supply would increase, albeit sold at an artificially lower price, because the demand must still be met and there is still money to be made."
There is money to be made... at tight margins, assuming the government didn't set the ceiling such that there's no way to produce the product at a profit. Realize then that everyone who engages in production has margins themselves. Some might produce widget X because they love the business and accept a very small profit, others will only operate at a much higher margin. Now changes in the market with regard to demand and technology etc might make production more efficient and render the ceiling irrelevant because the actual market price fell below. But then that ignores the practicality of why proce controls are put into place to begin with. As with a central bank controlling interest rates, sure they could raise them but the practical reality is the incentive and purpose of the bank is really to lower them to facilitate the theft of money. Same with price controls, you could hypothesize a myriad of situations where this or that happens, but generally they're put in place because prices for something are high and/or rising and the situation is persistent enough to motivate the attempt at controls. Which means squeezed margins, which means fewer producers seeing the returns they want, which means ceteris paribus less produced than otherwise would have been.
Or put simply, random idiocy aside, no one tries to put a maximum price control in effect because prices are too low and they are perfectly willing to pay. No, they do it because they want to buy a good selling at price X for now and the foreseeable future at some fraction of X. Which means a shortage. Mathematically you can posit all kinds of scenarios, critical to economics is humans and why they do certain things though, so in your analysis never forget what's motivating the action you're analyzing.