Set up workspace
Minimum possible value is 2. 0% chance.
P(1, 4) = (1/6)^2
P(2, 3) = (1/6)^2
P(3, 2) = (1/6)^2
P(4, 1) = (1/6)^2
4*((1/6)^2)## [1] 0.1111111
About 11% chance, or 4/36.
P(6, 6) = (1/6)^2
(1/6)^2## [1] 0.02777778
About 3% chance, or 2/36.
No. 4.2% are associated with both categories.
grid.newpage()
draw.pairwise.venn(area1 = 14.6, area2 = 20.7, cross.area = 4.2, category = c("Poverty",
"Second Language"))## (polygon[GRID.polygon.11], polygon[GRID.polygon.12], polygon[GRID.polygon.13], polygon[GRID.polygon.14], text[GRID.text.15], text[GRID.text.16], text[GRID.text.17], text[GRID.text.18], text[GRID.text.19])
10.4%
14.6 + 20.7 - 4.2## [1] 31.1
100 - 31.1## [1] 68.9
P(poverty) * p(second language) = 0.030222
But this does not equal intersection (.042), so these events are not independent of one another.
(114 + 108 - 78)/204## [1] 0.7058824
78/114## [1] 0.6842105
19/54## [1] 0.3518519
11/36## [1] 0.3055556
If independent, the probability of both events occurring would be the same as the probababilty of one occurring times the other occurring. It does seem the probably of the intersection is slightly higher than the general probabilities: p(male blue eyes): 114/204.
p(partner has blue eyes): 108/204.
p(intersection): (70/204), or 0.3431373.
Which is slightly higher than (114/204)(108/204), or 0.2958478. So, at least for blue eyes, they do not seem to be independent.
(28/95)*(67/94)## [1] 0.2100784
Two ways… first book could be either fiction paperback or fiction hardcover:
(59/95)*(28/94) + (13/95)*(27/94)## [1] 0.2243001
(72/95)*(28/95)## [1] 0.2233795
The majority of the books are fiction. So, only removing one of these initially doesn’t change the next step’s overall probability by very much. As more items are removed, a larger dependent effect would be observed.
Expected values:
.54*(0) + .34*(25) + .12*(60)## [1] 15.7
Expected value of $15.7
Variance:
((0 - 15.7)^2)*(.54) + ((25 - 15.7)^2)*(.34) + ((60 - 15.7)^2)*(.12)## [1] 398.01
Standard deviation is the square root of variance:
round((398.01)^(1/2), digits = 2)## [1] 19.95
Assuming the number of passengers doesn’t affect the expected percentages checking 0, 1, or 2 pieces of luggage, the expected revenue
15.7*120## [1] 1884
About $1884
Standard deviation of revenue for all the passengers is: sqrt(120 * 398.01)
(120*398.01)^(1/2)## [1] 218.5434
This formula assumes the number of bags is independent of the number of passengers. If more people tend to fly at Christmas (with a lot of extra things in there bag), this may not be a valid assumption.
Bimodal distrubution, with the main peak at 35K-49,999K, and a second small peak at 100K+.
2.2 + 4.7 + 15.8 + 18.3 + 21.2## [1] 62.2
About 62%
Assuming gender and income are independent (which they are not), the probability would be the following:
.62*.41## [1] 0.2542
If a female was more likely to earn below 50K than a male, there were be a slightly higher liklihood that a randomly chosen person had both of these attributes.
P( <50 | F) = P(<50 & F)/P(F) = .25/.41 = ~62% which is lower than the 71.8%.