In: Computer Science
A marketing survey looked at the preferences of hot drink size
among 1275 random
customers of a coffee shop chain. The survey was also interested in
whether the customer’s gender
affects their preference. The results of the survey were used to
estimate the probabilities in this joint
probability distribution:
Tall (T) Grande (G) Venti (V)
Female (F) 0.12 0.24 0.06
Male (M) 0.08 0.38 0.12
a) What is p (M, T), the joint probability that a customer in the
survey was both male and prefers tall
drinks?
b) What is p (F), the marginal probability that a customer in the
survey was female?
c) What is p(G), the marginal probability that a customer in the
survey prefers Grande drinks?
d) What is p (V | M), the conditional probability, given a customer
in the survey was male, that he prefers
venti drinks?
e) What is p (F | V), the conditional probability, given a customer
in the survey prefers venti drinks, that the customer was
female?
f) There are two random variables in this situation, drink size and
gender. Are they independent or dependent? Explain how you arrived
at the answer and show your calculations.
Tall (T) | Grande (G) | Venti (V) | |
Female (F) | 0.12 | 0.24 | 0.06 |
Male (M) | 0.08 | 0.38 | 0.12 |
Probability: Probability always lies between 0<=p(x)<=1
a) What is p (M, T), the joint probability that a
customer in the survey was both male and prefers tall
drinks?
Ans:
before answering we need to find out total probability for the all rows and columns.
Tall Grande Venti Total
Female 0.12 0.24 0.06 0.42
Male 0.08 0.38 0.12 0.58
Total 0.20 0.62 0.18 1(Total always 1)
Figure
Joint probability: As the name suggests "JOINT", this is the probability that two or more events occur jointly (at the same time).
Otherwise It is the intersection of certain outcomes of the variables.
We can represent it as P(X ∩ Y) or P(X and Y).
We need to find intersection of male and tall drinks (joint probability):
from the table,intersection of bold numbers is P(male ∩ tall) = 0.08.
explanation : first consider only male row. then consider the Tall drink column. so intersection of both row and column is 0.08(from figure underlined number).
b) What is p (F), the marginal probability that a customer in the survey was female?
Tall Grande Venti Total
Female 0.12 0.24 0.06 0.42
Male 0.08 0.38 0.12 0.58
Total 0.20 0.62 0.18 1(Total always 1)
Figure
Marginal Probability : As its name suggests "MARGIN", It is the probability of an outcome of each individual variable irrespective of other variables. It is also called as Simple probability.
marginal probability that a customer in the survey was female P(F) (underlined number from figure):
So we need find out outcome of female to the every drink.
From the figure: Sum of the all outcomes of female is 0.42 (respective to all drinks 0.12+0.24+0.06)
c) What is p(G), the marginal probability that a customer in the survey prefers Grande drinks?
Tall Grande Venti Total
Female 0.12 0.24 0.06 0.42
Male 0.08 0.38 0.12 0.58
Total 0.20 0.62 0.18 1(Total always 1)
Figure
the marginal probability that a customer in the survey prefers Grande drinks P(G) (underlined number from figure) :
So we need find out outcome of Grande drink to the every row(male and female).
From the figure: Sum of the all outcomes of Grande drink is 0.62 (respective to male and female 0.24+0.38)
d) What is p (V | M), the conditional probability, given
a customer in the survey was male, that he prefers
venti drinks
Conditional Probability:The conditional probability of an event is the probability that event will occur given the that another event has already occurred (As a name states itself Conditional).
for example there are two events A,B, P(A/B) is given by P(A ∩ B)/P(B)
p (V | M) = P(V ∩ M) /P(M)
P(V ∩ M) is the joint probability of, customer in the survey was both male and prefers venti drinks:
Tall Grande Venti Total
Female 0.12 0.24 0.06 0.42
Male 0.08 0.38 0.12 0.58
Total 0.20 0.62 0.18 1(Total always 1)
figure for P(V ∩ M)
From figure P(V ∩ M) (We need to find intersection of male and venti drinks) ) = 0.12 (underlined number from figure)
P(M) the marginal probability that a customer in the survey was male.
Tall Grande Venti Total
Female 0.12 0.24 0.06 0.42
Male 0.08 0.38 0.12 0.58
Total 0.20 0.62 0.18 1(Total always 1)
figure for P(M)
P(M) = 0.58 (Sum of male with respective to drinks 0.08+0.38+0.12) (underlined number from figure for P(M))
p (V | M) = P(V ∩ M) /P(M) = 0.12/0.58 = 0.20689655172.
e) What is p (F | V), the conditional probability, given a customer in the survey prefers venti drinks, that the customer was female?
p (F | V) = P(F ∩ V) /P(V)
P(F ∩ V) is the joint probability of customer in the survey was both female and prefers venti drinks:
From figure P(F ∩ V) (We need to find intersection of female and venti drinks) = 0.06
P(V) the marginal probability that a customer in the survey drinks Venti.
From figure:
P(F ∩ V) = 0.06
P(V) = 0.18 (Sum of Venti drinks with respective to male and female 0.06+0.12)
p (F | V) = P(F ∩ V) /P(V) = 0.06/0.18 =0.33333333333
explanation is same above.