2

I have changed the title to reflect that I am looking for the formula, not just the final answer, for my example and I have added an addendum for clarification.

I have been searching for an answer to this for about 4 hours now, but the closest I found was the formula for permutations $\frac{n!}{(n-r)!}$ and this: How many different words can be formed using all the letters of the word GOOGOLPLEX?

From the googolplex answers it looks like $\frac{10!}{3!⋅2!⋅2!} = 151200$ is the correct answer. So, can I just combine the two? $N = 26$ for the letters of the alphabet. $R = 10$ for the number of letters chosen. Then for each duplicate letter, I simply take the factorial of the count of repetitions (I'll use the 3, 2, 1, 1, 1, 1, 1 from my original question). And I see that I can ignore the unique letters as 1! is 1. So, would the final formula be something like $\frac{26!}{(26-10)!*3!*2!} = 1.60627E+12$ ?

I think I have that formula correct, but the answer seems too large. I couldn't figure out how to format the equations like they had them in the other question, but hopefully it is legible enough. Also, it has been over a decade since I took Statistics 101, so please don't use any abbreviations, symbols, or equations without explaining them or at least providing an example. I might have stumbled on the answer in my search, but couldn't tell because they wrote things like: "$(x_{1}+\cdots +x_{m})^{n}=\sum _{{|\alpha |=n}}{n \choose \alpha }x^{\alpha }$". That couldn't make less sense to me if it were written in Klingon!

Addendum

I am seeing responses using notations like $(53)$ and $(261)$, but then wildly different formulas applied to each. Somehow $(53)$ translates to: $10!3!2!$ and $(261)$ simplifies to just: $26$... Maybe the formulas used change based on the context, but I don't know enough about probability notation to understand that.

As the updated title reflects, I am looking for the formula that I can use to find the probability when the number of duplicates changes. I used the example: $(3,2,1,1,1,1,1)$, but I need a formula or formulas that I can use to find the solution when the orders looks like: $(4,2,2,1,1)$, $(9,1)$, $(10)$, $(3,1,1,1,1,1,1,1)$, $(3,2,2,1,1,1)$, $(5,3,1,1)$,etc. Simply posting (53) or (261) doesn't provide me enough information to derive a formula that I can use.

JMP
  • 22,637
  • The duplicate I linked should be comprehensible; it gives a recursive formula to compute the number of ways, which can be quickly computed with dynamic programming. There are other "formulas", but they either involved unwieldly summations of binomial coefficients, or exponential generating functions. – Mike Earnest Jul 13 '22 at 17:16

2 Answers2

2

Addendum-3 added to respond to another additional comment question of Timothy Joseph.


Addendum-2 added to respond to an additional comment question of Timothy Joseph.


Addendum added to respond to the comment question of Timothy Joseph.


So, can I just combine the two?

I do not understand this (additional) question that you are asking. If you leave a comment following my response, where you clarify this question, then I will edit my answer. Also, the question in your problem's title is inconsistent with the word GOOGOLPLEX.

The problem can be solved without (much) Math by relying on intuition around the concept of over-counting.

If you have $n$ distinct items and $r$ additional items that are all identical, and you then estimate the number of ways of permuting the $(n+r)$ items as $(n+r)!$, you will have over-counted by the factor of $(r!)$.

This is because the $r$ identical items can be ordered in $(r!)$ ways, and you will have regarded each ordering as distinct, when it is not distinct.

Based on this intuition, the answer to the question in the problem's title must be

$$\frac{10!}{(3!)(2!)}.$$

The word GOOG0LPLEX has 2 G's, 3 O's, 2 L's and PEX.

Therefore, the computation here must be

$$\frac{10!}{(3!)(2!)(2!)}.$$


Addendum
Responding to the comment question of Timothy Joseph.

You are given that :

  • A word is formed from the $26$ letter alphabet.

  • This word has has $10$ letters.

  • These $10$ letters consist of $4$ occurrences of one letter, $2$ occurrences of a 2nd letter, $2$ occurrences of a 3rd letter, and then $2$ more distinct letters (i.e. 5 different letters in all).

  • These $5$ different letters are selected at random from the alphabet, and then permuted into a string of 10 letters, in accordance with the previous bullet point. No regard is given whether the $10$ letter character sequence formed is actually a word in the English language.

Then, the question is:
What is the probability that the 10 character sequence forms the word KNICKKNACK?

Note that this is distinct from merely asking for the probability that the chosen letters consist of $4$ K's, $2$ N's, $2$ C's, an I and an E.


I will attack the problem combinatorically, with a computation of

$$\frac{1}{D},$$

where $D$ represents the total number of ways of forming the 10 character sequence, consistent with the bullet points at the start of this Addendum.

The number of ways of selecting a letter to repeat $4$ times, then $2$ letters to repeat twice each, and then $2$ more distinct letters is

$$S = \binom{26}{1} \times \binom{25}{2} \times \binom{23}{2}.$$

So, there are $S$ ways of selecting the letters.

Assume that the letters formed happen to be
KKKK,NN,CC,I,A.

As discussed at the start of this answer, the number of ways of permuting these letters is

$$T = \frac{(10)!}{4! \times 2! \times 2!}.$$


Putting it all together:

  • $\displaystyle S = \binom{26}{1} \times \binom{25}{2} \times \binom{23}{2}.$

  • $\displaystyle T = \frac{(10)!}{4! \times 2! \times 2!}.$

  • $\displaystyle D = S \times T.$

  • The probability of the sequence specifically being KNICKKNACK
    is $\displaystyle \frac{1}{D}.$


Addendum-2
Responding to the additional comment question of Timothy Joseph.

... how can there only be a 1/26 chance of getting 4/10 k's from a pool of 26 letters? The formula you provided looks like it only covers the first instance of getting a k randomly from the pool of 26 letters. Shouldn't the 4 and 10 factor somewhere into (the computation of) $S$?

No. A set of constraints is given for what the $(10)$ character sequence must look like. Basically, these constraints require that both of the following steps are followed.

Step-1
First, Set-1 must be filled with exactly one element $\{A\}$. Then, from the remaining $(25)$ letters of the alphabet, Set-2 must be filled with exactly two elements (chosen in any order) $\{B,C\}$. Then, from the remaining $(23)$ letters of the alphabet, Set-3 must be filled with exactly two elements (chosen in any order) $\{D,E\}$.

Step-1 Continued
Then, once Set-1, Set-2, and Set-3 are formed, a Multiset must be formed that looks like $\{A,A,A,A,B,B,C,C,D,E\}.$ In this Multiset, it is regarded as irrelevant what order the elements of the set are listed in.

Step-2
Then, once the Multiset is formed, the letters from this Multiset must be permuted into any 10 character sequence.


Note that once Set-1, Set-2, and Set-3 are formed, the Multiset is completely determined. For example, if Set-1, Set-2, Set-3 are $\{K\}, \{N,C\},$ and $\{I,A\},$ respectively, then the MultiSet must specifically be $\{K,K,K,K,N,N,C,C,I,A\}.$

So, to enumerate how many satisfying sequences there are, you have to do two computations:

  • How many distinct ways are there of forming the distinct sets Set-1, Set-2, and Set-3?
    There are $\displaystyle S = \binom{26}{1} \times \binom{25}{2} \times \binom{23}{2} = 26 \times \frac{25 \times 24}{2} \times \frac{23 \times 22}{2},~$ ways of distinctly forming Set-1, Set-2, Set-3.

  • For any specific Set-1, Set-2, Set-3, how many ways are there of taking the completely determined Multiset, whose form is $\{A,A,A,A,B,B,C,C,D,E\}$, and forming distinct permutations of these $(10)$ letters into a sequence?
    As discussed, the computation here is $~\displaystyle T = \frac{(10)!}{(4!) \times (2!) \times (2!)}.$

So, $(S \times T)$ represents the overall number of ways that the $10$ character sequence can be formed, which satisfies the given constraints.


Addendum-3
Responding to another additional comment question of Timothy Joseph.

Then I get part 1 of Step-1, but part 2 is where I am lost. 1/26 makes sense for getting the first "k", but how do you end up with 4 of them in the multiset part? Shouldn't there be a probability to of ending up with 4 of them over just the 1?

First of all, it is important to be clear what the $(S)$ variable needs to represent. My strategy involves computing $~D = S \times T,~$ and then computing the desired probability as $~\displaystyle \frac{1}{D}.$

Therefore, $S$ needs to represent the number of distinct MultiSets that can be formed from the $(26)$ letter alphabet, whose form is $\{A,A,A,A,B,B,C,C,D,E\}$.

Take a step back, and consider the following.

Suppose that you have any two sets, $F$ and $G$, each with a finite number of elements. Further suppose that there is a mapping $M:F \to G$, such that $M$ has the following properties:

  • $M$ is injective (i.e. $1$ to $1$).
    This means that if $f_1, f_2 \in F$, and $g \in G$, and if $M(f_1) = g = M(f_2)$, then $f_1 = f_2$.
    This is the definition of a mapping that is injective.

  • $M$ is surjective (i.e. onto).
    This means that for any element $g \in G$, there exists at least one element $f \in F$ such that $M(f) = g.$
    This is the definition of a mapping that is surjective.

Any mapping that is both surjective and injective is regarded as a mapping that is bijective (i.e. a bijection). An elementary result of Set Theory is that whenever you have two sets $F$ and $G$, each with a finite number of elements, that if any bijection from $F$ to $G$ exists, then $F$ and $G$ must have the same exact number of elements.


Now, consider my formation of Set-1, Set-2, Set-3 as described in Addendum-2. I am going to create a very unusual set $F$ that has a finite number of elements.

Each element $f$ of the set $F$ will have the following $3$ components:

  • The first component of the element $f$ will be a set with one letter of the alphabet. For example, $\{A\}$ is such a component.

  • The second component of the element $f$ will be a set with two different letters of the alphabet. Here, as a requirement of the second component, none of the letters in this component can match the letter in the first component of the element $f$.

  • The third component of the element $f$ will also be a set with two different letters of the alphabet. Here, as a requirement of the third component, none of the letters in this component can match any of the letters in either the first or second component of the element $f$.

Now, how many elements does the set $F$ have? If you examine the constraints on the $(3)$ components of an element $f$ in $F$, you will see that this corresponds to combining Set-1, Set-2, Set-3 into a single element.

That is, any two elements $f_1$ and $f_2$ in $F$ will be distinct if and only if any one of the three conditions below are satisfied:

  • The first component of $f_1$ is different from the first component of $f_2.$

  • The second component of $f_1$ is different from the second component of $f_2.$

  • The third component of $f_1$ is different from the third component of $f_2.$

So, to determine the number of elements in the set $F$, you have to determine how many different ways there are of forming Set-1, Set-2, and Set-3.

Based on your comment question, you agree that the set $F$ has $S$ elements in it, where

$$S = \binom{26}{1} \times \binom{25}{2} \times \binom{23}{2}.$$

Now, let $G$ denote the set, where every element $g$ in $G$ satisfies the following constraints:

  • The element $g$ is a Multiset of letters of the alphabet.

  • This Multiset has one letter that is repeated $(4)$ times, then two letters that are repeated twice each, and then two more letters that occur once each.

    That is, each element $g \in G$ has the form $\{A,A,A,A,B,B,C,C,D,E\}.$

I claim that the set $G$ has exactly the same number of elements as the set $F$. Assuming that this claim is true, this justifies my asserting that the number of elements in the set $G$ equals $S$.

If I am interpreting your comment question correctly, this is the specific issue that is in dispute. That is, how many elements are in the set $G$?

$\underline{\text{Proof of Claim}}$
Based on the discussion at the start of Addendum-3, it is sufficient to construct a mapping $M$, from the set $F$ to the set $G$, and then demonstrate that $M$ is a bijection.

That is, the existence of any such bijection, in and of itself, proves that $F$ and $G$ must each have the same number of elements.

First, I will illustrate how the mapping $M$ works, by example, and then I will prove that $M$ is a bijection.

Take any element $f$ of $F$, such that $f$ has the following components:

  • The first component of $f$ is the set $\{V\}$.

  • The second component of $f$ is the set $\{W,X\}.$

  • The third component of $f$ is the set $\{Y,Z\}.$

Then, $M(f) = g$, where $g \in G$ and $g$ equals the Multiset $\{V,V,V,V,W,W,X,X,Y,Z\}.$

So, as illustrated, $M$ does in fact map each element $f$ in $F$ to some element $g$ in $G$. Then:

  • Is $M$ injective?

  • Is $M$ surjective?

Suppose that there are two elements $f_1, f_2$ in $F$ and an element $g$ in $G$ such that $M(f_1) = g = M(f_2).$ For illustrative purposes, assume that the element $g$ is the MultiSet $\{V,V,V,V,W,W,X,X,Y,Z\}.$

Then, per the definition of the mapping $M$, when describing the components of $f_1$, because $M(f_1) = g$, you must have that the first, second, and third components of the element $f_1$ are $\{V\}, \{W,X\},$ and $\{Y,Z\}$, respectively.

Similarly, because $M(f_2) = g$, you must have that the first, second, and third components of the element $f_2$ are $\{V\}, \{W,X\},$ and $\{Y,Z\}$, respectively.

Therefore, $f_1$ and $f_2$ must be the exact same element in $F$. Therefore, the mapping $M$ must be injective.

Now, take any element $g$ in $G$. For illustrative purposes, suppose $g$ is the Multiset $\{V,V,V,V,W,W,X,X,Y,Z\}.$

Now, let $f$ be the specific element in $F$ whose first, second, and third components are $\{V\}, \{W,X\},$ and $\{Y,Z\}$, respectively.

Then $M(f) = g.$ Thus, the mapping $M$ is also surjective.

Therefore, the mapping $M$, being both injective and surjective, is a bijection. Therefore, since a bijection exists between the sets $F$ and $G$, these two sets must have the exact same number of elements.

Therefore, since the set $F$ has exactly $S$ elements, so does the set $G$.

user2661923
  • 42,303
  • 3
  • 21
  • 46
  • @TimothyJoseph You keep associating odds with the enumeration of the number of distinct Multisets. This is the wrong way to analyze the question. The correct way is to count the number of possible distinct Multisets of form ${A,A,A,A,B,B,C,C,D,E}$. I have asserted that there are exactly $$\binom{26}{1} \times \binom{25}{2} \times \binom{23}{2}$$ distinct such Multisets. Either my computation is accurate or it isn't. If you disagree with my computation, then please provide your own computation of how many such distinct Multisets that there are. Then, we can compare computations. – user2661923 Jul 10 '22 at 16:13
  • @TimothyJoseph In order to compute $D$, you have to compute the number of different possible Multisets, which I am referring to as $S$, and then compute the number of different ways of permuting each Multiset, which I am referring to as $T$. We agree on the computation of $T$ and apparently disagree on the computation of $S$. I am asserting that there are exactly $(1,973,400)$ such Multisets. How many Multisets do you think that there are? Suppose, for example, that the alphabet has $(6)$ letters, instead of $(26)$ letters. ...see next comment – user2661923 Jul 10 '22 at 17:03
  • @TimothyJoseph Can you manually determine how many ${A,A,A,A,B,B,C,C,D,E}$ such Multisets that there are, given a $(6)$ character alphabet? If you work through the smaller problem manually, this may stretch your intuition into understanding my computation of $S$, for the $(26)$ character alphabet. – user2661923 Jul 10 '22 at 17:03
0

There are $10$ places to put the first distinct letter, $9$ for the second, etc..

There are then $\binom53$ ways to place the triple letter, and then just $1$ way to place the double letter.

This gives $\frac{10!}{3!2!}=302,400$ in total.

To pick the letters, pick the triple, double and five uniques, from the $26$ available, which is $\frac{26!}{19!5!}=27,627,600$ (pick $7$ letters in order and then remove duplicates from the unique set).

So the final answer is $8,354,586,240,000$.

JMP
  • 22,637