DNA testing can be used to determine paternity by collecting samples from an individual and their alleged father to match their DNA sequences. Paternity tests have a 99.5% success rate of identifying the biological father by comparing the paternal sequence to the father's genome. DNA testing is also used for genealogy studies to find relationships and common ancestors within populations by linking ancestry up to 150,000 years ago, as well as determining the gender of an unborn baby by searching for the presence of a Y chromosome after 6 weeks of pregnancy.