Question 13.2

For this problem, a simplified airport security system was simulated. I used the Arena software to simulate this problem. Starting off, my security system consisted of a block with passengers arriving according to a poisson distrubtion with a lamda of 5 per minute, and an ID/ boarding-pass check queue with an exponential service time with a mean rate of 0.75 minutes. After the passengers leave the boarding check, they go through a block that directs the passenger to the line with the least amount of people in queue. Three lines were used initally. Design of the airport security system

After running for about 2 hours, the simulation resulted in an error as the que in lines exceed 150 people as shown in the figure below.

A queue report was used to observe that the simulation lasted 2.32 hours before it failed. Additionally, each line had a wait time of approximately 21 minutes with an average of 20 passengers in each queue.

To address this issue, the number of checking stations was doubled.

This time, the simulation ran with no errors up until the maximum time of 12 hours. A queue report showed that lines 5 and 6 were not really needed as the average wait time was near 0. Additionally the average wait time was well below 15 minutes for all lines. A potential bottle neck in this design could be the ID/Boarding-Pass check if the airport were to become more busy.

From this simulation, it can be concluded that 1 ID/boarding-pass check and 4 personal-check queues are a solution to keeping average wait times below 15 minutes with how busy this airport is.

Question 14.1

http://r-statistics.co/Missing-Value-Treatment-With-R.html

First we need to import the data and enable to appropriate packages.

set.seed(10)
library(Hmisc)
library(mice)

breasts <- read.table("breast-cancer-wisconsin.data.txt", header = F, sep = ",", na.strings = "?")
head(breasts,25)
##         V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11
## 1  1000025  5  1  1  1  2  1  3  1   1   2
## 2  1002945  5  4  4  5  7 10  3  2   1   2
## 3  1015425  3  1  1  1  2  2  3  1   1   2
## 4  1016277  6  8  8  1  3  4  3  7   1   2
## 5  1017023  4  1  1  3  2  1  3  1   1   2
## 6  1017122  8 10 10  8  7 10  9  7   1   4
## 7  1018099  1  1  1  1  2 10  3  1   1   2
## 8  1018561  2  1  2  1  2  1  3  1   1   2
## 9  1033078  2  1  1  1  2  1  1  1   5   2
## 10 1033078  4  2  1  1  2  1  2  1   1   2
## 11 1035283  1  1  1  1  1  1  3  1   1   2
## 12 1036172  2  1  1  1  2  1  2  1   1   2
## 13 1041801  5  3  3  3  2  3  4  4   1   4
## 14 1043999  1  1  1  1  2  3  3  1   1   2
## 15 1044572  8  7  5 10  7  9  5  5   4   4
## 16 1047630  7  4  6  4  6  1  4  3   1   4
## 17 1048672  4  1  1  1  2  1  2  1   1   2
## 18 1049815  4  1  1  1  2  1  3  1   1   2
## 19 1050670 10  7  7  6  4 10  4  1   2   4
## 20 1050718  6  1  1  1  2  1  3  1   1   2
## 21 1054590  7  3  2 10  5 10  5  4   4   4
## 22 1054593 10  5  5  3  6  7  7 10   1   4
## 23 1056784  3  1  1  1  2  1  2  1   1   2
## 24 1057013  8  4  5  1  2 NA  7  3   1   4
## 25 1059552  1  1  1  1  2  1  3  1   1   2

Preparing our data.

#Finds missing data  using mice
md.pattern(breasts)

##     V1 V2 V3 V4 V5 V6 V8 V9 V10 V11 V7   
## 683  1  1  1  1  1  1  1  1   1   1  1  0
## 16   1  1  1  1  1  1  1  1   1   1  0  1
##      0  0  0  0  0  0  0  0   0   0 16 16
#Percentage of data missing
missing_breasts <- (1 - (683-16)/683) * 100
missing_breasts
## [1] 2.342606

Less than 5% of our data is missing so we can use imputation to address missing data. Use the mean/mode imputation method to impute values for the missing data.

#Using mean imputation method 
imputation.mean <- mice(breasts,m = 5, method = "mean")
## 
##  iter imp variable
##   1   1  V7
##   1   2  V7
##   1   3  V7
##   1   4  V7
##   1   5  V7
##   2   1  V7
##   2   2  V7
##   2   3  V7
##   2   4  V7
##   2   5  V7
##   3   1  V7
##   3   2  V7
##   3   3  V7
##   3   4  V7
##   3   5  V7
##   4   1  V7
##   4   2  V7
##   4   3  V7
##   4   4  V7
##   4   5  V7
##   5   1  V7
##   5   2  V7
##   5   3  V7
##   5   4  V7
##   5   5  V7
#Adding the newly calculated data points into the dataset
mean.breasts <- complete(imputation.mean)
head(mean.breasts, 25)
##         V1 V2 V3 V4 V5 V6        V7 V8 V9 V10 V11
## 1  1000025  5  1  1  1  2  1.000000  3  1   1   2
## 2  1002945  5  4  4  5  7 10.000000  3  2   1   2
## 3  1015425  3  1  1  1  2  2.000000  3  1   1   2
## 4  1016277  6  8  8  1  3  4.000000  3  7   1   2
## 5  1017023  4  1  1  3  2  1.000000  3  1   1   2
## 6  1017122  8 10 10  8  7 10.000000  9  7   1   4
## 7  1018099  1  1  1  1  2 10.000000  3  1   1   2
## 8  1018561  2  1  2  1  2  1.000000  3  1   1   2
## 9  1033078  2  1  1  1  2  1.000000  1  1   5   2
## 10 1033078  4  2  1  1  2  1.000000  2  1   1   2
## 11 1035283  1  1  1  1  1  1.000000  3  1   1   2
## 12 1036172  2  1  1  1  2  1.000000  2  1   1   2
## 13 1041801  5  3  3  3  2  3.000000  4  4   1   4
## 14 1043999  1  1  1  1  2  3.000000  3  1   1   2
## 15 1044572  8  7  5 10  7  9.000000  5  5   4   4
## 16 1047630  7  4  6  4  6  1.000000  4  3   1   4
## 17 1048672  4  1  1  1  2  1.000000  2  1   1   2
## 18 1049815  4  1  1  1  2  1.000000  3  1   1   2
## 19 1050670 10  7  7  6  4 10.000000  4  1   2   4
## 20 1050718  6  1  1  1  2  1.000000  3  1   1   2
## 21 1054590  7  3  2 10  5 10.000000  5  4   4   4
## 22 1054593 10  5  5  3  6  7.000000  7 10   1   4
## 23 1056784  3  1  1  1  2  1.000000  2  1   1   2
## 24 1057013  8  4  5  1  2  3.544656  7  3   1   4
## 25 1059552  1  1  1  1  2  1.000000  3  1   1   2
#Using regession imputation method
imputation.regression <- mice(breasts, m = 5, method = "norm.predict")
## 
##  iter imp variable
##   1   1  V7
##   1   2  V7
##   1   3  V7
##   1   4  V7
##   1   5  V7
##   2   1  V7
##   2   2  V7
##   2   3  V7
##   2   4  V7
##   2   5  V7
##   3   1  V7
##   3   2  V7
##   3   3  V7
##   3   4  V7
##   3   5  V7
##   4   1  V7
##   4   2  V7
##   4   3  V7
##   4   4  V7
##   4   5  V7
##   5   1  V7
##   5   2  V7
##   5   3  V7
##   5   4  V7
##   5   5  V7
#Adding the newly calculated data points into the dataset
regression.breasts <- complete(imputation.regression)
head(regression.breasts,25)
##         V1 V2 V3 V4 V5 V6        V7 V8 V9 V10 V11
## 1  1000025  5  1  1  1  2  1.000000  3  1   1   2
## 2  1002945  5  4  4  5  7 10.000000  3  2   1   2
## 3  1015425  3  1  1  1  2  2.000000  3  1   1   2
## 4  1016277  6  8  8  1  3  4.000000  3  7   1   2
## 5  1017023  4  1  1  3  2  1.000000  3  1   1   2
## 6  1017122  8 10 10  8  7 10.000000  9  7   1   4
## 7  1018099  1  1  1  1  2 10.000000  3  1   1   2
## 8  1018561  2  1  2  1  2  1.000000  3  1   1   2
## 9  1033078  2  1  1  1  2  1.000000  1  1   5   2
## 10 1033078  4  2  1  1  2  1.000000  2  1   1   2
## 11 1035283  1  1  1  1  1  1.000000  3  1   1   2
## 12 1036172  2  1  1  1  2  1.000000  2  1   1   2
## 13 1041801  5  3  3  3  2  3.000000  4  4   1   4
## 14 1043999  1  1  1  1  2  3.000000  3  1   1   2
## 15 1044572  8  7  5 10  7  9.000000  5  5   4   4
## 16 1047630  7  4  6  4  6  1.000000  4  3   1   4
## 17 1048672  4  1  1  1  2  1.000000  2  1   1   2
## 18 1049815  4  1  1  1  2  1.000000  3  1   1   2
## 19 1050670 10  7  7  6  4 10.000000  4  1   2   4
## 20 1050718  6  1  1  1  2  1.000000  3  1   1   2
## 21 1054590  7  3  2 10  5 10.000000  5  4   4   4
## 22 1054593 10  5  5  3  6  7.000000  7 10   1   4
## 23 1056784  3  1  1  1  2  1.000000  2  1   1   2
## 24 1057013  8  4  5  1  2  7.191237  7  3   1   4
## 25 1059552  1  1  1  1  2  1.000000  3  1   1   2
#Using pertubation method
imputation.pertubation <- mice(breasts, m = 5, method = "norm.nob")
## 
##  iter imp variable
##   1   1  V7
##   1   2  V7
##   1   3  V7
##   1   4  V7
##   1   5  V7
##   2   1  V7
##   2   2  V7
##   2   3  V7
##   2   4  V7
##   2   5  V7
##   3   1  V7
##   3   2  V7
##   3   3  V7
##   3   4  V7
##   3   5  V7
##   4   1  V7
##   4   2  V7
##   4   3  V7
##   4   4  V7
##   4   5  V7
##   5   1  V7
##   5   2  V7
##   5   3  V7
##   5   4  V7
##   5   5  V7
#Adding the newly calculated data points into the dataset
pertubation.breasts <- complete(imputation.pertubation)
head(pertubation.breasts,25)
##         V1 V2 V3 V4 V5 V6       V7 V8 V9 V10 V11
## 1  1000025  5  1  1  1  2  1.00000  3  1   1   2
## 2  1002945  5  4  4  5  7 10.00000  3  2   1   2
## 3  1015425  3  1  1  1  2  2.00000  3  1   1   2
## 4  1016277  6  8  8  1  3  4.00000  3  7   1   2
## 5  1017023  4  1  1  3  2  1.00000  3  1   1   2
## 6  1017122  8 10 10  8  7 10.00000  9  7   1   4
## 7  1018099  1  1  1  1  2 10.00000  3  1   1   2
## 8  1018561  2  1  2  1  2  1.00000  3  1   1   2
## 9  1033078  2  1  1  1  2  1.00000  1  1   5   2
## 10 1033078  4  2  1  1  2  1.00000  2  1   1   2
## 11 1035283  1  1  1  1  1  1.00000  3  1   1   2
## 12 1036172  2  1  1  1  2  1.00000  2  1   1   2
## 13 1041801  5  3  3  3  2  3.00000  4  4   1   4
## 14 1043999  1  1  1  1  2  3.00000  3  1   1   2
## 15 1044572  8  7  5 10  7  9.00000  5  5   4   4
## 16 1047630  7  4  6  4  6  1.00000  4  3   1   4
## 17 1048672  4  1  1  1  2  1.00000  2  1   1   2
## 18 1049815  4  1  1  1  2  1.00000  3  1   1   2
## 19 1050670 10  7  7  6  4 10.00000  4  1   2   4
## 20 1050718  6  1  1  1  2  1.00000  3  1   1   2
## 21 1054590  7  3  2 10  5 10.00000  5  4   4   4
## 22 1054593 10  5  5  3  6  7.00000  7 10   1   4
## 23 1056784  3  1  1  1  2  1.00000  2  1   1   2
## 24 1057013  8  4  5  1  2  6.00846  7  3   1   4
## 25 1059552  1  1  1  1  2  1.00000  3  1   1   2

Question 15.1

A situtation from everyday life that optimization could be used would be for determining which classes to take in a masters program that take into the account how time consuming a course is, how relevant the material is to a specific industry, and how difficult the course is. Data from a forum like OMScentral could be used to gather information pertaining to how many hours a week on average a course requires and how difficult it is.