Suppose that you are inspecting a lot of 1000 light bulbs, among which 20 are defectives. You choose two light bulbs randomly from the lot without replacement. Let X1 =1, if the 1st light bulb is defective, 0, otherwise, X2 =1, if the 2nd light bulb is defective, 0, otherwise. Find the probability that at least one light bulb chosen is defective. [Hint: Compute P(X1 + X2 = 1).]
#data analysis using hamilton data to predict y data=read.csv("hamilton.csv") #wewill check the performance of first-order model m1=lm(y~x1+x2, data) summary(m1) par(mfrow=c(1,3)) plot(data[,1], m1$res) plot(data[,2],m1$res) plot(fitted(m1),m1$res) #I did not observe an obvious pattern in the residual plots #we will present the partial residual plots on x1 partial=m1$res+coef(m1)[2]*data[,1] plot(data[,1], partial,xlab='x1',ylab="partial residual") #partial residual plot show strict linear line #there must be violation on the assumptions to do linear regression install.packages("car") install.packages("MASS") library("car") library('MASS') vif(m1) cor.test(data[,1], data[,2])$p.value #x1 and x2 are significantly correlated #we will apply rid