# How many combinations are there?

I have $4$ electrons to place in $7$ orbitals. Each orbital can hold up to some maximum number of electrons. Let's name the orbitals $a,b,c,d,e,f,g$ for reference. Let's say the maximums are $1,1,2,5,2,1,1$.

So for instance, I could place one electron in orbitals $a,b,f,g$ or I could place all four in orbital $d.$ Or, I could place two in both $c$ and $e$, but I cannot place more than one in $a,b,f,g,$ nor more than two in $c$ or $e$, etc.

How many combinations are there?

The basis for this problem - I've written a program to generate electron configurations which are bounded by maximum occupancy. I want to check that my program is generating all possible configurations, by comparing the actual length of the list with this calculation. My program says there are $90$ (edit: not $175$!) configurations, which may or may not be true.

thanks!

• Are we to assume that there are no sub-orbitals, spins, and so on, so that (for example) there is exactly one way to place all four electrons into orbital $d$? May 29, 2015 at 20:01
• yes, I don't have a need for that level of detail, yet. May 29, 2015 at 20:14

I get only $90$ configurations, not $175$. (Remark: I posted this answer almost simultaneously with the OP's edit!)

If you're putting $4$ electrons into orbitals, the number of occupied orbitals in a configuration will be $4$, $3$, $2$, or $1$. So we need to count the number of configurations for each of these cases.

If the number is $4$, each occupied orbital has just $1$ electron; there are ${7\choose4}=35$ such configurations.

If the number is $3$, there will be one occupied orbital with $2$ electrons and two orbitals with $1$ each; there are ${3\choose1}{6\choose2}=3\cdot15=45$ such configurations.

If the number is $2$, either there are two orbitals with $2$ electons each or there is one orbital with $3$ electrons and one with $1$. There are ${3\choose2}=3$ configurations in the first case and ${1\choose1}{6\choose1}=6$ configurations in the second case.

If the number is $1$, there is just $1$ configuration (namely all $4$ electrons in orbital $d$).

The sum is $35+45+(3+6)+1=90$.

• Now there's the smart answer! I started to write out a "stars and bars" solution before I had fully thought it though, and... well, needless to say, that answer won't exist any time soon. May 29, 2015 at 20:29
• This is great! thanks! now I just need to translate that into my program where everything given is a variable May 29, 2015 at 20:32
• @akerlin2, in a more general setting, the number of cases can get considerably more complicated. May 29, 2015 at 20:34