We study the optimal production planning for an assembly system consisting of n components in a single period setting. Demand for the end-product is random and production and assembly capacities are uncertain due to unexpected breakdowns, repairs and reworks, etc. The cost-minimizing firm (she) plans components production before the production capacities are realized, and after the outputs of components are observed, she decides the assembly amount before the demand realization. We start with a simplified system of selling two complementary products without an assembly stage and find that the firm's best choices can only be: (a) producing no products or producing only the product of less stock such that its target amount is not higher than the other product's initial stock level, or (b) producing both products such that their target amounts are equal. Leveraging on these findings, the two-dimensional optimization problem is reduced to two single-dimensional sub-problems and the optimal solution is characterized. For a general assembly system with n components, we show that if initially the firm has more end-products than a certain level, she will neither produce any component nor assemble end-product; if she does not have that many end-products but does have enough mated components, she will produce nothing and assemble up to that level; otherwise she will try to assemble all mated components and plan production of components accordingly. We characterize the structure of optimal solutions and find the solutions analytically. 
Optimal production planning for assembly systems with uncertain capacities and random demand