MathDB
ways of n passengers in a line, waiting to board a plane with n seats

Source: Canada Repêchage 2019/7 CMOQR

March 2, 2020
combinatorics

Problem Statement

There are nn passengers in a line, waiting to board a plane with nn seats. For 1kn1 \le k \le n, the kthk^{th} passenger in line has a ticket for the kthk^{th} seat. However, the rst passenger ignores his ticket, and decides to sit in a seat at random. Thereafter, each passenger sits as follows: If his/her assigned is empty, then he/she sits in it. Otherwise, he/she sits in an empty seat at random. How many different ways can all nn passengers be seated?