How many ways can you scramble the letters.?
You are working on a word puzzle and are looking for 4 letter 'scrambles',
or permutations, from the word CALCULATOR.
For example CUTR is a 4 letter scramble.
How many ways can you scramble the letters.
My work: I tried to use the formula nPr, but there are repetitions
in the word CALCULATOR, which is AACCCLLORTU , so we can't use 10P4. What about 10P4 / (2! 3! 2!). I don't think that makes sense.
回答 (1)
You have double letters (C, A, L) and then the rest (U, T, O, R) are single letters
What you could do is consider 3 cases:
1) The string has no pairs of repeated letters
2) The string has one pair of repeated letters
3) The string has two pairs of repeated letters
CASE 1 - Zero pairs of repeated letters
You have 7 unique letters and you want to permute 4 of them:
7P4 = 7! / (7-4)!
= 7 * 6 * 5 * 4
= 840 ways
CASE 2 - One pair of repeated letters
First choose which letter is repeated:
3C1 = 3 ways
Then from the remaining *6* unique letters, pick 2.
6C2 = 15 ways
Now take your 4 chosen letters, with 2 repeats and arrange them:
4! / (2! 1! 1!) = 12 ways
Multiply these all together:
3 * 15 * 12
= 540 ways
CASE 3 - Two pairs of repeated letters
First, from the 3 doubled letters, choose 2:
3C2 = 3 ways
Now take your 4 chosen letters, with 2 *pairs* of repeats and arrange them:
4! / (2! 2!) = 6 ways
Multiply these together:
3 * 6
= 18 ways
ADD THEM UP:
Case 1 = 840
Case 2 = 540
Case 3 = 18
Total = 1398
If you were familiar with generating functions, that's another way to solve this. Feel free to look up more about that if you are so inclined.
Here's a sneak preview of this method:
4 single letters --> (1 + x)^4
3 double letters --> (1 + x + x²/2!)^3
Multiplying that out:
(1 + x)^4 * (1 + x + x²/2!)^3
= (1/8)x^10 + (5/4)x^9 + 6x^8 + 18x^7 + (297/8)x^6 + (219/4)x^5 + (233/4)x^4 + 44x^3 + (45/2)x^2 + 7x + 1
Take the coefficient of x^4 (since we are using a 4 letter subset).
(233/4) and rewrite it as n/4!
= (6*233)/(6*4)
= 1398 / 4!
n = 1398
Answer:
1398 ways
收錄日期: 2021-04-24 07:55:24
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20200422215516AAUKPX0
檢視 Wayback Machine 備份