This is chapter 2 homework for Data 606 for Fall 2018 semester. The chapter is related to Probability.
Following are the questions and their answers solved below:
2.6 Dice rolls. If you roll a pair of fair dice, what is the probability of (a) getting a sum of 1? Answer - The minimum sum can be 2. That means sum of 1 is not possible. Hence P(sum=1) = 0
Hence 4 possible outcomes give the sum of 5. Total number of possible outcomes= 6 X 6 = 36 Hence P(sum=5) = 4/36
2.8 Poverty and language. 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. (a) Are living below the poverty line and speaking a foreign language at home disjoint? Answer - No, these are not disjoint, as there are more than 0 (4.2%) such people who are below the poverty line and speak a foreign language.
## install.packages("VennDiagram")
library(VennDiagram)
## Loading required package: grid
## Loading required package: futile.logger
grid.newpage()
draw.pairwise.venn(0.146, 0.207, 0.042, category = c("Below Poverty ;Line", "Foreign Language"), lty = rep("blank",
2), fill = c("light blue", "pink"), alpha = rep(0.5, 2), cat.pos = c(0,
0), cat.dist = rep(0.025, 2))
## (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])
What percent of Americans live below the poverty line and only speak English at home? Answer - from the Venn diagram above, the plot in blue gives the people below poverty line and speaking only English. It is 0.104. In Percent = 10.4%
What percent of Americans live below the poverty line or speak a foreign language at home? Answer - P(poverty=yes OR language=foreign) = P(poverty=yes) + P(language=foreign) - P(poverty=yes AND language=foreign)
= 0.146 + 0.207 - 0.042 = 0.311
In percent = 31.1%
What percent of Americans live above the poverty line and only speak English at home? Answer - This population will be Poverty Line or speaking English only. This is total MINUS (povery=yes OR language=foreign) (poverty = yes OR language=foreign) is 31.1% from last question. So, Poverty Line or speaking English only = 100 - 31.1 = 68.9%
Is the event that someone lives below the poverty line independent of the event that the person speaks a foreign language at home? Answer - P(poverty line=yes) = 0.146 P(language=foreign) = 0.207 P(poverty line=yes AND language=foreing) = 0.042
P(poverty line=yes) X P(language=foreign) = 0.146 X 0.207 = 0.0302 Hence P(poverty line=yes) X P(language=foreign) NOT equal to P(poverty line=yes AND language=foreign) That means the 2 events are not independent.
2.20 Assortative mating. 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.65 Partner (female) Blue Brown Green Total Blue 78 23 13 114 Self (male) Brown 19 23 12 54 Green 11 9 16 36 Total 108 55 41 204 (a) What is the probability that a randomly chosen male respondent or his partner has blue eyes? Answer - P(male=Blue OR female=Blue) = P(male=Blue) + P(female=Blue) - P(male=Blue AND female=Blue) = 114/204 + 108/204 - 78/204 = 144/204 = 0.71
P(female=Blue | male=Blue) = P(female=Blue AND male=Blue) / P(male=Blue) = (78/204) / (114/204) = 78/114 = 0.68
patrt-2: P(female=Blue | male=Green) = P(female=Blue AND male=Green) / P(male=Green) = (11/204) / (36/204) = 11/36 = 0.31
2.30 Books on a bookshelf. The table below shows the distribution of books on a bookcase based on whether they are nonfiction or fiction and hardcover or paperback. Format Hardcover Paperback Total Type Fiction 13 59 72 Nonfiction 15 8 23 Total 28 67 95 (a) Find the probability of drawing a hardcover book first then a paperback fiction book second when drawing without replacement. Answer - (28/95) X (59/94) = 0.185
If the first book drawn is a paperback
Probability of drawing a fiction hardcover book first and then a hardcover book second = (13/95) X (27/94) = 0.0393
Probability of drawing a fiction paperback book first and then a hardcover book second = (59/95) X (28/94) = 0.185
As either of the 2 events can happen, these 2 above values need to be added together: 0.0393 + 0.185 = 0.2243
Answer -
(13/95) X (28/95) This comes from first scenario (59/95) X (28/95) This comes from second scenario
Adding the 2 (13 X 28 + 59 X 28) / (95 X 95) = 0.2234
2.38 Baggage fees. 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. (a) Build a probability model, compute the average revenue per passenger, and compute the corresponding standard deviation. Answer - i 0 1 2 Total xi $0 $25 $60 P(X=xi) 0.54 0.34 0.12 xi * P(X=xi) 0 8.5 7.2 15.7 xi - u -15.7 9.3 44.3
(xi - u)^2 246.49 86.49 1962.49
(xi - u)^2 * P(X=xi) 133.105 29.407 235.499 398.011
E(X) = x0 X P(X=x0) + x1 X P(X=x1) + x2 X P(X=x2)
Average revenue per passenger = (0 X 0.54) + (25 X 0.34) + (60 X 0.12) = $15.7
Variance = ???(xi - u)^2 * P(X=xi) = 398.011 SD = ???Variance = ???398.011 = 19.95
If a data set is multiplied by a constant, the standard deviation also gets multiplied by the same constant value. Hence, SD for 120 passengers flight = 120 X SD for 1 passenger = 120 X 19.95 = 2394
2.44 Income and gender. 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.69 (a) Describe the distribution of total personal income. Answer -
library(ggplot2)
annual.personal.income.dist <- data.frame(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 0r more"), percent = c(2.2, 4.7, 15.8, 18.3, 21.2, 13.9, 5.8, 8.4, 9.7))
ggplot(annual.personal.income.dist, aes(x=annual.personal.income.dist$income, y=annual.personal.income.dist$percent)) + geom_bar(stat = "identity") + labs(x="income ranges", y="per centage") + theme(axis.text.x = element_text(angle = -90))
What is the probability that a randomly chosen US resident makes less than $50,000 per year? Answer - To get this, we need to add up the probability of all the disjoint / mutually exclusive income ranges up to $50,000, which will be: 0.022 + 0.047 + 0.158 + 0.183 + 0.212 = 0.622
What is the probability that a randomly chosen US resident makes less than $50,000 per year and is female? Note any assumptions you make. Answer - Assuming that the ratio of the males and females are same throughout the various income ranges, probability of a resident - having income less than 50,000 and is female is: 0.622 X 0.41 = 0.255
The same data source indicates that 71.8% of females make less than $50,000 per year. Use this value to determine whether or not the assumption you made in part (c) is valid. Answer - This value defies the assumption used in the above question. If we take the assumption used in c above, then the females form the below percentage values in each of the salary ranges as shown below:
$1 to $9,999 or loss 2.2 X .41 = 0.902 $10,000 to $14,999 4.7 X .41 = 1.927 $15,000 to $24,999 15.8 X .41 = 6.478 $25,000 to $34,999 18.3 X .41 = 7.503 $35,000 to $49,999 21.2 X .41 = 8.692 $50,000 to $64,999 13.9 X .41 = 5.699 $65,000 to $74,999 5.8 X .41 = 2.378 $75,000 to $99,999 8.4 X .41 = 3.444 $100,000 or more 9.7 X .41 = 3.977
So, the total is 41%, while the female form 25.5% of total population which is under 50,000 range. Hence 25.5 / 41 = 62.19% wich is not the same as given in this question d. Hence the assumption used in c will be false if this is true.