Monte Carlo and Airplane Seating

An airplane with n seats is fully booked, and every passenger has been assigned a specific seat. However, the first passenger to board ignores their assignment and chooses a seat at random. The second and all subsequent passengers sit in their assigned seat if it is unoccupied when they board. Otherwise, they choose an empty seat at random. What is the probability that the kth passenger gets their assigned seat?

I created a C++ program that simulates the above process and finds the approximate probability for each passenger. The program is up at my GitHub.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s