How many unique 4 character permutations are there for the following string? abcd

As Gerry Myerson pointed out, what you are asking is equivalent to asking how many solutions there are to the equation $$x_1 + x_2 + x_3 + x_4 = 4$$ in the non-negative integers, where $x_1$ represents the number of $a$'s in the string, $x_2$ represents the number of $b$'s, $x_3$ represents the number of $c$'s, and $x_4$ represents the number of $d$'s. The number of solutions of this equation is the number of ways we can insert three addition signs in a list of four ones. For instance, $$1 1 + + 1 + 1$$ corresponds to the solution $x_1 = 2$, $x_2 = 0$, $x_3 = 1$, and $x_4 = 1$, while $$+ 1 + 1 + 1 1$$ corresponds to the solution $x_1 = 0$, $x_2 = 1$, $x_3 = 1$, and $x_4 = 2$. The number of solutions is thus the number of ways of selecting three addition signs from $4 + 3 = 7$ symbols, which is $$\binom{4 + 3}{3} = 35$$ Using similar reasoning, you can show that the number of solutions of the equation $$x_1 + x_2 + \cdots + x_k = n$$ in the non-negative integers is $$\binom{n + k - 1}{k - 1}$$

The number of ways of arranging n unlike objects in a line is n! (pronounced ‘n factorial’). n! = n × (n – 1) × (n – 2) ×…× 3 × 2 × 1

Example

How many different ways can the letters P, Q, R, S be arranged?

The answer is 4! = 24.

This is because there are four spaces to be filled: _, _, _, _

The first space can be filled by any one of the four letters. The second space can be filled by any of the remaining 3 letters. The third space can be filled by any of the 2 remaining letters and the final space must be filled by the one remaining letter. The total number of possible arrangements is therefore 4 × 3 × 2 × 1 = 4!

  • The number of ways of arranging n objects, of which p of one type are alike, q of a second type are alike, r of a third type are alike, etc is:

n!        .
p! q! r! …

Example

In how many ways can the letters in the word: STATISTICS be arranged?

There are 3 S’s, 2 I’s and 3 T’s in this word, therefore, the number of ways of arranging the letters are:

10!=50 400
3! 2! 3!

Rings and Roundabouts

  • The number of ways of arranging n unlike objects in a ring when clockwise and anticlockwise arrangements are different is (n – 1)!

When clockwise and anti-clockwise arrangements are the same, the number of ways is ½ (n – 1)!

Example

Ten people go to a party. How many different ways can they be seated?

Anti-clockwise and clockwise arrangements are the same. Therefore, the total number of ways is ½ (10-1)! = 181 440

Combinations

The number of ways of selecting r objects from n unlike objects is:

How many unique 4 character permutations are there for the following string? abcd

Example

There are 10 balls in a bag numbered from 1 to 10. Three balls are selected at random. How many different ways are there of selecting the three balls?

10C3 =10!=10 × 9 × 8= 120
             3! (10 – 3)!3 × 2 × 1

Permutations

A permutation is an ordered arrangement.

  • The number of ordered arrangements of r objects taken from n unlike objects is:

nPr =       n!       .
          (n – r)!

Example

In the Match of the Day’s goal of the month competition, you had to pick the top 3 goals out of 10. Since the order is important, it is the permutation formula which we use.

10P3 =10!
            7!

= 720

There are therefore 720 different ways of picking the top three goals.

Probability

The above facts can be used to help solve problems in probability.

Example

In the National Lottery, 6 numbers are chosen from 49. You win if the 6 balls you pick match the six balls selected by the machine. What is the probability of winning the National Lottery?

The number of ways of choosing 6 numbers from 49 is 49C6 = 13 983 816 .

Therefore the probability of winning the lottery is 1/13983816 = 0.000 000 071 5 (3sf), which is about a 1 in 14 million chance.

Remember what it means for a function to be bijective: each element in the codomain must be the image of exactly one element of the domain. Using two-line notation, we could write one of these bijections as

\begin{equation*} f = \twoline{1 \amp 2 \amp 3 \amp 4 \amp 5 \amp 6 \amp 7 \amp 8} {3 \amp 1 \amp 5 \amp 8 \amp 7 \amp 6 \amp 2 \amp 4} \end{equation*}

What we are really doing is just rearranging the elements of the codomain, so we are creating a permutation of 8 elements. In fact, “permutation” is another term used to describe bijective functions from a finite set to itself.

If you believe this, then you see the answer must be \(8! = 8 \cdot 7 \cdot\cdots\cdot 1 = 40320\text{.}\) You can see this directly as well: for each element of the domain, we must pick a distinct element of the codomain to map to. There are 8 choices for where to send 1, then 7 choices for where to send 2, and so on. We multiply using the multiplicative principle.

Example1.3.5

You decide to have a dinner party. Even though you are incredibly popular and have 14 different friends, you only have enough chairs to invite 6 of them.

  1. How many choices do you have for which 6 friends to invite?

  2. What if you need to decide not only which friends to invite but also where to seat them along your long table? How many choices do you have then?

Solution

  1. You must simply choose 6 friends from a group of 14. This can be done in \({14 \choose 6}\) ways. We can find this number either by using Pascal's triangle or the closed formula: \(\frac{14!}{8!\cdot 6!} = 3003\text{.}\)

  2. Here you must count all the ways you can permute 6 friends chosen from a group of 14. So the answer is \(P(14, 6)\text{,}\) which can be calculated as \(\frac{14!}{8!} = 2192190\text{.}\)

    Notice that we can think of this counting problem as a question about counting functions: how many injective functions are there from your set of 6 chairs to your set of 14 friends (the functions are injective because you can't have a single chair go to two of your friends).

How are these numbers related? Notice that \(P(14,6)\) is much larger than \({14 \choose 6}\text{.}\) This makes sense. \({14 \choose 6}\) picks 6 friends, but \(P(14,6)\) arranges the 6 friends as well as picks them. In fact, we can say exactly how much larger \(P(14,6)\) is. In both counting problems we choose 6 out of 14 friends. For the first one, we stop there, at 3003 ways. But for the second counting problem, each of those 3003 choices of 6 friends can be arranged in exactly \(6!\) ways. So now we have \(3003\cdot 6!\) choices and that is exactly \(2192190\text{.}\)

Alternatively, look at the first problem another way. We want to select 6 out of 14 friends, but we do not care about the order they are selected in. To select 6 out of 14 friends, we might try this:

\begin{equation*} 14 \cdot 13 \cdot 12 \cdot 11 \cdot 10 \cdot 9. \end{equation*}

This is a reasonable guess, since we have 14 choices for the first guest, then 13 for the second, and so on. But the guess is wrong (in fact, that product is exactly \(2192190 = P(14,6)\)). It distinguishes between the different orders in which we could invite the guests. To correct for this, we could divide by the number of different arrangements of the 6 guests (so that all of these would count as just one outcome). There are precisely \(6!\) ways to arrange 6 guests, so the correct answer to the first question is

\begin{equation*} \frac{14 \cdot 13 \cdot 12 \cdot 11\cdot 10 \cdot 9}{6!}. \end{equation*}

Note that another way to write this is

\begin{equation*} \frac{14!}{8!\cdot 6!}. \end{equation*}

which is what we had originally.

6

How many of the quadrilaterals possible in the previous problem are:

  1. Squares?

  2. Rectangles?

  3. Parallelograms?

  4. Trapezoids? 2 Here, as in calculus, a trapezoid is defined as a quadrilateral with at least one pair of parallel sides. In particular, parallelograms are trapezoids.

  5. Trapezoids that are not parallelograms?

Solution

  1. 5 squares. You need to skip exactly one dot on the top and on the bottom to make the side lengths equal. Once you pick a dot on the top, the other three dots are determined.

  2. \({7 \choose 2}\) rectangles. Once you select the two dots on the top, the bottom two are determined.
  3. This is tricky since you need to worry about running out of space. One way to count: break into cases by the location of the top left corner. You get \({7 \choose 2} + ({7 \choose 2}-1) + ({7 \choose 2} - 3) + ({7 \choose 2} - 6) + ({7 \choose 2} - 10) + ({7 \choose 2} - 15) = 91\) parallelograms.

  4. All of them

  5. \({7\choose 2}{7\choose 2} - \left[ {7 \choose 2} + ({7 \choose 2}-1) + ({7 \choose 2} - 3) + ({7 \choose 2} - 6) + ({7 \choose 2} - 10) + ({7 \choose 2} - 15) \right]\text{.}\) All of them, except the parallelograms.

    How many combinations of 4 letters are possible from the letters abcd?

    The answer is 360.

    How many permutations are there of ABCD?

    Total possible arrangement of letters a b c d is 24.

    How many unique combinations of 4 characters are there?

    The number of possible combinations that are possible with 4 letters is 14,950. The alphabet contains 26 letters total, and we want to know how many combinations of 4 letters we can make from those 26 letters.

    How many permutations of 4 different letters are there?

    Assume non-sensical words count, i.e. "dnts" would count as a 4-letter word for our purposes. Explanation: This is a permutation of 26 letters taken 4 at a time. To compute this we multiply 26 * 25 * 24 * 23 = 358,800.