When preparing for pregnancy, the gender of the fetus is determined by the sex chromosomes carried by the sperm. Adjusting the pH of the diet and choosing a suitable intercourse on the ovulation day may affect the probability of having a boy or girl. However, these methods are not scientifically proven and should not be overly relied upon.