https://github.com/willf/sitting-in-your-seat-plane-simulation
Simulation of 538 "Will Someone Be Sitting In Your Seat On The Plane?" riddle
https://github.com/willf/sitting-in-your-seat-plane-simulation
Last synced: 8 months ago
JSON representation
Simulation of 538 "Will Someone Be Sitting In Your Seat On The Plane?" riddle
- Host: GitHub
- URL: https://github.com/willf/sitting-in-your-seat-plane-simulation
- Owner: willf
- License: mit
- Created: 2016-02-20T02:00:42.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-08-23T15:57:32.000Z (almost 3 years ago)
- Last Synced: 2025-09-13T12:12:43.030Z (9 months ago)
- Language: Python
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sitting-in-your-seat-plane-simulation
Simulation of 538 "[Will Someone Be Sitting In Your Seat On The Plane?](http://fivethirtyeight.com/features/will-someone-be-sitting-in-your-seat-on-the-plane/)" riddle
The Riddle:
There’s an airplane with 100 seats, and there are 100 ticketed passengers each with an assigned seat.
They line up to board in some random order. However, the first person to board is the worst person alive,
and just sits in a random seat, without even looking at his boarding pass. Each subsequent passenger
sits in his or her own assigned seat if it’s empty, but sits in a random open seat
if the assigned seat is occupied. What is the probability that you,
the hundredth passenger to board, finds your seat unoccupied?
Based on lots of runs, it's around 50%.
This is invariant in the number of passengers (for n > 1).