On the ability of neural networks to perform generalization by induction