How many 2-letter words can you get from aabcccddef (aa would be one of many, bb would not)
I thought it would be 10!/8! But apparently I'm doing something wrong. Can anyone help me out because I'm stumped.
 A: If you can't reason it out in a "clever" way, it is often worth trying brute force. Imagine trying to write down an alphabetically ordered list of all the words you can make.
How many can start with "A"? Well "A" can be followed by A, B, C, D, E or F, so that's six ways.
How many can start with "B"? That can be followed by A, C, D, E or F, which is only five ways, since there isn't a second "B".
How many can start with "C"? Since "C" appears three times in your list, it can be followed by itself, or by any of the other five letters, so just as with "A" there are six ways. Note that we don't get any "extra" ways just because "C" appears more times than "A"; anything beyond a second appearance is redundant.
Hopefully it is now clear that each letter that appears only once in your list can appear at the start of five words, and letters that appear twice or more can appear at the start of six words. The letters that appear only once are "B", "E" and "F", each of which can be at the start of five words, so that makes 5 + 5 + 5 = 15 words. The letters that appear twice or more are "A", "C" and "D", each of which can be at the start of six words, so that makes 6 + 6 + 6 = 18 words. In total there are 15 + 18 = 33 words.
This is more long-winded than the other methods, but by trying to think about the answer in this systematic sort of way you may have been able to "spot" one of the faster methods.
Note that if this had been phrased as a probability question, your first inclination may have been to draw out a tree diagram. It would have started with six branches for the first letter, but for the second letter there would have been six branches coming out from "A", "C" and "D" (because they can be followed by any of the six letters) but only five branches coming out from "B", "E" and "F" (because they cannot be followed by themselves). This branching pattern is effectively the same as in my answer, but you may prefer to think of it more visually in a tree.
A: A mathematical approach
From a mathematical point of view, the solution is the set of elements of the cartesian product between the list and itself once removed the diagonal. You can solve this problem using this algorithm:


*

*calculating the cartesian product between your list and itself.

*removing the diagonal

*create a set from the array


A set is a well-defined collection of distinct objects, hence objects are not repeated. 
Translating it into Python
from itertools import product
import numpy as np

letters = list("aabcccddef")
cartesianproduct = np.array(["".join(i) for i in product(letters,letters)]).reshape(10,10)


cartesianproduct

Out :
array([['aa', 'aa', 'ab', 'ac', 'ac', 'ac', 'ad', 'ad', 'ae', 'af'],
       ['aa', 'aa', 'ab', 'ac', 'ac', 'ac', 'ad', 'ad', 'ae', 'af'],
       ['ba', 'ba', 'bb', 'bc', 'bc', 'bc', 'bd', 'bd', 'be', 'bf'],
       ['ca', 'ca', 'cb', 'cc', 'cc', 'cc', 'cd', 'cd', 'ce', 'cf'],
       ['ca', 'ca', 'cb', 'cc', 'cc', 'cc', 'cd', 'cd', 'ce', 'cf'],
       ['ca', 'ca', 'cb', 'cc', 'cc', 'cc', 'cd', 'cd', 'ce', 'cf'],
       ['da', 'da', 'db', 'dc', 'dc', 'dc', 'dd', 'dd', 'de', 'df'],
       ['da', 'da', 'db', 'dc', 'dc', 'dc', 'dd', 'dd', 'de', 'df'],
       ['ea', 'ea', 'eb', 'ec', 'ec', 'ec', 'ed', 'ed', 'ee', 'ef'],
       ['fa', 'fa', 'fb', 'fc', 'fc', 'fc', 'fd', 'fd', 'fe', 'ff']], 
      dtype='|S2')

We remove the diagonal 
diagremv = np.array([ np.delete(arr,index) for index,arr in enumerate(cartesianproduct)]) 

diagremv

array([['aa', 'ab', 'ac', 'ac', 'ac', 'ad', 'ad', 'ae', 'af'],
       ['aa', 'ab', 'ac', 'ac', 'ac', 'ad', 'ad', 'ae', 'af'],
       ['ba', 'ba', 'bc', 'bc', 'bc', 'bd', 'bd', 'be', 'bf'],
       ['ca', 'ca', 'cb', 'cc', 'cc', 'cd', 'cd', 'ce', 'cf'],
       ['ca', 'ca', 'cb', 'cc', 'cc', 'cd', 'cd', 'ce', 'cf'],
       ['ca', 'ca', 'cb', 'cc', 'cc', 'cd', 'cd', 'ce', 'cf'],
       ['da', 'da', 'db', 'dc', 'dc', 'dc', 'dd', 'de', 'df'],
       ['da', 'da', 'db', 'dc', 'dc', 'dc', 'dd', 'de', 'df'],
       ['ea', 'ea', 'eb', 'ec', 'ec', 'ec', 'ed', 'ed', 'ef'],
       ['fa', 'fa', 'fb', 'fc', 'fc', 'fc', 'fd', 'fd', 'fe']], 
      dtype='|S2')

We compute the lenght of the set of elements:
len(set(list(diagremv.flatten())))

Out: 33

A: You have 6 different letters : a,b,c,d,e,f out of which you can generate 6 x 5 = 30 words with two different letters. In addition, you can generate the 3 words aa,cc,dd with the same letter twice. So the total number of words is 30+3=33.
A: I think the reason some think the question unclear is because it uses the term "2-letter words".  Given the way everyone is approaching a solution, they're all interpreting "2-letter words" to mean something like "letter pairs".  As an avid Scrabble player, I immediately took the question to mean, "How many legitimate 2-letter words can be made from these letters?"  And that answer is -- 12!  At least, according to the latest edition of the Official Scrabble Players Dictionary (OSPD5).  The words are aa, ab, ad, ae, ba, be, da, de, ed, ef, fa, and fe.  (Please bear in mind that the fact that you've never heard of many of these words does not negate their validity!)  ;o)
Just my "2 sense".
A: An alternative to Zahava's method: there are $6^2=36$ ways of pairing two of the letters a-f. However, there aren't 2 b, e or f characters, so "bb", "ee" and "ff" aren't possible, making the number of words $36-3=33$.
The way you've tried to approach the problem seems to ignore the fact that there aren't 10 distinct letters. If you had 10 distinct letters then your answer would be correct.
A: Yet another way to count without brute force:
If the first letter is a, c, or d there are 6 distinct remaining choices for the second letter.
But if the first letter is b, e, or f there are only 5 distinct remaining choices for the second letter.
So there are $3\cdot6 +3\cdot5 = 33$ distinct two letter words.
A: There is a problem in the way you ask your question. What actions are actually allowed on line "aabcccddef" to take 2-letters word? Can we replace the latter or only cross the unnecessary? I've found two possible answers depending on this conditions:
1) It we can replace the letters in any way the answer as 33 as it's mentioned before. 30 pairs of different letters(6*5) and 3 pairs of similar letters.
2) If we can't switch letters places and can only cross, we'll get much less answer. Let's count from start to end. Starting with "a" we have 6 letters to be second, starting with "b" it's only 4. "c" also has 4, "d" - 3 and "e" - 1. That's 18 totally.
A: my answer to the question: How many 2-letter words can you get from aabcccddef


*

*aa; 2. ab; 3. ad; 4. ae; 5. ad; 6. ba; 7. be; 8. de; 9. fa; 10. fe


*//The point is the question reads, "words" not combinations of pairs.  Using words the letter would have to appear twice to use the word more than once for example there are two of the letter 'a' and two of the letter 'd' therefore, it is possible to write 'ad' as a word twice.  
