*(a) getting a sum of 1?
None since the minimum roll will be 2 with two dice
P(sum=1) = 0
*(b) getting a sum of 5?
P(sum=5) = 4/36 =.12
The available combinations for this probability to occur are (1,4), (4,1), (2,3), (3,2), given 35 posibilities the probability of getting sum=5 is 0.12
*(c) getting a sum of 12?
P(sum=12) = 1/36 = 0.3
The only available combination for this to happen is double 6 (6,6) so porbability is 0.3
*a - Are living below the poverty line and speaking a foreign language at home disjoint?
No because one could be living below the poverty line only, or could be living below the poverty line and speaking a foreign language at home or speaking a foreign language at home only.
*b - Draw a Venn diagram summarizing the variables and their associated probabilities.
library (VennDiagram)
## Loading required package: grid
## Loading required package: futile.logger
poverty <-14.6
foreign.language<-20.7
both<-4.2
poverty.only<-foreign.language-both
venn.diag <- draw.pairwise.venn(poverty, foreign.language, cross.area = both, c("Poverty", "Foreign Language"), fill=c("red","blue"), cat.dist=-0.08, ind=FALSE)
grid.draw(venn.diag)
*c - What percent of Americans live below the poverty line and only speak English at home?
Only speak english: 1 - 20.7% = 79.3%.
P(below poverty line and speak english) = 14.6% x 79.3% = 11.5%
*d - What percent of Americans live below the poverty line or speak a foreign language at home?
P(below poverty line or speak foreign language) - P(both below proverty line and speak foreign language) = 14.6% + 20.7% - 4.2% = 31.1%
*e - What percent of Americans live above the poverty line and only speak English at home?
P(above proverty line and only speak english) = (1-14.6%) * 79.3% = 67.7%
*Is the event that someone lives below the poverty line independent of the event that the person speaks a foreign language at home?
No
*a - Find the probability of drawing a hardcover book first then a paperback fiction book second when drawing without replacement.
P(Hardcover first) x P(paperback fiction) = ( 28/95 ) x (59 / 94) = 18.50%
*b - Determine the probability of drawing a fiction book first and then a hardcover book second, when drawing without replacement.
P(first:hard cover fiction and second: hard cover) + P(first: papaerback fiction and second: hard cover) = (13/95)(27/94) + (59/95)(28/94) = 22.43%
*c - Calculate the probability of the scenario in part (b), except this time complete the calculations under the scenario where the first book is placed back on the bookcase before randomly drawing the second book.
P(first: fiction and second: hardcover) = (72/95) * (28/95) = 22.338%
*d - The final answers to parts (b) and (c) are very similar. Explain why this is the case.
Because the difference of (b) and (c) is replacement of the book which changes the denominator from 1/(9594) to (1/9595). The impact of the overall percentage number is small.
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.
numBags = c(0,1,2)
costBaggage = c(0,25,35)
probabilityBaggage = c(.54,.34,.12)
df = data.frame(numBags,costBaggage,probabilityBaggage)
row.names(df) = c('Number of bags','cost of baggage','probability of event')
df$pe = df$costBaggage*df$probabilityBaggage
evprob = sum(df$eV)
variancep = var(df$pe)
sdp = sd(df$pe)
print( 'Average revenue per passenger')
## [1] "Average revenue per passenger"
evprob##Average revenue per passenger
## [1] 0
print('Variance of revenue per passenger')
## [1] "Variance of revenue per passenger"
variancep ##Variance of revenue per passenger
## [1] 18.06333
print('Standard deviation of revenue per passenger')
## [1] "Standard deviation of revenue per passenger"
sdp ##Standard deviation of revenue per passenger
## [1] 4.250098
*b - About how much revenue should the airline expect for a flight of 120 passengers? With what standard deviation? Note any assumptions you make and if you think they are justified.
print('You can expect the avg revenue per flight to be the eV per passenger, multiplied by number of passengers')
## [1] "You can expect the avg revenue per flight to be the eV per passenger, multiplied by number of passengers"
evprob*120
## [1] 0
print('You can expect the deviation to be the SD per passenger, multiplied by number of passengers')
## [1] "You can expect the deviation to be the SD per passenger, multiplied by number of passengers"
sdp*120
## [1] 510.0118
This sample is comprised of 59% males and 41% females
incomedist = c("$1 - $9,999 or less",
"$10,000 to $14,999",
"$15,000 to $24,999",
"$25,000 to $34,999",
"$35,000 to $49,999",
"$50,000 to $64,000",
"$65,000 to $74,999",
"$75,000 to $99,999",
"$100,000 or more")
Income = c(10,15,25,35,45,55,65,75,100)
Percent = c(2.2,4.7,15.8,18.3,21.2,13.9,5.8,8.4,9.7)
barplot(Income, Percent,xlab='Income distribution')
*a - Describe the distribution of total personal income.
Right Skewed.
*b - What is the probability that a randomly chosen US resident makes less than $50,000 per year?
result = sum(Percent[1:5])
result
## [1] 62.2
P(make lesser than $50k) = (2.2 + 4.7 + 15.8 + 18.3 + 21.2) = 62.2%
*c - 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.
Assume the samples of males and females are similar across all salary categories. P(make lesser than $50k and female) = 62.2% * 41% = 25.50%
*d - 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.
The assumption in (c) is not correct. If 71.8% of females make lesser than $50k: Samples of making lesser than 50K is 62.2% x 96,420,486 = 59,973,542 And, overall number of females in the samples is 41% * 96,420,486 = 39,532,399
And, number of female who make lesser than $50k is 71.8% * 39,532,399 = 28,384,262
Therefore, the probability that a randomly chosen US resident makes less than $50,000 per year and is female: 28,384,262 / 96,420,486 = 29.44%.