The probability of getting a red or blue marble is the number of red + blue marbles, over the total number of marbles: 127/138
The probability of getting a red ball is the number of red balls over the total number of balls: 20/80 == 1/4
GenderResidence <- matrix(c(81,228,116,79,215,252,130,97,129,72), ncol = 2, byrow = TRUE)
rownames(GenderResidence) <- c('Apartment','Dorm','With Parent(s)','Sorority/Fraternity House','Other')
colnames(GenderResidence) <- c("Male","Female")
GenderResidence
## Male Female
## Apartment 81 228
## Dorm 116 79
## With Parent(s) 215 252
## Sorority/Fraternity House 130 97
## Other 129 72
The probability is going to be the total number of Female customers + the number of Males who do not live with parents, over the total number of customers. We interperet the ‘or’ in the question as inclusive of ‘not male’ and ‘doesn’t live with parents’. Thus the only group we exclue are males who live with parents
(sum(GenderResidence[,"Female"]) + #Total number of Females
sum(GenderResidence[,"Male"]) - GenderResidence["With Parent(s)","Male"]) / #Total number of Males, less the number who live with parents
1399
## [1] 0.8463188
or 1184/1399
Assuming going to the gym affects weight loss and vice versa, then they are dependent.
So, we know we can’t have multiple of the same vegetable or condiment, and the order by which the sandwich is build presumably doesn’t matter. Sounds like a combination without repetition to me.
veg = 8
cond = 7
tort = 3
vegChoose = 3
condChoose = 3
tortChoose = 1
#A little function to make this easier
combine <- function(n,r) {
combined = factorial(n)/(factorial(n-r)*factorial(r))
return(combined)
}
combine(veg,vegChoose) * combine(cond, condChoose) * combine(tort, tortChoose)
## [1] 5880
There are 5880 combinations
They are probably independent events (excluding wierd butterfly effects)
Sounds like a permutation without reputation, assuming the same person cannot hold more than one office.
candidates = 14
spots = 8
permute <- function(n,r) {
permuted = factorial(n)/factorial(n-r)
return(permuted)
}
permute(candidates, spots)
## [1] 121080960
There are 121080960 ways to organize the cabinet.
This is asking for the number of combinations drawing the correct jelly beans over the total number of combinations (all without replacement). Should look somthing like this:
red = 9
orange = 4
green = 9
total = red + orange + green
chooseRed = 0
chooseOrange = 1
chooseGreen = 3
totalChoose = 4
combine(red, chooseRed) * combine(orange, chooseOrange) * combine(green, chooseGreen) / combine(total, totalChoose)
## [1] 0.04593301
The probability of doing so is about 0.0459
Same thing as 11 * 10 * 9 * 8
Which is 7920
33% of the subscribers are not over the age of 34 (<=34)
First, the probability of winning is going to be all combinations of choosing 3 heads from 4 tosses, over all permutations of tosses (which is a permutation with replcement. There are probably more ways to do this, but you can visualize why this works.
combine(4,3)/4**2
## [1] 0.25
Second, now that we know the probability of winning is 25%, we need to determine the expected winnings - expected losses
97 * 0.25 - 30 * (1-0.25)
## [1] 1.75
We would expect to win $1.75 on the whole.
559 rounds * $1.75/round = $978.25
Again, first we need to find the probability of winning (4 tails or less). This is going to be the sum of choices for which we end up with 0-4 tails, over the total number of possibilities (full permutation of possibilities with replacement):
(choose(9,0) + choose(9,1) + choose(9,2) + choose(9,3) + choose(9,4)) / 2**9
## [1] 0.5
The probability of winning is 50%. Now we calculate the expected yield same as before.
23 * 0.5 - 26 * 0.5
## [1] -1.5
One would loose $1.5 on average per round.
994 * -1.5 means you would expect to loose $1491 (-1491)
Sounds like a Bayes question.
To put it into words, we’re looking for: the probability that it was an actual liar who was truthfully detected (True positive; (Pr(DetLiar|Liar) X Pr(Liar)) over the probability that it was an actual liar who was truthfully detected (Pr(DetLiar|Liar) X Pr(Liar)) PLUS the probability that it wasn’t a liar who was wrongfully detected as a liar (False positive; Pr(DetLiar|Truther) X Pr(Truther)). Simply put: the probability of it being an actual liar that was detected over all possible probabilities of liars being detected.
Pr(DetLiar|Liar) X Pr(Liar) / (Pr(DetLiar|Liar) X Pr(Liar) + (1-Pr(DetTruther|Truther)) X Pr(Truther))
0.59 X 0.20 / (0.59 X 0.20 + (1 - 0.90) X 0.80 ) = 0.596
So about a 60% chance that that was actually a liar.
Same thing as before, but with truth tellers. We want to find the probabality
Pr(DetTruth|Truth) X Pr(Truth) / (Pr(DetTruth|Truth) X Pr(Truth) + (1-Pr(DetLiar|Liar)) X Pr(Liar))
0.90 X 0.80 / (0.90 X 0.80 + (1 - 0.59) X 0.20 ) = 0.898
so about 90% chance that the person was actually a truth teller.
One way to think about this as the probability that they were a liar (detected or not; Pr(0.20)) + the probability they were telling the truth but were detected as a liar. We’ll look at the problem like that, but there are other ways to solve this, such as taking the probability of being a liar, adding the probability that they were detected as a liar, and subtracting the probability that they were a liar who was detected as a liar.
Pr(Liar) + Pr(DetLiar|Truth)
or put another way
Pr(Liar) + (1-Pr(DetTruther|Truther)) X Pr(Truther)
0.2 + (1 - 0.90) X 0.80 ) = 0.28
So there’s a 28% chance of a randomly selected individual being a liar, or being detected as a liar.