Problem:
You are given data up to October 2023 about the performance of a web-based product. The data includes the number of users visiting the website and the number of users who convert (i.e., complete a purchase) each month.
Let’s say you have the following data for the last 12 months (November 2022 to October 2023):
- Total Users (U): 120,000
- Total Conversions ©: 3,600
Based on this historical data:
- What is the probability that a user converts in any given month?
- If a user converts, what is the probability that they visited the website in October 2023?
- If you know that 30,000 users visited the website in October 2023 and 900 of them converted, how would this information update your previous probabilities?
Solution:
-
Probability that a user converts in any given month:
This is calculated by the total number of conversions divided by the total number of users.
P ( Convert ) = C U = 3600 120000 = 0.03 P(\text{Convert}) = \frac{C}{U} = \frac{3600}{120000} = 0.03 P(Convert)=UC=1200003600=0.03
So, the probability that a user converts in any given month is 0.03 or 3%.
- Probability that a user visited in October 2023 given that they converted:
Let’s denote:
$$- U_{oct} as the number of users who visited in October 2023
- C_Oct as the number of conversions in October 2023
- You are given that U_{Oct} = 30,000 and C_{Oct} = 900.
$$
The probability that a user visited in October 2023 given that they converted can be calculated using Bayes’ theorem:
P ( Visited in October ∣ Converted ) = P ( Converted ∣ Visited in October ) ⋅ P ( Visited in October ) P ( Converted ) P(\text{Visited in October} \mid \text{Converted}) = \frac{P(\text{Converted} \mid \text{Visited in October}) \cdot P(\text{Visited in October})}{P(\text{Converted})} P(Visited in October∣Converted)=P(Converted)P(Converted∣Visited in October)⋅P(Visited in October)
From the data:
P
(
C
o
n
v
e
r
t
e
d
∣
V
i
s
i
t
e
d
i
n
O
c
t
o
b
e
r
)
=
C
O
c
t
U
O
c
t
=
900
30000
=
0.03
P
(
Visited in October
)
=
U
O
c
t
U
=
30000
120000
=
0.25
P(Converted | Visited in October) = \frac{C_{Oct}}{U_{Oct}} = \frac{900}{30000} = 0.03 \\ P(\text{Visited in October}) = \frac{U_{Oct}}{U} = \frac{30000}{120000} = 0.25
P(Converted∣VisitedinOctober)=UOctCOct=30000900=0.03P(Visited in October)=UUOct=12000030000=0.25
- P(Converted) = 0.03 (from the first part)
Now plug these values into the formula:
P ( Visited in October ∣ Converted ) = 0.03 ⋅ 0.25 0.03 = 0.25 P(\text{Visited in October} \mid \text{Converted}) = \frac{0.03 \cdot 0.25}{0.03} = 0.25 P(Visited in October∣Converted)=0.030.03⋅0.25=0.25
So, the probability that a user visited in October 2023 given that they converted is 0.25 or 25%.
-
Updating the probabilities with the new information:
With the new information, we see that the conversion rate in October 2023 is consistent with the historical conversion rate. Thus, our previous probabilities remain valid. However, the specific probability for October can be directly calculated as follows:
- Updated Conversion Probability for October 2023:
P ( Convert in October 2023 ) = C O c t U O c t = 900 30000 = 0.03 P(\text{Convert in October 2023}) = \frac{C_{Oct}}{U_{Oct}} = \frac{900}{30000} = 0.03 P(Convert in October 2023)=UOctCOct=30000900=0.03
Problem2:
You are given the following information about the customers of an e-commerce website:
- 30% of the customers are from the USA (Event A).
- 20% of the customers who are from the USA make at least one purchase per month (Event B given A).
- 10% of the customers who are not from the USA make at least one purchase per month (Event B given not A).
Let P(A) be the probability that a customer is from the USA and P(B) be the probability that a customer makes at least one purchase per month.
- Calculate the probability that a randomly selected customer makes at least one purchase per month, P(B).
- Given that a customer makes at least one purchase per month, what is the probability that the customer is from the USA, P(A|B)?
Solution:
- To find P(B), we use the law of total probability:
P ( B ) = P ( B ∣ A ) P ( A ) + P ( B ∣ ¬ A ) P ( ¬ A ) P(B) = P(B|A)P(A) + P(B|\neg A)P(\neg A) P(B)=P(B∣A)P(A)+P(B∣¬A)P(¬A)
Where:
- ( P(A) = 0.30 )
- ( P(B|A) = 0.20 )
- ( P(\neg A) = 1 - P(A) = 0.70 )
- ( P(B|\neg A) = 0.10 )
Calculating P(B):
[ P(B) = (0.20 \times 0.30) + (0.10 \times 0.70) ]
[ P(B) = 0.06 + 0.07 ]
[ P(B) = 0.13 ]
So, the probability that a randomly selected customer makes at least one purchase per month is 0.13 or 13%.