The trick is to note that you are never changing the parity of the number of white balls in the urn. If you picked out two black, you put a black back; two white, you put a black back; one white and one black, you put a white back. Thus if the original number of white balls was even, the last ball will be black, otherwise it will be white.

lib/DbaDatabase.php:134: Warning: dba_replace() [<a href='function.dba-replace'>function.dba-replace</a>]: You cannot perform a modification to a database without proper access