Probability when arranging $N$ different numbers in a line

140 Views Asked by At

we would like to arrange the numbers: $ 1, 2, \ldots , N$ in a line.

  1. what is the probability that digits $1, 2$ are not arranged next to each other?

  2. what is the probability that digits $1, 2$ are not arranged next to each other, and also the digits $3, 4$ are arranged next to each other?

my attempt:

This is mostly a combinatorics question, as the "Probability", meaning: $$\Omega = N!$$

  1. I treated $1, 2$ as a unit, looking for the number of different ways to arrange them next to each other - which would be the Complementary event. $$P(A)^C = \frac{(N-1)! \cdot 2 }{N!}$$ where there's in fact $N-1$ needed to be arranged, ans 2 is the number of permutations.

so that $$P(A) = 1- \frac{(N-1)! \cdot 2 }{N!} = 1 - \frac{2}{N}$$

for the second sections - I'm not sure. suppose I'd be looking the number of different ways to arrange $1, 2, \ldots N$ in a line so that the digits $1, 2$ and $ 3, 4$ are always arranged next to each other, then that will be: $$\frac{(N-2)! \cdot 2 \cdot 2}{N!}$$ where 4 is the number of permutations (2 for each unit of digits) but does that mean that there's $$\left(N! - {(N-2)! \cdot 2 \cdot 2}\right) \cdot \left((N-2)! \cdot 2 \right)$$ ways to arrange the numbers?

that doesn't seem right.

4

There are 4 best solutions below

1
On

Regardless of the other numbers in the list, there are $2(N-1)$ ways to position $1$ and $2$ next to each other in a list of size $N$. Assume they take the first position, then you have to sort the other $N-2$ values into a list of size $N-2$. Thus we have that the total ways of satisfying the question is: $$2(N-1)\cdot (N-2)!=2(N-1)! $$

The probability follows nicely from this, it is $$\frac{2(N-1)!}{N!}=\frac 2N $$

This approach should also work for (b).

0
On

The number of ways that $1$ and $2$ appear next to each other can be calculated by considering both the numbers as a single unit. So the packets will be $$ (1,2),(3),(4),(5) ....... (N) $$ Number of ways these can be arranged are $(N-1)!$ as there are $(N-1)$ packets. To consider the backward and forward arrangement of 1 and 2 inside the packet we need to multiply by two. So,
Total ways for 1 and 2 to be arranged together is $2(N-1)!$

So the numerator will be (Total ways-Undesired ways). $$N! - 2(N-1)!$$.
Divide this with the total ways we get $$\frac{N! - 2(N-1)!}{N!} = 1 - \frac 2N$$

For the second part we consider one packet with 1 and 2. The other packet with 3 and 4. So the packets will be,$$ (1,2),(3,4),(5),(6),(7) ....... (N) $$

Arrangements in which 1 and 2 are together(like the first part) are $P(X)=2.(N-1)!$
Arrangements in which 3 and 4 are together are $P(Y)=2.(N-1)!$
Arrangements in which both groups (1 and 2) and (3 and 4) are together are $P(Z)=2.2.(N-2)!$. The two packets have an internal arrangement of two ways and the total count of packets is $(N-2)!$

The numerator in the second part is $N! - P(X) - P(Y) + P(Z)$. The denominator will be $N!$

0
On

Your work on the first part shows there are $2(N-1)!$ ways to arrange the numbers with $3,4$ next to each other. $4(N-2)!$ of those have $3,4$ at one end or the other. If they are at either end you are left with $N-2$ places and have to avoid $1,2$ next to each other, which happens $\frac 2{N-2}$ of the time, so this gives $8(N-3)!$ arrangements wwith $3,4$ together at one end and $1,2$ apart. For the $3,4$ are together somewhere in the middle, there are $(2(N-1)-4)(N-2)!=2(N-3)(N-2)!$ arrangements. There are $N-4$ positions that can be the leftmost of the $1,2$, then $2$ ways to arrange $1,2$, and $(N-4)!$ ways to arrange the rest of the numbers, so there are $2(N-4)(N-4)!$ arrangements with $3,4$ together in the middle and $1,2$ apart.

The chance is then $$\frac {8(N-3)!+2(N-4)(N-4)!}{N!}=\frac {(10N-36)(N-4)!}{N!}$$

0
On

Your answer to the first question is correct.

If the integers $1, 2, 3, \ldots, N$ are arranged in a line, what is the probability that the numbers $3$ and $4$ are arranged next to each other but the numbers $1$ and $2$ are not arranged next to each other.

As you observed, there are $N!$ ways to arrange the numbers in a row.

For the favorable cases, we begin by placing the numbers $3$ and $4$ in a box and arranging the $N - 3$ objects consisting of the box and the $N - 4$ numbers larger than $4$ in a row. The objects can be arranged in $(N - 3)!$ ways. Doing so creates $N - 2$ spaces in which we can place the $1$ and $2$, $N - 4$ between successive objects and two at the ends of the row.
$$\square \boxed{3, 4} \square 5 \square 6 \square \ldots \square N - 1 \square N \square$$ To separate $1$ and $2$, we must place them in two of these $N - 2$ spaces. There are $N - 2$ ways to place $1$, which leaves $N - 3$ ways to place $2$. The numbers $3$ and $4$ can be arranged within the box in $2!$ ways. Hence, the number of arrangements of the $N$ positive integers $1, 2, 3, \ldots, N$ in which $3$ and $4$ are next to each other but $1$ and $2$ are not next to each other is $$(N - 3)!2!(N - 2)(N - 3) = (N - 2)!2!(N - 3)$$ Therefore, the probability that $3$ and $4$ are next to each other but $1$ and $2$ are not next to each other is $$\frac{(N - 2)!2!(N - 3)}{N!}$$