Dice rolls. (3.6, p. 92) If you roll a pair of fair dice, what is the probability of
# two dice roll in a matrix
dice1 <- c(1,2,3,4,5,6)
dice2 <- c(1,2,3,4,5,6)
dicesum<-matrix(c(dice1[1]+dice2,dice1[2]+dice2,dice1[3]+dice2,dice1[4]+dice2,dice1[5]+dice2,dice1[6]+dice2),nrow = 6, byrow=TRUE)
dicesum
## [,1] [,2] [,3] [,4] [,5] [,6]
## [1,] 2 3 4 5 6 7
## [2,] 3 4 5 6 7 8
## [3,] 4 5 6 7 8 9
## [4,] 5 6 7 8 9 10
## [5,] 6 7 8 9 10 11
## [6,] 7 8 9 10 11 12
Can not have sum of 1 by rolling two fair dice. Minimum sum you can get is 2 according to the sum matrix.
According to the sum matrix there are 4 possible chances of getting sum of 5. (4,1), (3,2), (2,3), (1,4):
#Possibility of getting sum of 5
sumof5_tot_chances <- 4
tot_Possible_outcomes <- 36
Pof5 <- sumof5_tot_chances/tot_Possible_outcomes
Pof5
## [1] 0.1111111
According to the sum matrix there are only one possible chance of getting sum of 12. (6,6):
#Possibility of getting sum of 12
sumof12_tot_chances <- 1
Pof12 <- sumof12_tot_chances/tot_Possible_outcomes
Pof12
## [1] 0.02777778
Poverty and language. (3.8, p. 93) The American Community Survey is an ongoing survey that provides data every year to give communities the current information they need to plan investments and services. The 2010 American Community Survey estimates that 14.6% of Americans live below the poverty line, 20.7% speak a language other than English (foreign language) at home, and 4.2% fall into both categories.
As 4.2% fall into both categories, it is not disjoint.
library(VennDiagram)
## Loading required package: grid
## Loading required package: futile.logger
PL <- 14.6/100
FL <- 20.7/100
PLandFL <- 4.2/100
grid.newpage()
draw.pairwise.venn(area1 = 14.6, area2 = 20.7, cross.area = 4.2, category = c("BelowPL", "ForiegnLanguage"))
## (polygon[GRID.polygon.1], polygon[GRID.polygon.2], polygon[GRID.polygon.3], polygon[GRID.polygon.4], text[GRID.text.5], text[GRID.text.6], text[GRID.text.7], text[GRID.text.8], text[GRID.text.9])
Assortative mating. (3.18, p. 111) Assortative mating is a nonrandom mating pattern where individuals with similar genotypes and/or phenotypes mate with one another more frequently than what would be expected under a random mating pattern. Researchers studying this topic collected data on eye colors of 204 Scandinavian men and their female partners. The table below summarizes the results. For simplicity, we only include heterosexual relationships in this exercise.
Books on a bookshelf. (3.26, p. 114) The table below shows the distribution of books on a bookcase based on whether they are nonfiction or fiction and hardcover or paperback.
Baggage fees. (3.34, p. 124) An airline charges the following baggage fees: $25 for the first bag and $35 for the second. Suppose 54% of passengers have no checked luggage, 34% have one piece of checked luggage and 12% have two pieces. We suppose a negligible portion of people check more than two bags.
Income and gender. (3.38, p. 128) The relative frequency table below displays the distribution of annual total personal income (in 2009 inflation-adjusted dollars) for a representative sample of 96,420,486 Americans. These data come from the American Community Survey for 2005-2009. This sample is comprised of 59% males and 41% females.