A secretary was tasked to properly place 7 letters and 7 pictures into 7 envelopes such that each envelope has one corresponding letter and one corresponding picture assigned to it. Find how many ways the secretary can place the pictures and letters on the envelopes such that
No letter was placed on the right envelope.
No picture was placed on the right envelope.
No letter was placed together with its correct corresponding picture on any of the envelopes.
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.
If there was an easier way, I'd be happy to hear about it.
Given that we have 7 labeled envelopes, we are to derange 7 letters, and with respect to both the letters and the envelopes, we have to derange 7 pictures as well.
It is quite intuitive to think that we can first carry out the derangements of letters with respect to the envelopes first, which is ! 7 = 7 ! − ( 1 7 ) 6 ! + ( 2 7 ) 5 ! − . . . = 1 8 5 4
Now, let us look at its behavior when we only have 4 of each.
If we have 4 each of envelopes, letters, and pictures, we'll have 9 derangements of letters to envelopes, and 9 derangements of pictures to envelopes as well. How do we make sure now that no envelope contains a letter and its corresponding picture? We now plot them against each other; that is, we check all the 9 × 9 = 8 1 permutations and check which of these do not share a common label for a picture and a letter at any position (We now know that all of these arrangements are deranged with respect to the envelopes).
To put that into a clearer perspective, we check any two of the nine derangements (order considered, of course) whether any of the envelopes contain a correct pair of letter and picture. For example, for envelopes sequenced { A , B , C , D } , the letters may be placed like this: { B , D , A , C } . The pictures may also be placed like { D , C , A , B } , but since envelope C will contain both letter A and picture A , this doesn't count as a valid way. All in all, there are 2 4 of them, out of 81.
And that's what I did for 1 8 5 4 × 1 8 5 4 permutations. And got me 1 0 7 3 7 6 0 .
tl;dr Compare each derangement with all the other derangements and count which pairs do not contain any same letter at any position.