Problem

Source: Mathematics Regional Olympiad of Mexico Northeast 2017 P5

Tags: combinatorics



The figure shows a $2\times 2$ grid that has been filled with the numbers $a, b, c$, and $d$. We say that this grid is ordered if it is true that $a > b > c > d$ or that $a > d > c > b$. $\begin{tabular}{|l|l|} \hline a & b \\ \hline d & c \\ \hline \end{tabular}$ In how many ways can the numbers from $1$ to $1000$ be arranged in the cells of a $2 \times 500$ grid ($2$ rows and $500$ columns) so that each $2 \times 2$ sub-grid is ordered?