There are n passengers boarding an airplane with exactly n seats. Each passenger has a ticket corresponding to a specific seat.
The first passenger loses their ticket and chooses a seat uniformly at random among all available seats. Every subsequent passenger boards the plane and will:
Sit in their assigned seat if it is still unoccupied.
Pick an unoccupied seat uniformly at random if their assigned seat has already been taken.
Return the probability that the
Constraints:
n
There are n passengers boarding an airplane with exactly n seats. Each passenger has a ticket corresponding to a specific seat.
The first passenger loses their ticket and chooses a seat uniformly at random among all available seats. Every subsequent passenger boards the plane and will:
Sit in their assigned seat if it is still unoccupied.
Pick an unoccupied seat uniformly at random if their assigned seat has already been taken.
Return the probability that the
Constraints:
n