ACTIVITY Hiring discrimination—it just won’t fly!

An airline has just finished training 25 pilots—15 male and 10 female—to become captains. Unfortunately, only eight captain positions are available right now. Airline managers announce that they will use a lottery to determine which pilots will fill the available positions. The names of all 25 pilots will be written on identical slips of paper. The slips will be placed in a hat, mixed thoroughly, and drawn out one at a time until all 8 captains have been identified.
A day later, managers announce the results of the lottery. Of the 8 captains chosen, 5 are female and 3 are male. Some of the male pilots who weren’t selected suspect that the lottery was not carried out fairly. One of these pilots asks your statistics class for advice about whether to file a grievance with the pilots’ union.
Pilots

The key question in this possible discrimination case seems to be: Is it plausible (believable) that these results happened just by chance?

pilots <- c(rep("Male",15),rep("Female",10))
n <- 100000
nsamp <- 1:n
females <- replicate(n,0)
for (i in 1:n) {
  females[i] <- sum(sample(pilots,8,replace = FALSE) == "Female")
}
df <- tibble(nsamp,females)
df %>% count(females) %>% mutate(prop = n/sum(n))
## # A tibble: 9 x 3
##   females     n    prop
##     <dbl> <int>   <dbl>
## 1       0   642 0.00642
## 2       1  5837 0.0584 
## 3       2 20583 0.206  
## 4       3 33450 0.334  
## 5       4 26629 0.266  
## 6       5 10633 0.106  
## 7       6  2055 0.0206 
## 8       7   169 0.00169
## 9       8     2 0.00002
p <- sum(table(females)[6],table(females)[7],table(females)[8],table(females)[9])/n

The simulated probabilty that 5 or more female pilots would be selected is 0.12859

plot1 <- ggplot(df, aes(females,y=stat(count)/sum(stat(count)))) + geom_histogram(binwidth = 1, fill = "#4B9CD3", color = "navyblue", show.legend = FALSE) + scale_x_continuous(breaks = c(0:8)) + labs(title = "Hiring Discrimination", x = "Number of Females", y = "Proportion")
plot1