The image above shows one of the possible interesting permutations of the word undertale . All of the letters are dearranged except for the last.
How many permutations of the word undertale are there such that there is only one letter on the same position?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Sorry, but I don’t understand how you got
d
8
. Could you explain more on that part? Thank you!
BTW, I’m looking for a pattern for
d
n
as well, with
d
1
=
0
,
d
2
=
1
,
d
3
=
2
,
d
4
=
9
but I can’t find one 😅
Log in to reply
The number d n of derangements of n symbols has the standard formula d n = n ! j = 0 ∑ n j ! ( − 1 ) j which can be proved using the Inclusion-Exclusion Principle (rather like the way I obtained the number 3 6 2 in my proof above). This result leads to the interesting observation that the proportion of derangements is n ! d n = j = 0 ∑ n j ! ( − 1 ) j → e − 1 n → ∞
Log in to reply
Oic! Thanks for telling me :)
Log in to reply
@Jeff Giff – Also, it's worth noticing that derangements also has a reclusive formula: d(n)=(n-1)(d(n-1)+d(n-2))
d n = (n-1) × (d (n-1) + d (n-2)) for n > 3. I just used it recursively, but you can find the direct equation for d n from this pretty easily. (Sorry about the bad formatting, I can't get it to past in or type in properly).
I got the above equation by doing the following (for re-ordering a list of numbers 1,2,...,n): 1. There are (n-1) ways to pick the number in the first position. Call it x. 2. There are d (n-1) ways to arrange the rest of the numbers if you treat 1 as if it is x (it can't be placed in the xth postion). 3. Now place 1 at the xth position. Then there are n-2 numbers left to order, so you get d (n-2) ways to order these. 4. Sum these together for the (n-1) possible x, and you get the above recursion.
(My problem with solving came from an assumption that the numbers below the letters in UNDERTALE signified that the Es where distinct).
For everyone who is too lazy to do the calculations:
1 2 3 4 5 6 7 8 |
|
67676
Do you need to check if p is in s or not? Isn't s a set?
Log in to reply
Yes you are right! I edited my post, thanks.
Problem Loading...
Note Loading...
Set Loading...
Suppose that one of the Es is in the correct place. There are 2 Es that could be chosen, and there are d 8 = 1 4 8 3 3 arrangements of the other 8 letters so that none of these are in the correct place (here d n is the number of derangements of n symbols).
Suppose that one of the other letters is in the correct place. Then the two Es must go in the places of two different letters again. There are 7 choices for the letter that will be fixed, and ( 2 6 ) choices for the two letters where the two Es will go. Suppose that, for example, letter D is fixed, and the two Es go in the L and T places. Then we have to arrange the letters L,T,A,R,U,N in the E,E,A,R,U,N places, so that none of A,R,U,N are in their correct place. Let A 1 , A 2 , A 3 , A 4 be the number of arrangements with A , R , U , N (respectively) in its correct place. Then ∣ A i ∣ = 5 ! for all 1 ≤ i ≤ 4 , ∣ A i ∩ A j ∣ = 4 ! for all 1 ≤ i < j ≤ 4 , ∣ A i ∩ A j ∩ A k ∣ = 3 ! for all 1 ≤ i < j < k ≤ 4 and ∣ A 1 ∩ A 2 ∩ A 3 ∩ A 4 ∣ = 2 ! . By the Inclusion-Exclusion Principle, we deduce that ∣ A 1 ∪ A 2 ∪ A 3 ∪ A 4 ∣ = 4 × 5 ! − 6 × 4 ! + 4 × 3 ! − 2 ! = 3 5 8 and hence there are 6 ! − 3 5 8 = 3 6 2 arrangements of L,T,A,R,U,N in the E,E,A,R,U,N places so that none of A,R,U,N are in the correct place.
Thus there are 2 × d 8 + 7 × ( 2 6 ) × 3 6 2 = 6 7 6 7 6 rearrangements of UNDERTALE so that exactly one letter is in the correct place.