PDA

View Full Version : Statistics Question


Sanchek
04-04-2008, 12:26 AM
Out of 26 letters, how many unique seven letter combinations are there, if the seven letters are alphabetized?

So, for instance, if we were talking about three letter combinations, ABC, ACB, BAC, BCA, CAB, and CBA all count as one unique match (since they all alphabetize to ABC).

How about 8, 9, and 10 letter combinations?

Palarran, help!

Malse
04-04-2008, 01:13 AM
You're talking about exclusionary combinatorials, so it's 27*26*25...

Sanchek
04-04-2008, 01:22 AM
I don't understand.

P.S. Why do you give me a completely different answer to this question every time I ask it? Not really instilling a lot of confidence here.

Malse
04-04-2008, 01:24 AM
You keep asking slightly different question. If the members of your set are unique or not matters a lot.

ie, you select A at random. A is no longer in your set. now you have 25 remaining choices. You select F. Now 24 remaining choices. 27 "letters" counting a space. K! - (K-n)!.

Sanchek
04-04-2008, 01:29 AM
Letters can appear multiple times, yes.

For example, AAB, ABA, and BAA would be allowed and all count as one grouping (AAB).

Malse
04-04-2008, 01:30 AM
You mean what are the odds of the next selected letter being after the prior one N times in a row?

Sanchek
04-04-2008, 01:33 AM
No. No odds.

I want to know how many unique, alphabetized groupings there are.

Sanchek
04-04-2008, 01:41 AM
For example, I believe the answer for two letters is 351.

What's the answer for three letters? Is it 3,276?

akipt
04-04-2008, 12:39 PM
Scrabble isn't worth this much headache man!

If you haven't figured it out by Monday, I'll ask a guy at work.

Palarran
04-04-2008, 01:43 PM
There's a handy table in my combinatorics textbook:

Choosing a Sample of r Elements from a Set of m Elements
Order | Repetitions | The sample | Number of ways to
counts? | allowed? | is called | choose the sample
--------|-------------|----------------|--------------------
No | No | r-combination | C(m,r) = m!/(r!(m-r)!)
| | |
Yes | No | r-permutation | P(m,r) = m!/(m-r)!
| | |
No | Yes | r-combination | C_R (m,r) = C(m+r-1, r)
| |with replacement|
| | |
Yes | Yes | r-permutation | P_R (m,r) = m^r
| |with replacement|

Asking for the number of distinct alphabetized combinations is the same as asking how many combinations there are where order doesn't count, since there is exactly one way to alphabetize a collection of letters.

So, you want the line where Order Counts = No and Repetitions Allowed = Yes (r-combination with replacement).

For 2 letters: C_R(26,2) = C(26+2-1,2) = 27!/(2!(27-2)!) = 351.

For 3 letters: C_R(26,3) = C(26+3-1,3) = 28!/(3!(28-3)!) = 3,276.

For 7 letters: C_R(26,7) = C(26+7-1,7) = 32!/(7!(32-7)!) = 3,365,856.

Malse
04-04-2008, 01:56 PM
Ah, Pal posted a more thorough answer. Mine is just as approximation.

Sanchek
04-04-2008, 02:23 PM
Hmm, that might just be doable.

Thanks for the info!

Cados Evilsbane
04-04-2008, 03:40 PM
I can't even follow one post in this thread... it makes my head spin.

"Does not compute! Does not compute! *BANG*"

Sanchek
04-04-2008, 11:31 PM
Would I be correct that 10 letters of 27 possibilities (want to pre-calculate a blank) would be 254,186,856 combinations?

Palarran
04-05-2008, 01:19 PM
Yes, but by that point you probably need to start considering how many of each tile there is in the game. Using tile counts found here:
http://www.moonatnoon.com/puzzles/reference/scrabble.html

#!/bin/perl
use List::Util 'min';
@freq = (9,2,2,4,12,2,3,2,9,1,1,4,2,6,8,2,1,6,4,6,4,2,2,1, 2,1,2);

print("Combinations with 10 letters: ".combos(10,0)."\n");

sub combos {
my($letter_count, $letter_index) = @_;
return 1 if ($letter_count<=0);
return $freq[$#freq]>=$letter_count ? 1 : 0 if ($letter_index==$#freq);

my $key = $letter_count . ',' . $letter_index;
return $combos_cache{$key} if exists $combos_cache{$key};

my $total = 0;
for (my $i=0; $i<=min($letter_count,$freq[$letter_index]); $i++) {
$total += combos($letter_count-$i, $letter_index+1);
}
$combos_cache{$key} = $total;
return $total;
}

Combinations with 10 letters: 137412392

Palarran
04-05-2008, 01:47 PM
To show the results of filtering out impossible combinations (due to letter distribution):

With/without filtering:
Combinations with 0 letters: 1 / 1
Combinations with 1 letters: 27 / 27
Combinations with 2 letters: 373 / 378
Combinations with 3 letters: 3509 / 3654
Combinations with 4 letters: 25254 / 27405
Combinations with 5 letters: 148150 / 169911
Combinations with 6 letters: 737311 / 906192
Combinations with 7 letters: 3199724 / 4272048
Combinations with 8 letters: 12353822 / 18156204
Combinations with 9 letters: 43088473 / 70607460
Combinations with 10 letters: 137412392 / 254186856

Sanchek
04-05-2008, 02:45 PM
For your humorous enjoyment, this was me trying to figure it out the night before you posted.

Ibudin
04-06-2008, 11:35 AM
At least you are using that brain for more than a hat rack Sanchek.

Starrla
04-08-2008, 04:19 PM
Lol

Bylimet Spiritwalker
04-08-2008, 10:38 PM
When I went to school, they taught us how to balance a checkbook, after we learned adding, subtracting, multiplication and division. They even showed how fractions and decimals worked when you got to a higher level. They called it Arithmetic.

Looking at Pal's post made my head hurt.