1

The number of ternary strings of length 10 which contain exactly two 1s and exactly three 2s.

Would it be ${10\choose 2}+{10\choose 3}$?

Have I understood the concept of combinations? If I haven't, please do let me know where I went wrong, if you can, as I'm new to this. Thanks!

rainbow
  • 33

3 Answers3

6

In this case you would want to use multinomials, trinomials to be specific, i.e.

$$10! \over {2! 3! 5!} $$

How does one arrive at this formula? Always keep in mind when doing combinatorics the fundamental counting principle:

If there are $a$ ways for one event to occur, and $b$ ways for a second event to occur, then there are $ab$ ways for both to occur.

In this case, we have $3^{10}$ ways to find a ternary string with 10 characters. If we want exactly two of them to be ones, then we have $2^8$ ways to choose the remaining digits, and $10!$ ways to sort those 10 digits around.

However, we also want to have exactly three two's, hence we actually only have 1 way of choosing the remaining digits (2200000), and now the question becomes:

Given a total collection of 10 objects, how many distinguishable ways can we sort them around provided that we have one group of 2 objects, one group of 3 objects, and one group of five objects?

We get 10! ways when all 10 objects are distinguishable from each other: 10 choices for the first position, 9 choices for the second, ..., 1 choice for the last position.

However, we are assuming that 2 of the objects are indistinguishable from each other. There are 2! ways to permute these two objects, so that given any permutation of the 10 objects, it is a member of a set of 2! permutations which are indistinguishable, because these two objects are indistinguishable.

Hence, we have $10! \over 2!$ permutations which are distinguishable when we mark two of the objects as indistinguishable.

Given these permutations, if we mark another three objects as indistinguishable (the 2's in this case), we get by the same logic as above:

$$10! \over {2!3!}$$

distinguishable permutations. However, we have to keep in mind that the remaining five objects are also being implicitly grouped together (because any two 0's are identical), hence we have to apply the same logic once more to get:

$$10! \over {2!3!5!}$$

That explanation actually wasn't as clear as it was in my head, so please let me know if you have additional questions.

See also:

Multinomials

Permutations

Combinations

EDIT: additional references

Wikipedia - Multinomial Coefficients

Wolfram Alpha - Multinomial Coefficients

One Page Fact Sheet about Binomial and Multinomial Coefficients

Combinatorics from the Ground up: From Permutations to Multinomial Coefficients and Beyond

Simple and Intuitive Examples of Multinomial Coefficients

Chill2Macht
  • 20,920
  • So it's a permutation? Sorry, I'm really new to this and it's kinda hard to comprehend at first. – rainbow May 01 '16 at 04:02
  • Yes essentially, although you can also think of it as a trinomial, the number of ways to select one group of 3 objects and one group of 2 objects from a collection of 10 objects (and de facto a third group 10-3-2=5 objects as well). A binomial, in contrast, would be the number of ways to select one group of x objects from a collection of y objects (and de facto a second group of (y-x) objects). If you want to specify the objects not chosen as being indistinguishable, then you have to account for that, which is what the last factor in the denominator of any multinomial coefficient does. – Chill2Macht May 01 '16 at 04:10
  • 1
    I recommend reading this: https://en.wikipedia.org/wiki/Binomial_coefficient#Generalization_to_multinomials. "The combinatorial interpretation of multinomial coefficients is distribution of n distinguishable elements over r (distinguishable) containers, each containing exactly $k_i$ elements, where i is the index of the container", i goes from 1 to r. See also: http://mathworld.wolfram.com/MultinomialCoefficient.html, or http://www.math.uiuc.edu/~hildebr/461/binomial.pdf, http://www.seas.upenn.edu/~jean/cis160/cis260slides6.pdf, http://www.maths.usyd.edu.au/u/don/courses/math1904/lect08.pdf – Chill2Macht May 01 '16 at 04:15
  • I'll put these in the answer for better legibility -- hopefully these help you. – Chill2Macht May 01 '16 at 04:16
  • Alright, thank you very much! It's becoming clearer now. :) – rainbow May 01 '16 at 05:39
4

If a ternary string of length $10$ contains exactly two $1$'s and exactly three $2$'s, it must contain exactly five $0$'s. We must choose two positions for the $1$'s, two of the remaining eight positions for the $2$'s, and all five of the remaining positions for the five $0$'s. $$\binom{10}{2}\binom{8}{3}\binom{5}{5} = \frac{10!}{2!8!} \cdot \frac{8!}{3!5!} \cdot \frac{5!}{5!0!} = \frac{10!}{2!3!5!}$$ The reason that we multiply is that for each of the $\binom{10}{2}$ ways we can select the positions of the two $1$'s, we can select the positions of the three $2$'s in $\binom{8}{3}$ ways.

We add when two events are mutually exclusive, which is not the case here since it is possible to have a ternary string of length $10$ that has both exactly two $1$'s and exactly three $2$'s.

N. F. Taussig
  • 76,571
2

What you do is start with the total number of combinations, in this case 10 numbers (two 1s, three 2s, and five 0s) give you 10!

No you divide by the non-unique positions: one 0 followed by another 0 is exactly the same as if you did the "second" 0 first and then the "first" one. When you have two of the same number, then there are 2! total combinations (first zero second zero, second zero first zero) for each unique combination (two zeroes).

In your specific example

  • two 1s mean that there are 2! total combinations for each unique combination
  • three 2s mean that there are 3! total combinations for each unique combination
  • five 0s mean that there are 5! total combinations for each unique combination

This gives you [unique combinations] * 2! * 3! * 5! = 10! total combinations.