Saayed Alam

Hotel Reservations Project

You recently invested in a small hotel in NYC. The hotel has 50 rooms. Historically 20% of customers cancel their bookings prior to arrival. While occasionally your hotel can find a last minute customer to compensate for a cancellation, often the rooms simply go vacant. In order to hedge against this loss in revenue, you are considering adopting an overbooking policy. But before doing so, you want to assess the risk and reward of overbooking.

Construct a simulation model for the occupancy of your hotel. Assume you receive exactly 50 reservations, but some of those 50 reservations are canceled randomly. The probability that any given reservation is canceled is 0.20, independent of each other. Simulate these cancellations and compute the number of customers who show up on a single simulated night.

reserve = 50  # Number of reservations
p = 0.2  # Probability of random cancellation
reserve - sum(runif(reserve) < p)  # The number of customers show up on a single simulated night
## [1] 45

Use your simulation model in part (1) to simulate 106 nights of operation of your hotel. Estimate the average occupancy (average number of guests staying at the hotel) and the probability that the hotel is full.

show <- function(reserve, p) {
    return(reserve - sum(runif(reserve < p)))
}
sample <- replicate(1e+06, show(reserve, p))  # Sample for number of customers that show up on a million simulated nights
occupancy <- mean(sample)  # Average number of guests staying at the hotel
sum(sample == reserve)  # Frequency of hotel being booked
## [1] 1000000
mean(sample == reserve)  # Relative frequency of the hotel is full
## [1] 1

Now consider overbooking your hotel by 1 room. That is, suppose you now accept 51 reservations as a hedge against cancellations, knowing that there is some chance a customer might have to be refused a room if all 51 reservations arrive. Simulate 106 nights of operation of your hotel with this new overbooking policy. What is the average occupancy in this case (average number of guests staying at the hotel)? What is the average number of customers per night who were refused a room because of overbooking?

reserve = 51  # Overbooking hotel by 1 room
rooms = 50  # Number of rooms 
sample <- replicate(1e+06, show(reserve, p))  # Sample for number of customers that show up on a million simulated nights
occupancy <- mean(sample)  # Average number of guests staying at the hotel
mean(sample >= reserve)  # Relative frequency of the hotel is full
## [1] 1
mean(sample > rooms)  # Average number of nights with more reservations than room
## [1] 1
sample_refused = pmax(0, sample - rooms)
mean(sample_refused)  # Average number customers per night who were refused a room because of overbooking
## [1] 1

Repeat your analysis from (3) when you overbook by 2, 3, 4, 5, 6, 7, 8, 9, 10 rooms. Provide plots of the average occupancy and average number of customers per night who were refused a room, for each of the 9 overbooking policies (both plots against the xvector x=2:10).

rooms = 50  # Number of rooms
p = 0.2  # Probability of random cancellation
N = 10  # Overbooking by N number of rooms
occupancy <- rep(0, N)
refused <- rep(0, N)
for (n in 1:N) {
    reserve = rooms + n
    sample <- replicate(10000, show(reserve, p))
    occupancy[n] <- mean(sample)
    sample_refused = pmax(0, sample - rooms)
    refused[n] = mean(sample_refused)
}  # For loop to simulate hotel being overbooked by N number of rooms
plot(1:N, occupancy)  # Plot of average occupancy

plot of chunk unnamed-chunk-4

plot(1:N, refused)  # Plot of avearage number of customers per night who were refused a room

plot of chunk unnamed-chunk-4

plot(refused, occupancy)

plot of chunk unnamed-chunk-4

occupancy[2:10]
## [1] 52 53 54 55 56 57 58 59 60

Based on your results, which policy would you adopt? (No right or wrong answer here, but think in terms of what you would choose if this was your hotel and what factors would influence your decision.)

Based on my results, I would have the hotel overbook by 1-5 number of rooms because with 20% cancellation there is a very good chance of 5 or more customers not showing up.