Problem 2.6 Dice rolls.

  1. The probability will be 0
  2. The probability will be 4/36.
  3. The probability will be 1/36

Problem 2.8 Poverty and language.

  1. NO
library(VennDiagram)
## Loading required package: grid
## Loading required package: futile.logger
grid.newpage()
vplot <- draw.pairwise.venn(area1 = 14.6 ,
                            area2 = 20.7,
                            cross.area = 4.2,
                            category   = c("Below Poverty", "Foreign Language"),
                            fill = c("pink","yellow"),
                            cat.cex         = 2,
                            #cex             = 2,
                            cat.pos         = c(0,0)
                            )

c.below poverty - what fall into both category 14.6 - 4.2 = 10.4 ~ 0.104 d.below porverty and speak foreign language 35.3 ~ 0.353 e. is 68% f.no

Problem 2.20 Assortative mating.

  1. 114 / 204 = 70.5 %
  2. 78 / 144 = 68.4 %
  3. 19 / 54 = 35.1 %
  4. 11/ 36 = 30.5 %

Problem 2.30 Books on a bookshelf.

cat("a.",28/95 * 59/94  ,"%")
## a. 0.1849944 %
cat("b. hardcocer + papercover ", (13/95 * 27/94)  + (59/95 * 28/94), "%")
## b. hardcocer + papercover  0.2243001 %
cat("c." , (72/95)*(28/94)) 
## c. 0.2257559
#d. because it’s just slightly different

problem 2.38 Baggage fees.

bag <- c(0,1,2)
price <- c(0,25,35)
percent <- c(0.54,0.34,0.12)
ok <- (price * percent)
cat("AVG:" ,sum(price * percent))
## AVG: 12.7

Problem 2.44 Income and gender.

string.income <- c("1 - 9,999","10,000 - 14,999","15,000 - 24,999","25,000 - 34,999","35,000 - 49,999","50,000 - 64,999","65,000 - 74,999","75,000 - 99,999","100,000 ->")

total.percent <- c(2.2, 4.7, 15.8, 18.3, 21.2, 13.9, 5.8, 8.4, 9.7)
df <- data.frame(string.income,total.percent)
barplot(df$total.percent ,ylab = "Percent",main = "Income-Total", names.arg = string.income)

#b
sum(total.percent[1:5])
## [1] 62.2
#c
cat("female and less 50k is:", (sum(total.percent[1:5]) / 100) *0.41)
## female and less 50k is: 0.25502
#d
# my assumption was not valid