Combinatorics: How many ways to wear these socks. Four socks in a drawer: two whites and two blacks. How many sock combinations can I wear?
It is obvious to me that the answer is four:


*

*Two white socks

*Two black socks

*White on the left foot, black on the right foot

*Black on the left foot, white on the right foot


However, I am having trouble devising the proof of this. If I start with the left foot, then I have four socks to choose from, but two are identical to others so I don't take them into account:
$$\frac4{1+1} = 2$$
Then I take the right foot, which has three to choose from but one is identical:
$$\frac31 = 3$$
Then $2+3=5$, which is not the right answer! What am I doing wrong here?
My goal is to know how to generalise. Next time I may have 20 different colours, and arbitrary numbers of each colour sock.
Thanks.
 A: You have $2$ choices of colour for the first foot then there will still be socks of each colour left no matter what you pick, so there will be $2$ choices of colour for the second foot.
Hence $2\times 2 = 4$ possibilities in all!
A: I will put the important point at the beginning.  You gave a careful, well-written, and detailed proof. Here it is, copied verbatim:
It is obvious to me that the answer is four:


*

*Two white socks

*Two black socks

*White on the left foot, black on the right foot

*Black on the left foot, white on the right foot


Perhaps one could omit the personal "to me," it introduces a note of hesitation. The rest is very good, absolutely clear. The "obvious" identifies you as someone with mathematical training. 
Then came an attempt, unsuccessful, to manipulate numbers.  Such a thing is not a proof, even if one gets the right numerical answer. The idea is primary.
In the analysis that you are (implicitly) making during your calculations, there is no justification for the division $\frac{3}{1}$. Nor is there a justification for addition.  You should have written that for every choice of what you put on the left foot, there are $2$ choices of what to put on the right.
Now let us look at a generalization, say to four colours.  Suppose that we have $a$ (where $a>0$) identical pairs of red socks (so $2a$ red), $b$ pairs of yellow, $c$ pairs of green, $d$ pairs of blue. There are "obviously" $4$  choices of colour for the left foot. For every such choice, there are $4$ choices of colour for the right foot, for a total of $(4)(4)$ outfits.
The analysis needs to change if your washing machine eats socks, so that the mates of some socks have vanished. Suppose we have positive numbers $s$, $t$, $u$, $v$, $w$ of red, yellow, green, red, black. If each of $s$, $t$, $u$, $v$, and $w$ is $\ge 2$, there are $5$ choices for the left, and for each such choice there are $5$ choices for the right, total $(5)(5)$.
But if (say) $s$, $t$, and $u$ are $\ge 2$, but $v=w=1$, we need to be careful. True, there are $5$ choices for the left. But it is no longer true that for every such choice, there are $5$ choices for the right. If you put a black sock on the left, there are only $4$ choices for the right.
The general idea still works, but we have to break things up into cases: (i) on the left foot we put a colour that has at least one mate of that colour, and (ii) on the left foot we put a lonely sock.
For case (i), there are $3$ choices for the left, and for each such choice, there are $5$ choices for the right, a total of $(3)(5)$. For case (ii), there are $2$ choices for the left, and for each such choice there are $4$ choices for the right, a total of $(2)(4)$.  Finally, add. The total number of choices is $(3)(5)+(2)(4)$.
There are other ways to handle the problem.  For example, suppose that we have $m$ colours which each have at least $2$ socks of that colour, and $n$ colours for which we only have a single sock.  There are $m$ ways to choose a boring monochromatic pair. For the bicoloured outfits, there are $m+n$ choices of what goes on the left, and for each such choice there are $m+m-1$ choices for the right, a total of $(m+n)(m+n-1)$ bicoloured outfits. The total number of outfits is $m+(m+n)(m+n-1)$. Or else one can count the bicoloured outfits by saying there are $\binom{m+n}{2}$ ways to choose a pair of colours, and for each choice of colours, there  $2$ ways to wear them.   
A: Your first answer is correct.
Trying to correct your second answer, you might have written $\dfrac{2}{2}+\dfrac{2}{2}=2$ distinct colour choices for the left foot and either $\dfrac{1}{1}+\dfrac{2}{2}=2$ or $\dfrac{2}{2}+\dfrac{1}{1}=2$ for the right foot (depending on which colour you had chosen for the left foot, though it makes little difference here).
Then, instead of adding, you should have multiplied $2 \times 2 =4$ to give the final result.  
