0% found this document useful (0 votes)
23 views3 pages

Question 2: (5 PTS) (Bayes Theorem)

The document discusses the application of Bayes' theorem to predict customer purchase behavior based on whether they viewed a product video, concluding that the probability of purchase given video viewing is 0.8. It also presents a Bayesian network scenario involving car noises caused by loose parts or engine failure, providing calculations for joint distributions and conditional probabilities related to fuel efficiency and engine failure. Key results include the probability of poor fuel efficiency being 0.19 and the likelihood of engine failure given specific conditions being approximately 0.5814.

Uploaded by

fayazcui24
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views3 pages

Question 2: (5 PTS) (Bayes Theorem)

The document discusses the application of Bayes' theorem to predict customer purchase behavior based on whether they viewed a product video, concluding that the probability of purchase given video viewing is 0.8. It also presents a Bayesian network scenario involving car noises caused by loose parts or engine failure, providing calculations for joint distributions and conditional probabilities related to fuel efficiency and engine failure. Key results include the probability of poor fuel efficiency being 0.19 and the likelihood of engine failure given specific conditions being approximately 0.5814.

Uploaded by

fayazcui24
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Question 2: (5 pts) (Bayes Theorem)

You are trying to predict whether a customer will make a purchase or not. You have a dataset that shows that 80% of
customers who make a purchase also viewed a product video, and 20% of customers who did not make a purchase
also viewed a product video. Given that a customer viewed a product video, what is the probability that they will make
a purchase?
(Note: The probaility of making a purchased and not making a purchased is assumed to be 1, same is for the probability of viewed
and not viewed.)

In this question, we are trying to find the probability that a customer will make a purchase given that they
viewed a product video.
This is represented by P(Purchase|Viewed).

To calculate this probability, we use Bayes' theorem, which states that P(A|B) = P(B|A) * P(A) / P(B).

In this case, A is the event of making a purchase and B is the event of viewing a product video.

We are given the following information:

P(Viewed|Purchase) = 0.8, which is the probability that a customer who makes a purchase also viewed a
product video.
P(Viewed|¬Purchase) = 0.2, which is the probability that a customer who did not make a purchase also
viewed a product video.
We are asked to find P(Purchase|Viewed) using Bayes' theorem.

So, P(Purchase|Viewed) = P(Viewed|Purchase) * P(Purchase) / P(Viewed)

P(Purchase) and P(Viewed) are not given in the question, so we have to assume that P(Purchase) +
P(¬Purchase) = 1 and P(Viewed) + P(¬Viewed) = 1,

where P(¬Purchase) is the probability of not making a purchase and P(¬Viewed) is the probability of not
viewing a product video.

We know that P(Purchase) + P(¬Purchase) = 1 so

P(¬Purchase) = 1 - P(Purchase)

So, substituting this value in the above equation we get:

P(Purchase|Viewed) = (0.8 * P(Purchase)) / (0.8 * P(Purchase) + 0.2 * (1 - P(Purchase)))

And simplifying the equation we get


P(Purchase|Viewed) = 0.8

So, the probability that a customer will make a purchase given that they viewed a product video is 0.8
Question 4: (15 pts)
The appearance of a strange noise (N) in a car can be caused either by a loose part (L) or a failing engine (E). The
latter event also causes poor fuel efficiency (F). The Bayesian network and corresponding conditional probability
tables for this situation are shown below.

𝑷(𝑳) 𝑷(𝑬)
+𝑙 0.4
L E +𝑒 0.1
−𝑙 0.6 −𝑒 0.9

𝑷(𝑵|𝑳,𝑬)
+𝑙 +𝑒 +𝑛 1.0 N F 𝑷(𝑭|𝑬)
+𝑙 +𝑒 −𝑛 0.0 +𝑒 +𝑓 1.0
+𝑙 −𝑒 +𝑛 0.8 +𝑒 −𝑓 0.0
+𝑙 −𝑒 −𝑛 0.2 −𝑒 +𝑓 0.1
−𝑙 +𝑒 +𝑛 0.3 −𝑒 −𝑓 0.9
−𝑙 +𝑒 −𝑛 0.7
−𝑙 −𝑒 +𝑛 0.1
−𝑙 −𝑒 −𝑛 0.9

a) Compute the following entry from the joint distribution:


𝑷(−𝒍, −𝒏, −𝒆, −𝒇) = 𝐏(−𝐥)𝐏(−𝐞)𝐏(−𝐧|−𝐥, −𝐞)𝐏(−𝐟| − 𝐞) 𝟎. 𝟔 ∗ 𝟎. 𝟗 ∗ 𝟎. 𝟗 ∗ 𝟎. 𝟗 = 𝟎. 𝟒𝟑𝟕𝟒 this is
achieved by expanding the joint distribution according to the chain rule of conditional probability.
b) What is the probability that the fuel efficiency is poor?
𝑷(+𝒇) = 𝑷(+𝒇|+𝒆)𝑷(+𝒆) + 𝑷(+𝒇|−𝒆)𝑷(−𝒆) = (𝟏. 𝟎)(𝟎. 𝟏) + (𝟎. 𝟏)(𝟎. 𝟗) = 𝟎. 𝟏𝟗 by marginalizing out
m according to the law of total probability.
c) Given poor fuel efficiency, what is the probability of engine failure?
𝑷(+𝒇| + 𝒆)𝑷(+𝒆) (𝟏. 𝟎)(𝟎. 𝟏)
𝑷(+𝒆| + 𝒇) = = ≈ 𝟎. 𝟓𝟐𝟔𝟑
𝑷(+𝒇) (𝟎. 𝟏𝟗)
d) Given noise in the car, poor fuel efficiency, and a loose part, what is the likelihood of an engine failure?
𝑷(+𝒆, +𝒏, +𝒇, +𝒍) 𝑷(+𝒍)𝑷(+𝒆)𝑷(+𝒏| + 𝒍, +𝒆)𝑷(+𝒇| + 𝒆)
𝑷(+𝒆| + 𝒏, +𝒇, +𝒍) = =
∑𝒆 𝑷(+𝒆, +𝒏, +𝒇, +𝒍) ∑𝒆(+𝒍)𝑷(𝒆)𝑷(+𝒏| + 𝒍, 𝒆)𝑷(+𝒇|𝒆)

(0.4)(0.1)(1.0)(1.0) 0.04
= = ≈ 0.5814
(0.4)(0.1)(1.0)(1.0) + (0.4)(0.9)(0.8)(0.1) 0.04 + 0.0288
e) If there is an engine failure, what is the probability of a loose part being present in the car?
𝑷(+𝒍| + 𝒆) = 𝑷(+𝒍) = 𝟎. 𝟒

You might also like