A child ends up with galactosemia when both parents have a defective d gene and both pass it on to their baby.