Question: I know that you are allowed to pray for a baby to be either a boy or a girl up to 40 days from the moment of conception. It is true that the physical characteristics of the sex of the unborn child manifest about this time. However, the genetic information for the sex of the child was laid down at the moment of conception. Now, I think there is a rule not to pray for something that has already taken place. Therefore, why can we pray up to 40 days for the baby’s sex, when the genetic decision for its sex has already been made? (We could test the DNA at any point from conception, and determine the child’s sex).
Answer: Your question is an excellent one, and I’m afraid to say that I have not really found a good answer (though I have found many possibilities).
The Jerusalem Talmud says that Leah and Rachel prayed for the gender of their babies to be changed in-utero, which they were (Leah had Dina, and Rachel had Joseph). So it seems that in the time of the Torah, DNA notwithstanding, it was possible to pray for the gender of a child because it could be changed. The Midrash Tanchuma actually says that one may pray for the gender of the child up until it is born. Presumably if we don’t know the gender, it is possible for God to change it, even though that would be miraculous. It seems that if something is unknown, God has more “leeway”. It is possible (though I’m not sure) that nowadays, when we know that the gender has already been decided from conception, that it would be a wasted prayer. Alternatively, we could say that we may pray for a specific gender, as long as we don’t actually know the gender of this particular child. This is because God can change the DNA if He wishes, without performing an overt miracle.
Wishing you all the best,
Rabbi David Sedley