Optimisation is a fine art, really, you could do it in many different ways depending on your needs, for example, I have full dwellers and rooms and for me 3 three room plants, 2 two room plants and 4 three room reactors is enough to keep my fully active vault alive with Mr. Handys (which are slow as [censored]).
But other than the number of rooms, the keys lies in the dwellers and what they wear, for example; in my specific case I have 3 dwellers in each energy room all max stats and wearing military clothing (+3 str) but there are many combinations in which it would work (I also need to mention that the more dwellers and the better dressed they are impacts highly in rushes, for example I have a 2 room reactor with 4 people full stats wearing officer's fatigues and I can rush a room with 0% risk TWICE, which is great for a quick recovery after being raided) again, back to my specific case I only have 3 dwellers in each room because that is all I need for my vault to be at full energy at all times, this can be calculated easely you just need to tap in the resources bar and time 1 minute with a stopwatch or something and check how many resources (whichever you choose) were used in that minute, then go to your rooms and check how long it takes for those rooms to diliver resources, round that number up to the closest overall and multiply it by the number of rooms you have (or sum up the total resources of em all if you have plants and reactors) and you can have a good idea of how much resources you are creating by the minute, compare and tweak the number of dwellers or their clothing for fine tuning.
Example:
My Vault uses 28 energy every 10 seconds that means I use 168 energy per minute.
I have 2 two room reactors (40 energy each), 3 three room reactors (85 energy each) and 4 three room power plants (66 energy each), the sum of it all is 599, if we divide this number by 168 we get 3.5 which means that all my energy-providing rooms need to activate AT LEAST once every 3.5 minutes, which 3 dwellers in max stats and military fatigues (+3 str) provide without problems, I also take into acount the time it takes for Mr. Handy to move from room to room and collect them so remember these little details, they're the key.
Again I'm just using my vault as an example, the numbers are there and they can be calculated easely depending on your specific needs.
Also, this is one of the reasons people often fail when expanding, you have to take into consideration all this little details and at the begining of the game you are going to need a serious amount of dwellers to provide you with energy since their specials are gonna be very low and maybe you cant afford to upgrade the rooms, but the higher their SPECIALS get the less dwellers you will need to waste in resouce managing and you'll be able to place them elsewhere and actually be able to expand. When for me 9 rooms and 27 dwellers is enough to power up a fully room'd vault, for a new player it may take more dwellers, rooms and time to be able to BERALY subsist.
I used energy as an example cause it's probably the most important resource but you can obviously follow the same formula with water or food, just get those resources timed out and plan carefully beforehand.
Best of lucks.