Distributing persons into cars We want to distribute $10$ persons into $6$ different cars knowing that each car can take three persons. How many ways have to do it. The order of the person inside the same car is not important and the car can be empty. 
 A: If we put $i$ people in the 1-st car, there's $\binom{10}{i}$ ways to do this.  Once this is done, we put $j$ people in the 2-nd car, and there's $\binom{10-i}{j}$ ways to do this.  And so on, until we get to the final car, where we attempt to put in all of the unassigned passengers.  If there's more than 3, we discard this case.
Hence the number of ways is: $$\scriptsize \sum_{i=0}^3 \binom{10}{i} \sum_{j=0}^3 \binom{10-i}{j} \sum_{k=0}^3 \binom{10-i-j}{k} \sum_{\ell=0}^3 \binom{10-i-j-k}{\ell} \sum_{m=0}^3 \binom{10-i-j-k-\ell}{m} [0 \leq 10-i-j-k-\ell-m \leq 3].$$
Here $[0 \leq 10-i-j-k-\ell-m \leq 3]$ takes the value $1$ if $0 \leq 10-i-j-k-\ell-m \leq 3$ is true and $0$ otherwise.
In GAP this is computed by
WithinBounds:=function(n)
  if(n>=0 and n<=3) then return 1; fi;
  return 0;
end;;

Sum([0..3],i->Binomial(10,i)*Sum([0..3],j->Binomial(10-i,j)*Sum([0..3],k->Binomial(10-i-j,k)*Sum([0..3],l->Binomial(10-i-j-k,l)*Sum([0..3],m->Binomial(10-i-j-k-l,m)*WithinBounds(10-i-j-k-l-m))))));

which returns $36086400$.

Alternatively, let $\mathcal{G}$ be the set of partitions of $\{1,2,\ldots,10\}$ of size at most $6$ with parts of size at most $3$.  Given a partition $P \in \mathcal{G}$, there are $\binom{6}{|P|} |P|!$ ways to distribute the passengers among the cars in such a way to as give rise to the partition $P$ (after discarding empty cars).  So, the number is also given by $$\sum_{P \in \mathcal{G}} \binom{6}{|P|} |P|!.$$
This is implemented in GAP via:
S:=Filtered(PartitionsSet([1..10]),P->Size(P)<=6 and Maximum(List(P,p->Size(p)))<=3);;
Sum(S,P->Binomial(6,Size(P))*Factorial(Size(P)));

which also returns $36086400$.
