<- function(nBabies) {
randomBabies # Create a vector representing the parents
<- 1:nBabies
parents
# Shuffle the babies randomly
<- sample(parents)
babies
# Count how many babies are correctly returned
sum(parents == babies)
}