1

With how many ways can we arrange the digits $1,2, \dots, 9$,so that $1$ precedes $2$ and $2$ precedes $3$? Also,with how many ways can we arrange these digits,so that between $1$ and $2$ there are three digits?

evinda
  • 7,823
  • For the first one, how many ways can you arrange the other six digits? Now think about 1, 2 and 3. – Paul Apr 25 '14 at 16:22

4 Answers4

5

Take a random permutation of our $9$ numbers, with all permutations equally likely.

The probability that $1$, $2$, and $3$ will be in that (relative) order is $\frac{1}{3!}$. So if $N$ is the number of permutations of the $9$ numbers in which $1,2,3$ are in that relative order, we have $$\frac{N}{9!}=\frac{1}{3!}.$$ Now we know $N$.

The second problem is ambiguous, since it is not clear whether $1,2,3$ are to be in that relative order. We assume first that the problem is a separate one.

Then the leftmost of $1$ or $2$ can be in any one of $5$ places. Whether that place is occupied by $1$ or $2$ can be chosen in $2$ ways, and the rest of the slots can be filled in $7!$ ways, for a total of $(5)(2)(7!)$.

If we assume that the condition about the ordering of $1,2,3$ must be respected, draw a little diagram, putting down $9$ slots. If $1$ is in slot $1$, then $3$ has $4$ places it can go. If $1$ is in slot $2$, then $3$ has $3$ places to go, and so on. That fives $4+3+2+1$ ways to place $1,2,3$. For each of these ways, the remaining slots can be filled in $6!$ ways.

André Nicolas
  • 507,029
  • Why is the propability that $1,2 \text{ and } 3$ will be in that order $\frac{1}{3!}$ ? – evinda Apr 25 '14 at 17:05
  • Because all relative orders are equally likely, since we are dealing with a random permutation. – André Nicolas Apr 25 '14 at 17:08
  • At the second question,the condition of the first one isn't required to be satisfied!!! – evinda Apr 25 '14 at 17:36
  • That's OK, I solved it first assuming the condition need not be satisfied, and then assuming it needs to be satisfied. – André Nicolas Apr 25 '14 at 17:42
  • Why i it $(5)(2)(7!)$?

    Why do we have to multiply with $2$?

    – evinda Apr 25 '14 at 17:46
  • 1
    It says "between $1$ and $2$." There is some ambiguity here. If we interpret it as meaning that in particular $1$ comes before $2$, then we should not multiply by $2$. But if we interpret it as meaning that $1$ could be to the right of $2$, we do have to multiply, because we have a choice. If it were people, and it said there are exactly $3$ people between Alicia and Beti, I would not assume Alicia is to the left of Beti. – André Nicolas Apr 25 '14 at 17:51
  • A ok!!Thanks a lot!!! – evinda Apr 25 '14 at 17:55
  • 1
    You are welcome. If the original problem was clearly separated into parts, then there would be less ambiguity. But when the second question is part of the same paragraph as the first, the issue of "spillover" arises. – André Nicolas Apr 25 '14 at 18:12
2

For the first part I'm guessing you meant "2 precedes 3" and not "2 proceeds 3" as those are very different.

I'll show some patterns. The $1$ and $2$ will be shown, then the possible positions of $3$ will be $c$. Any other number will be $x$. These will then show how many ways $3$ can be placed after an equals sign. $$12ccccccc = 7$$ $$1x2cccccc = 6$$ $$1xx2ccccc = 5$$

and so on.

$$x12cccccc = 6$$ $$x1x2ccccc = 5$$ $$x1xx2cccc = 4$$

You get the idea. This goes until

$$xxxxx12cc = 2$$ $$xxxxx1x2c = 1$$ $$xxxxxx123 = 1$$

So we have $$\left(7+6+5+\ldots+1\right)+\left(6+5+4+\ldots+1\right)+\ldots+\left(2+1\right)+\left(1\right)$$

This is the same as $$7\cdot1+6\cdot2+5\cdot3+4\cdot4+3\cdot5+2\cdot6+1\cdot7$$

Which is the same as $$\sum_{i=1}^{7}(8-i)i = 84$$

Another way to think of it is $$\frac{7\cdot8}{2}+\frac{6\cdot7}{2}+\frac{5\cdot6}{2}+\ldots+\frac{2\cdot3}{2}+\frac{1\cdot2}{2} = \sum_{i=1}^{7}\frac{n(n+1)}{2} = 84$$

So there are $84$ ways to arrange the $1$, $2$, and $3$. So now you need to arrange the others around them. $6$ digits remain, so there are $6!$ ways to do it. $$84\cdot6!=60480$$

Note that this is WAY more complicated than some of the other solutions posted. I just wanted to show an alternate way of doing things.

For the second part, you have three digits between $1$ and $2$, giving you $1xxx2$. This arrangement is then shifted along the line of numbers. With a length of 5, that gives $$9-5+1=5$$ places this arrangement can go, the $9$ coming from the total length of the digit string. However that's for $1xxx2$. We can have $2xxx1$ and that would still count as 3 digits between $1$ and $2$. How many ways can we arrange those? $2\choose{1}$, which is $2$.

$$5\cdot\binom{2}{1}=10$$

For each of these, there are $7$ other digits to be placed, so that gives you $7!$ $$10\cdot7! = 50400$$

RandomUser
  • 1,275
  • I understood the first part of the exercise..But could you explain me further the second one? – evinda Apr 25 '14 at 17:27
  • 1
    You have the 1, 3 of something not 2, then the 2. There are 5 ways to do this. 1xxx2xxxx, x1xxx2xxx, xx1xxx2xx, xxx1xxx2x and xxxx1xxx2. Rather than working out all of those, you get the length of the arrangement (5), and figure out how many positions it will fit in the total length (9). That's the calculation above. So you have 5 ways you can put the 1 and 2. How many ways can you place the other 7 numbers? $7!$. You can insert those $7!$ arrangements each into the 5 1xxx2 arrangements, so you multiply them to get the total. – RandomUser Apr 25 '14 at 17:41
  • 1
    @evinda Note that I forgot to account for 2xxx1 arrangements. Those would double the original amount. I've edited my answer to fix that. – RandomUser Apr 25 '14 at 17:44
  • Great!!!I understand..Than you very much!!! – evinda Apr 25 '14 at 17:55
2

The first

Choose three places out of $9$ to put $1,2,3$ at. Then scramble the other six digits and put them into the remaining places. This can be done in $$ \binom{9}{3}\cdot 6!=60480\text{ ways} $$

The second

The digit $1$ has to go in one of the first five places otherwise there is no room for three digits and a $2$. For each such choice scramble the other seven digits and fill them in. This makes $$ 5\cdot 7!=25200\text{ ways} $$

Edit

Having read André Nicolas answer I just realized that I misread the second question. Since $1$ and $2$ may be interchanged the answer will we twice as big. so $50400$ ways it is.

String
  • 18,395
  • At the first part of the exercise,when we use: $\binom{9}{3}$ do we know that $1$ precedes $2$ and $2$ precedes $3$ ? – evinda Apr 25 '14 at 16:59
  • @evinda: Yes! The figure $\binom{9}{3}$ denotes the number of ways to choose three places out of $9$. Each time three places have been chosen we fill in $1,2$ and $3$ in that order to these places. This ensures the order of $1,2$ and $3$. – String Apr 25 '14 at 17:09
  • Ok...I understood the first part of the exercise..But could you explain me further the second one,now that you have edited it? – evinda Apr 25 '14 at 17:28
1

For the first one, there are 9!/3!=60480 ways to arrange the other 6 numbers. The numbers 1,2 and 3 can now only go in one way for each of these permutations. So the total is 60480.

Paul
  • 1,482
  • Could you explain it further to me? – evinda Apr 25 '14 at 17:01
  • Take the other 6 numbers (not the 1, 2, 3). These can be placed in any order. There are 9 places for the first number, 8 for the second down to 4 for the 6th number. This gives 98...*4 = 9!/3! possibilities. Whatever the arrangement of the 6 numbers the 1, 2 and 3 can now only go in one way in the 3 spaces left. This does not increase the possible arrangements of all 9 numbers. – Paul Apr 26 '14 at 12:19