There are 10 numbers, numbered A1 through A10. How many different ways can we arrange them if we need at least A1 and A2 in between A3 and A4?

1 Answer

#149,760#

Explanation:

Before diving into the details, let's set an upper limit on the answer. This will be the total number of ways we can arrange the 10 numbers, which is #10! = 3,628,800#. If we get an answer bigger than this, we know we've made a mistake.

The key is going to be in how we view this problem - with the proper set up it'll be more straightforward.

My approach will be this way:

  • we know that we need #A_1 and A_2# between #A_3 and A_4# in the arrangement of the 10 numbers, #A_1 - A_10#.
  • we can therefore look at two distinct areas - that area between #A_3 and A_4# and that area outside of them.
  • We can therefore figure out the number of ways to arrange the numbers between #A_3 and A_4#, the number of ways these numbers can be placed in the order of 10 digits, and the number of ways the remaining digits can be arranged, and then sum up each scenario.
  • this then is #"scenario"=("ordering" A_3, A_4)("ordering of numbers bounded by" A_3, A_4)("ordering of placement of area bounded by" A_3, A_4)("ordering of remaining digits")#
  • The first figure we'll need handy, therefore, is the number of ways to arrange #A_3 and A_4#, which is 2.
  • In all of these calculations, we'll need the permutations formula, which is #P_(n,k)=(n!)/((n-k)!); n="population", k="picks"#

No extra numbers

In this first scenario, there are no extra numbers between #A_3 and A_4# except for #A_1 and A_2#.

There are therefore 2 numbers bounded by #A_3 and A_4#, 4 numbers placed together, 7 places it can sit, and 6 remaining numbers:

#(2)(P_(2,2))(7)(P_(6,6))=2(2!)(7)(6!)=2(2)(7)(720)=20,160#

1 extra number

In this first scenario, there is one extra number between #A_3 and A_4#.

There are therefore 3 numbers bounded by #A_3 and A_4#, 5 numbers placed together, 6 places it can sit, and 5 remaining numbers

#(2)(P_(3,3))(6)(P_(5,5))=2(3!)(6)(5!)=2(6)(6)(120)=8640#

2 extra numbers

In this first scenario, there are 2 extra numbers between #A_3 and A_4#.

There are therefore 4 numbers bounded by #A_3 and A_4#, 6 numbers placed together, 5 places it can sit, and 4 remaining numbers

#(2)(P_(4,4))(5)(P_(4,4))=2(4!)(5)(4!)=2(24)(5)(24)=5760#

3 extra numbers

In this first scenario, there are 3 extra numbers between #A_3 and A_4#.

There are therefore 5 numbers bounded by #A_3 and A_4#, 7 numbers placed together, 4 places it can sit, and 3 remaining numbers

#(2)(P_(5,5))(4)(P_(3,3))=2(5!)(4)(3!)=2(120)(4)(6)=5760#

4 extra numbers

In this first scenario, there are 4 extra numbers between #A_3 and A_4#.

There are therefore 6 numbers bounded by #A_3 and A_4#, 8 numbers placed together, 3 places it can sit, and 2 remaining numbers

#(2)(P_(6,6))(3)(P_(2,2))=2(6!)(3)(2!)=2(720)(3)(2)=8640#

5 extra numbers

In this first scenario, there are 5 extra numbers between #A_3 and A_4#.

There are therefore 7 numbers bounded by #A_3 and A_4#, 9 numbers placed together, 2 places it can sit, and 1 remaining number

#(2)(P_(7,7))(2)(P_(1,1))=2(7!)(2)(1!)=2(5040)(2)(1)=20,160#

6 extra numbers

In this first scenario, there are 6 extra numbers between #A_3 and A_4#.

There are therefore 8 numbers bounded by #A_3 and A_4#, 10 numbers placed together, 1 place it can sit, and no remaining numbers

#(2)(P_(8,8))(1)(P_(0,0))=2(8!)(1)(1!)=2(40320)(1)(1)=80,640#

Let's now sum up the scenarios:

#20160+8640+5760+5760+8640+20160+80640=149,760#