Subjects of Equestria! We are pleased to kick off the Nightmare Night Festivities and the 14th anniversary of the return of our beloved Princess Luna! Join us in celebration!
Interested in advertising on Derpibooru? Click here for information!
My Little Ties crafts shop

Help fund the $15 daily operational cost of Derpibooru - support us financially!

Description

QUESTION: 6 ponies and 1 dragon place their names in a hat. The names are shuffled before each creature picks a name from the hat. What are the chances that at least one of them pulls their own name?
 
Post your answers below.

safe2250689 edit179518 edited screencap94804 screencap301721 applejack206801 fluttershy267405 pinkie pie264258 rainbow dash288810 rainbow stars311 rarity224426 spike94700 twilight sparkle369023 alicorn332242 dragon90786 earth pony538772 pegasus529253 pony1682091 unicorn573357 g42111836 my little pony best gift ever2711 applejack's hat15969 big no315 boots36024 clothes669831 comic139588 cowboy hat27832 earmuffs1657 female1890364 fluttershy's purple sweater100 hat131549 male579201 mane seven8214 mane six38654 mare794190 math999 mathematics in the comments34 no805 scarf33396 screencap comic5620 shoes64288 sunglasses22166 sweater20484 sweatershy3683 twilight sparkle (alicorn)154050 winter outfit2928
Source

Comments

Syntax quick reference: **bold** *italic* ||hide text|| `code` __underline__ ~~strike~~ ^sup^ %sub%

Detailed syntax guide

root
Wallet After Summer Sale -
Artist -
Birthday Cake - Celebrated MLP's 7th birthday

@mathprofbrony  
Yes! The results from this are very surprising as most people would assume the likelihood of failure is very low. What’s even more surprising is that the size of the group doesn’t change the probability (gotta love consistency). The fact that e suddenly shows up is the icing on the cake.
 
 
Now to recap:
 
The function that gives the number of distinct derangements of n elements is called the “Subfactorial” and is written (!n):
 
full
 
If we plug in n=7, the subfactorial equation will tell us how many permutations exist where every element has shifted to a different place. In this case, it tells us how many permutations exist where no pony (or dragon) picked their own name.
 
If we divide this number by the total permutations possible (n!), we will get the probability that no one picks their own name. Since we want the compliment, we subtract this value from 1. This tells us the probability that someone picks their own name.
mathprofbrony
Nightmare in the Moon - Had their OC in the 2024 Derpibooru Collab.
Solar Supporter - Fought against the New Lunar Republic rebellion on the side of the Solar Deity (April Fools 2023).
Roseluck - Had their OC in the 2023 Derpibooru Collab.
Elements of Harmony - Had an OC in the 2022 Community Collab
Twinkling Balloon - Took part in the 2021 community collab.
Friendship, Art, and Magic (2020) - Took part in the 2020 Community Collab
Wallet After Summer Sale -
Friendship, Art, and Magic (2018) - Celebrated Derpibooru's six year anniversary with friends.
Birthday Cake - Celebrated MLP's 7th birthday
The End wasn't The End - Found a new home after the great exodus of 2012

Hello! :^)
 
This is known as a derangement problem, or more colloquially the hat check problem.
 
The probability that at least one pony gets their own name (counting Spike as a pony) is the opposite of (that is, 100% minus) the probability that no pony gets their own name. We ask, in how many ways can this happen? This is the number of derangements of seven elements.
 
To let Opal out of the bag, there are 1854 derangements of 7 elements, out of 7! (seven factorial) or 5040 possible permutations, and so in 5040-1854 = 3186 outcomes, at least one pony gets their own name. The probability of this happening is thus 3186/5040, or approximately 63.214%. There is almost a 2 in 3 chance that some pony gets their own name!
 
Now, if you’re still reading you might be curious as to whether there is a better way of coming up with such a number than sitting down and looking at every single one of 5040 permutations.
 
There is! The method is called inclusion-exclusion.
 
Start with all 5040 permutations of 7 elements.
 
Subtract those that have at least one element in the wrong place: you can pick any one of the 7 elements to “fix,” and then there are 6! permutations of the other elements. There are 76! many such permutations. So far our sum is 7! - 76!.
 
But wait! you might say, mathprofbrony you doofus, seven times six-factorial is just seven-factorial again! You’ve subtracted everything!
 
Hold your ponies, I reply, because a lot of those got counted twice or more – any permutation where two of them were in the same place. So we have to add them back in.
 
To count those, we pick two of seven places to fix: we can do that in 7-choose-2 ways, or 21 ways – and then let the other five names fall where they may. There are 215! such permutations. Now our sum is
 
7! - 7
6! + 215!.
 
With me so far?
 
You’re gonna say we overcounted some again, aren’t you.
 
You bet your horseshoes! Any of them where three or more were in the wrong place. We have to subtract those from the ones we added back in. There are 7-choose-3 * 4!, or 35
4!, of those. Get the pattern? Our final sum is
 
17! - 76! + 215! - 354! + 353! - 212! + 71! - 10!.
 
Which, sure enough, is 1854. And this pattern is a lot shorter for finding derangement numbers for bigger sets.
 
What if the number gets really big? I don’t want to add up a lot of terms.
 
If you’re willing to approximate, then the n-th derangement number is roughly just n!/e, e being 2.71828…. Which means that if 1000000 ponies put their names into a giant hat and drew them back out, the probability that at least one pony got their own name back would still be very close to 1-1/e, or about…
 
63.212%.
 
So as it turns out, once you’re up to seven or more ponies, the chance of somepony getting their own name back doesn’t change much regardless of whether you’re drawing for 7 or 7 million.
 
MPB out.
NotAPseudonym
Bronze Bit -
Happy Derpy! - For Patreon supporters

[Citation Needed]
Find the odds that all 7 pick a name that’s not their own, then subtract this from one?
 
1 - (6/7 * 5/6 * 4/5 * 3/4 * 2/3 * 1/2)
 
~86%
Brony4Life
Solar Supporter - Fought against the New Lunar Republic rebellion on the side of the Solar Deity (April Fools 2023).
Not a Llama - Happy April Fools Day!
The End wasn't The End - Found a new home after the great exodus of 2012

Wincest Connoisseur
@root  
1/7 for the first person.  
1/6 for the next person IF their name is still in the hat.  
1/5 for the next person IF their name is still in the hat.  
1/4 for the next person IF their name is still in the hat.  
1/3 for the next person IF their name is still in the hat.  
1/2 for the next person IF their name is still in the hat.  
100% for the last person IF their name is still in the hat.
 
But these are offset by the probability of their name being chosen up to that point, making it 1/7 for all of them from the start. For example, there is a 6/7 chance that the last person already had their name taken. So there is a… you guessed it, 1/7 chance that their name is still left in the hat, even though they have a 100% chance of taking the last name (whoever’s it is.)
 
So the answer is still 1/7.
root
Wallet After Summer Sale -
Artist -
Birthday Cake - Celebrated MLP's 7th birthday

The question is, what are the odds that at least one of the characters draws their own name, not the odds that all of them draw their own names.
Background Pony #60F1
the odds that all 6 ponies would each draw their own name:
 
(6x6) + (5x5) + (4x4) + (3x3) + (2x2) + (1x1) = 91
 
odds: 1/91  
How does my math hold up ROOT?