In my course, we had an example: give the density matrix of a system arising from a proces that generates a [0> with probability 1/2 and a [1> with prob. 1/2. The answer is $1/2[0\rangle\langle0] +1/2[1\rangle\langle1]$.
But it seems to me that $\sqrt{1/2}[0\rangle + \sqrt{1/2}[1\rangle$ does the same, which has a different density function, $1/2[0\rangle\langle0]+1/2[1\rangle\langle0]+1/2[0\rangle\langle1]+1/2[1\rangle\langle1]$. What is my mistake?