Probability household cars problem A survey consists of recording, the number of cars presently owned by a household among six major manufacturers. Order does not matter.
i.  Suppose that no household has more than four cars. In how many different ways can the survey sheet be filled out?
I was thinking maybe it would just be 4! + 6! but I have a feeling that is wrong, I'm not sure if that would account for multiple cars being from the same brand
 A: Let $x_1$ be the number of GMs, let  $x_2$ the number of Fords, and so on up to $x_6$ being the number of Nissans. We want to find the number of solutions of 
$$x_1+x_2+\cdots+x_6\le 4$$
in non-negative integers. This is the same as the number of solutions of 
$$x_1+x_2+\cdots+x_6+x_7= 4$$
(the variable $x_7$ counts the number of empty slots in the four-car garage).
Now we have a standard Stars and Bars problem (please see Wikipedia). The number of solutions is $\binom{4+7-1}{7-1}$, that is, $\binom{10}{6}$, or equivalently $\binom{10}{4}$.
A: Look at the cases of different numbers of cars:


*

*No cars: 1 way of filling out the survey

*1 car:   6 ways of filling out the survey.

*2 cars: 6*5/2 ways of filling out the survey without repetition;
        6 ways of filling out the survey with all the same manufacturer.

*3 cars: 6*5*4/(3*2*1) ways of filling out the survey without repetitions;
        6*5 ways of filling out the survey with 2 cars the same and 1 different;
        6 ways of filling out the survey with all the same manufacturer.

*4 cars: 6*5*4*3/(4*3*2*1) ways of filling out the survey without repetitions;
        6*5*4/2 ways of filling out the survey with 2 cars the same and the other 2 different (from each other and the first 2);
        6*5/2 ways of filling out the survey with 2 and 2;
        6*5 ways of filling out the survey with 3 cars the same and 1 different;
        6 ways of filling out the survey with all the cars from the same manufacturer.


Python has a built in module called itertools (https://docs.python.org/2/library/itertools.html) which has a iterator called combinations_with_replacement.

import itertools as it
tot = 0
for r in range(5):
 s=0

 for i in it.combinations_with_replacement("ABCDEF",r):

      s+=1

 t+=s

 print r,s,t

0    1    1
  1    6    7
  2   21   28
  3   56   84
  4  126  210

Total is 210
