<s>[INST] Posible combinations of available rooms I have $x$ people to divide over different type of rooms.
Possible rooms: 


*

*$1$ person bedroom normal view; 

*$1$ person bedroom sea view;

*$2$ person bedroom


For $x = 4$
Possible combinations are
$$(0,0,2),  
(0 ,2, 1),  
(2 ,0, 1),  
(1 ,1, 1),  
(4 ,0, 0),  
(3 ,1, 0),  
(2 ,2, 0),
(1 ,3 ,0),
(0 ,4, 0)$$
Note : Plenty of rooms are available. 
How can I get all posible combinations?
 [/INST] You can solve this using generating function such as this
Bedroom 1 can be 0,1,2,3,4
Bedroom 2 can be 0,1,2,3,4
Bedroom 3 can be 0,2,4
Translating this into generating function and the number of combinations would be the coefficient of $x^4$
Thus the above problem could be translated into $(1+x+x^2+x^3+x^4)^2(1+x^2+x^4)$ and finding the coefficient of $x^4$
The product is given from Wolfram Alpha as
$x^{12}+2 x^{11}+4 x^{10}+6 x^9+9 x^8+10 x^7+11 x^6+10 x^5+$***9***$x^4+6 x^3+4 x^2+2 x+1$
Thanks 
Satish
</s>