Ascending and Descending

There are cards numbered 1 to 9 lying on a table. It is known that they can be arranged in 9 ! 9! ways in a line. In how many ways can these cards be arranged (in a line) so that there are no 4 cards that are in ascending or descending order?

Example: In the sequence of numbers 3-2-1-6-5-4-9-8-7, there are no 4 cards in either ascending or descending order (from left to right).

Details and assumptions:

  1. The 4 cards need not be adjacent to each other.
  2. The numbers are read from left to right in the line.
  3. Source: numberphile


The answer is 1764.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Jon Haussmann
Jun 1, 2014

We can solve this problem by applying some fairly advanced (but well-established) results in combinatorics.

First, we'll introduce the Young diagram (also known as a Ferrers diagram). Here is an example of a Young diagram:

http://upload.wikimedia.org/wikipedia/commons/f/f2/Young<em>diagram</em>for<em>541</em>partition.svg http://upload.wikimedia.org/wikipedia/commons/f/f2/Young diagram for 541 partition.svg

A Young diagram consists of a number of rows of squares, where the rows are left-justified, and the number of squares in each row is less than or equal to the number of squares in the row above it. When we fill in the squares with numbers (from 1 to n n , where n n is the number of squares) a certain way, we get a Young tableau:

http://upload.wikimedia.org/wikipedia/commons/4/40/Young<em>tableaux</em>for<em>541</em>partition.svg http://upload.wikimedia.org/wikipedia/commons/4/40/Young tableaux for 541 partition.svg

We fill in the squares so that the numbers are increasing in each row from left to right, and increasing in each column from top to bottom.

We are interested in Young tableau because of the Robinson-Schensted correspondence . Part of the RS correspondence is an algorithm that takes a permutation and generates an ordered pair of Young tableau which have the same shape. (Also, the number of squares in the Young tableau is equal to the number of elements in the permutation.)

For example, the permutation 3, 8, 1, 2, 4, 7, 5, 6 of the numbers from 1 to 8 produces the Young tableau

1 2 4 5 6 1 2 5 6 8 3 7 and 3 4 8 7 \begin{array}{ccccccccccc} 1 & 2 & 4 & 5 & 6 & & 1 & 2 & 5 & 6 & 8 \\ 3 & 7 & & & & \text{and} & 3 & 4 & & & \\ 8 & & & & & & 7 & & & & \end{array}

As the name suggests, this gives us a bijection, i.e. given an ordered pair of Young tableau that have the same shape, we can recover the original permutation.

Here are the key properties of the RS correspondence which are relevant for this problem:

  • The longest increasing subsequence in the permutation is equal to the length of the first row of the Young tableau

  • The longest decreasing subsequence in the permutation is equal to the length of the first column of the Young tableau

In the permutation 3, 8, 1, 2, 4, 7, 5, 6, the longest increasing subsequence is 1, 2, 4, 5, 6, and the longest decreasing subsequence is 8, 7, 6, so the length of the first row is 5 and the length of the first column is 3, as expected.

Consider a permutation as described in the problem. Then the length of the first row will be at most 3, and the length of the first column will be at most 3. But there are a total of 9 elements, which means the shape of the Young tableau must be a 3 × 3 3 \times 3 grid. Therefore, the number of permutations we seek is k 2 k^2 , where k k is the number of ways we can fill a 3 × 3 3 \times 3 Young diagram.

So the problem reduces to finding the number of ways we can fill a 3 × 3 3 \times 3 Young diagram. It turns out that there is a handy and simple formula for this, known as the hook length formula . By the hook length formula, k = 9 ! 5 4 3 4 3 2 3 2 1 = 42 , k = \frac{9!}{5 \cdot 4 \cdot 3 \cdot 4 \cdot 3 \cdot 2 \cdot 3 \cdot 2 \cdot 1} = 42, so the answer is k 2 = 4 2 2 = 1764 k^2 = 42^2 = 1764 .

[Notifying @starwar clone .]

Thanks a bunch jon ! This is amazing.

Hungry Cap - 6 years, 11 months ago

Thank you Jon

Ujjwal Mani Tripathi - 7 years ago

thats very long!!!! use pegion hole

Anubhav Singh - 7 years ago

Log in to reply

Then why don't you post your solution? Just saying "use Pigeonhole" is not very enlightening.

Jon Haussmann - 7 years ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...