Mathematics: Analysis and Approaches Higher Level
Internal Assessment
Exploring the use of Bayes’ Theorem in Marketing with the
Case Study of Taget’s Pregnancy Prediction Score
2
Table of Contents
Title Page......................................................................................................................................... 1
Table of Contents............................................................................................................................. 2
Introduction......................................................................................................................................3
Mathematical Background and Derivation...................................................................................4-9
Target Pregnancy Prediction Case Study..................................................................................10-12
Outcomes of Target’s use of Bayes’ Theorem..................................................................... 13-asasd
Conclusion................................................................................................................................ asdad
Works Cited......................................................................................................................... asdasdas
3
Introduction:
Businesses rely heavily on data and predictive probability to infer customer behavior and
make decisions regarding marketing strategies. One of the most powerful probability tools is
Bayes’ Theorem, a method that updates probabilities of future events (or customer profiles) with
regards to the past. Companies like Amazon, Google, Netflix, and Target all use this tool of
predictive analytics to personalize recommendations, optimize ad targeting, and even predict
major life events such as pregnancies in their customers.
My topic is Bayes’ Theorem and the applications of that theory to predict future
consumer behavior. My interest in this topic came from a summer e-marketing class I took in
Hong Kong. I was fascinated by how marketers could predict future behavior and send targeted
ads. The professor used an example based upon the retailer Target’s customer profiling method
that was able to accurately predict that a customer was pregnant based solely upon what that
person purchased. I later found an article written by Kashmir Hill for Forbes about how Target
could predict a pregnancy before even the woman knew. This then combined with my interest in
behavioral economics, my college major, and was the motivation for writing this IA about
customer segmentation and Bayes’ Theorem. The real-world applications of mathematics, and
specifically probability theory fascinate me which leads me to write this investigation about how
Bayesian inference can be used to model and predict consumer behavior. In this paper, I seek to
understand how and why Target can so accurately predict customer behavior using only purchase
data.
Therefore, the research question of this investigation is: “How can Bayes’ Theorem be
used to mathematically model and predict customer profiles of purchasing behavior for targeted
segmentation in marketing?”
4
Mathematical Background and Derivation of Bayes’ Theorem:
To start, the definition of Bayes’ Theorem is as follows:
𝑃(𝐵|𝐴)𝑃(𝐴)
𝑃(𝐴|𝐵) = 𝑃(𝐵)
This equation allows us to invert the probability of event B given that event A into the
probability of event A given that event B has already occurred. This is known as a conditional
probability, or the posterior probability of A given B.
P(A) is the probability of event A happening, or the marginal probability. It is called the
marginal probability because it is the probability of event A without any knowledge of event B.
P(B) is the probability of event B and is also the marginal probability of event B without
knowledge of event A. This is the likelihood of an event regardless of the outcome of another
variable.
P(B|A) is a conditional probability, like P(A|B), because it requires event A to have
occurred. P(B|A) is the probability of event B occurring given that A is true. Note, that because
conditional probabilities hinge on an event occurring, the probability of that prior event cannot
be zero. For instance, there can be no P(A|B) if event B has not occurred.
By definition, the probability of event A occurring given that event B has occurred is the ratio of
the joint probability of both events A and B occuring to the marginal probability of event B:
𝑃(𝐴∩𝐵)
𝑃(𝐴|𝐵) = 𝑃(𝐵)
5
Similarly, the probability of event B occurring given that event A has occurred is the ratio of the
joint probability of both events A and B occuring to the marginal probability of event A:
𝑃(𝐴∩𝐵)
𝑃(𝐵|𝐴) = 𝑃(𝐴)
These conditional probabilities rely on joint probabilities (ex. P(A∩B) and P(B∩A),
where we know P(A∩B)=P(B∩A) ) which are the probabilities of both events A and B
occurring.
These joint probabilities are written as 𝑃(𝐴 ∩ 𝐵) using the equations:
𝑃(𝐴 ∩ 𝐵) = 𝑃(𝐴|𝐵)𝑃(𝐵)
𝑃(𝐴 ∩ 𝐵) = 𝑃(𝐵|𝐴)𝑃(𝐴)
Then these equations are set equal to each other:
𝑃(𝐴|𝐵)𝑃(𝐵) = 𝑃(𝐵|𝐴)𝑃(𝐴)
Then P(A|B) is isolated:
𝑃(𝐵|𝐴)𝑃(𝐴)
𝑃(𝐴|𝐵) = 𝑃(𝐵)
6
Note that this is the definition of Bayes’ Theorem.
However, Bayes’ Theorem can be generalized using the Law of Total Probability:
𝑛
𝑃(𝐵) = ∑ 𝑃(𝐵|𝐴𝑖)𝑃(𝐴𝑖)
𝑖=1
The Law of Total Probability is the total probability of event B, given that event B can happen
due to several probable causes which are represented using 𝐴𝑖.
To explain this law, imagine there are 2 bags of red and blue marbles:
● The probability of drawing a blue marble is P(B)
● The probability of drawing from bag 1 is P(𝐴1) = 0.6
● The probability of drawing from bag 2 is P(𝐴2) = 0.4
● Bag 1 and Bag 2 have different numbers of blue and red marbles, thus have
different probabilities for drawing a blue marble.
● The probability of drawing a blue marble in bag 1 is written as P(𝐵|𝐴1) = 0.3, or
the probability of drawing a blue marble, given that bag 1 has been chosen is
30%.
● Likewise, the probability of bag 2 is written as P(𝐵|𝐴2) = 0.5
To find the overall probability of drawing a blue marble (P(B)), regardless of which bag picked
one would use the expression:
𝑃(𝐵) = 𝑃(𝐵|𝐴1)𝑃(𝐴1) + 𝑃(𝐵|𝐴2)𝑃(𝐴2)
7
𝑃(𝐵) = (0. 3)(0. 6) + (0. 5)(0. 4)
𝑃(𝐵) = 0. 18 + 0. 2 = 0. 38
Essentially, this expression is just stating that the total probability of drawing a blue
marble is equal to the probability of choosing a blue marble in bag 1 multiplied by the
probability of drawing from bag 1 added to the probability of drawing a blue marble in bag 2
multiplied by the probability of choosing bag 2.
To condense that statement, it is the total probability of an event happening (drawing a
blue marble), given that another prior event (whether bag 1 or 2 is chosen) influences the
probability of that event (drawing a blue marble in that respective bag).
Using the law of total probability, Bayes’ Theorem can be rewritten as:
𝑃(𝐵|𝐴𝑘)𝑃(𝐴𝑘) 𝑃(𝐴𝑘∩𝐵)
𝑃(𝐴𝑘|𝐵) = 𝑛 = 𝑛
∑ 𝑃(𝐵|𝐴𝑖)𝑃(𝐴𝑖) ∑ 𝑃(𝐵|𝐴𝑖)𝑃(𝐴𝑖)
𝑖=1 𝑖=1
𝑃(𝐴𝑘∩𝐵)
= 𝑛
∑ 𝑃(𝐴𝑖∩𝐵)
𝑖=1
𝐴𝑖 is the representation of all possible causes that could lead to event B. 𝐴𝑘 is the specific
event that has been singled out. To exemplify this generalized rule, imagine now drawing a blue
8
marble from one of 3 bags, each bag has a different probability of being chosen, and the ratio of
red to blue marbles are different in each bag.
This concept is most easily demonstrated through the use of a tree diagram:
This is a general explanation of Bayes’ Theorem and its generalization. However, this
investigation uses the example of marketing. Very generally, companies leverage prior customer
data (event B in my initial equation) to then create a Bayesian Inference to anticipate the needs
of customers and personalize marketing strategies (event A).
9
A Note about Citations: All examples (numbers, diagrams, equations) for this section
were fully independently generated. Though no quotes have been used, I did take inspiration for
the explanation and diagrams from the works of Donald Berry, Greg Allenby, and Peter Rossi
(all of which are cited below).
10
Target Pregnancy Prediction Case Study:
Humans are creatures of habit, and they tend to follow these habits very predictably.
However, whenever a major life event occurs, there are certain windows of time for those habits
to change. One particularly notable example is when someone is having a baby. During
pregnancy, women particularly experience a significant period of change, physically and
psychologically which reflects in their buying habits and increases their flexibility to change
their spending habits (Duhigg The Power). For example, pregnant women are more likely to
become allergic or sensitive to product additives, so are more likely to buy fragrant free or
hypoallergenic versions of a product. Changes in purchasing patterns like this are picked up as
potential indicators of pregnancy. Depending on the items being purchased, the retailer may even
be able to speculate what trimester of pregnancy the person is in.
Because pregnancy is an event that makes routines pliable, it is imperative for companies
to capitalize on this newfound flexibility. One way the retailer Target found to get ahead of its
competitors was to use Bayes’ Theorem to predict pregnancy. It sought to identify and direct
targeted advertisements to pregnant people promptly, to get ahead of competitors and offer better
deals to the consumer throughout pregnancy. To do this, Target analyzed the historical data it had
collected from its consumers which was simple because Target assigns every customer a specific
Guest ID number. This number is tied to a customer’s name, credit card, email address, etc.
which stores a history of everything that person has bought.
Target then analyzed what markers were common in people who were later confirmed to
be pregnant. These markers were demographical like age and gender, but also based on purchase
history. Through an analysis of this data, they found that pregnant women often bought:
11
unscented lotions, vitamin supplements, cotton balls, hand sanitizers, and other similar products.
These purchases became predictive signals which could indicate a pregnancy.
Given these common purchases, Target’s statisticians built a predictive model to estimate
the likelihood that a customer was pregnant. This model assigned a “pregnancy prediction score”
based on the purchase history of a given customer which employs Bayes’ Theorem to make a
Bayesian Inference which updated the probability of a customer.
A simple version of this calculation might look something like this:
𝑃(𝐵|𝐴)𝑃(𝐴)
𝑃(𝐴|𝐵) = 𝑃(𝐵)
● Probability A: The likelihood that a customer is pregnant
● Probability B: The probability a customer buys one of the identified pregnancy
related products
● Probability of B|A is the likelihood of buying a given product given the customer
is pregnant
According to Bayes’ Theorem, a store can predict the probability that a customer is
pregnant, given the purchase of a pregnancy-related item. This can be calculated because of
Bayes’ Theorem and the fact that prior data gathered from the large customer base can be used
and future information can be inserted into this equation. For example, the probability A of a
customer being pregnant can change based on age, gender, and location of the store.
Furthermore, the probability of a customer purchasing a pregnancy related product can be
12
updated by adding or subtracting items from the list of pregnancy related products which will
influence the probability that a pregnant person will purchase a pregnancy linked item.
For each additional purchase from the pregnancy-related list, the posterior probability
was updated, increasing the confidence in the prediction. This confidence in this prediction can
be refined to even estimate the gestational stage of a pregnancy and due date.
An example of this is that if a customer purchases prenatal vitamins for the first time
followed by maternity clothes months later, the model adjusts the estimated due date to allow
Target to time their advertisements. Ex. sending diaper coupons around the expected due date
rather than risk being too early or too late (both of which would be a waste of resources to the
company and unhelpful to the consumer).
13
Outcomes of Target’s Pregnancy Prediction:
There were many results of Target’s implementation of Bayes’ Theorem to predict
pregnancy and target advertisements. The first outcome of this Pregnancy Prediction algorithm
was its accuracy. Andrew Pole, a head statistician for Target, was quoted saying that the
pregnancy prediction score “... was remarkably accurate, estimating a woman’s due date with a
staggering 90% precision” (Akande). Through this case study, Target demonstrated how truly
powerful, and accurate Bayesian inferences could be.
Given this high accuracy, Target’s Guest Analytics division was nothing short of staggering with
an estimated additional $600 million per year to Target’s revenue.
However, there were serious ethical concerns about customer privacy and transparency.
Strategies to avoid creepiness - not sending only baby-related coupons to make the ads feel less
target which reduced the creepiness factor while still maintaining marketing effectiveness
Integrating Bayesian methods has enabled companies like Target to more precisely target
and identify customer needs to personalize marketing efforts. This use of Bayes’ Theorem
increases the effectiveness of marketing campaigns and optimizes the allocation of resources.
According to Harry V. Roberts in the Journal of Marketing, Bayesian statistics provide a robust
framework for decision making under uncertainty, allowing marketers to incorporate prior
knowledge and continuously update their strategies based on new data.
The success around predictive analytics have prompted a broader industry reflection on
data usage with companies now being more cautious about measures to anonymize data to
minimize backlash and lessen the creep factor
14
Results and outcomes
- Implementation of Predictive Analytics
- Customer Reactions
Ethical considerations
- Privacy Concerns
- Corporate Responsibility
15
Conclusions:
This investigation has explored how Bayes’ Theorem can be derived with two or
infinitely many events.
Bayes’ Theorem can be applied to predict customer purchasing behavior which can be
leveraged in marketing strategies exemplified through the marketing strategies used by Target to
identify expectant mothers. Through an analysis of Bayesian probability, I have sought to
demonstrate how prior probabilities can be updated with new data to refine predictions.
Companies leverage this approach to optimize targeted advertising, improving both the
efficiency of their marketing efforts and customer engagement.
A key focus of this study is how Bayesian methods allow businesses to make highly
accurate predictions based on patterns in consumer behavior.
However, this investigation is significantly limited in scope. There are further
applications in how these predictive models can be used to retain customers through loyalty
programs and identify future customer value (or lifetime value). Furthermore, this investigation
only focuses on the sector of marketing and customer segmentation. There are further
applications of the Bayesian Inference such as in finance to assess credit risk and detect fraud, in
healthcare to diagnose diseases, and in machine learning or artificial intelligence to enhance
personalized recommendation algorithms.
In conclusion, Bayesian probability provides a powerful framework for predicting
consumer behavior with a high degree of accuracy. The learning from seemingly random events
to yield accurate predictions may be unsettling customers.
16
17
Works Cited
Akande, Toba. “Target Predicted It Customer's Pregnancy and Made Billions.” Medium,
Medium, 2 Oct. 2023,
[Link]/target-predicted-it-customers-pregnancy-and-made-billi
ons-578131e83375. Accessed 11 Mar. 2025.
Allenby, Greg M., and Peter E. Rossi. “Teaching Bayesian Statistics to Marketing and Business
Students.” The American Statistician, vol. 62, no. 3, 2008, pp. 195–98. JSTOR,
[Link] Accessed 11 Mar. 2025.
Assmus, Gert. “Bayesian Analysis for the Evaluation of Marketing Research Expenditures: A
Reassessment.” Journal of Marketing Research, vol. 14, no. 4, 1977, pp. 562–68. JSTOR,
[Link] Accessed 11 Mar. 2025.
Berry, Donald A. Statistics: A Bayesian Perspective. Duxbury Press, 1996.
Duhigg, Charles. “How Companies Learn Your Secrets.” The New York Times, The New York
Times, 16 Feb. 2012, [Link]/2012/02/19/magazine/[Link].
Accessed 11 Mar. 2025.
Duhigg Charles. The Power of Habit. Memories of Ages Press, 2021.
Green, Paul E., and Ronald E. Frank. “Bayesian Statistics and Marketing Research.” Journal of
18
the Royal Statistical Society. Series C (Applied Statistics), vol. 15, no. 3, 1966, pp.
173–90. JSTOR, [Link] Accessed 11 Mar. 2025.
Hill, Kashmir. “How Target Figured out a Teen Girl Was Pregnant before Her Father Did.”
Forbes, Forbes Magazine, 20 Feb. 2024,
[Link]/sites/kashmirhill/2012/02/16/how-target-figured-out-a-teen-girl-was-pr
egnant-before-her-father-did/. Accessed 11 Mar. 2025.
Wu, Jiexing, et al. “Bayesian Inference for Assessing Effects of Email Marketing Campaigns.”
Journal of Business & Economic Statistics, vol. 36, no. 2, 2018, pp. 253–66. JSTOR,
[Link] Accessed 11 Mar. 2025.