[go: up one dir, main page]

0% found this document useful (0 votes)
26 views8 pages

Bayesian Sample Questions

The document explains Bayes' Theorem and its application in various scenarios, including smart traffic management, medical diagnosis, delivery delay prediction, and more. It outlines the components of Bayesian inference such as hypothesis, data, prior, likelihood, evidence, and posterior, providing definitions and examples for each. Additionally, it discusses the pros and cons of the Bayesian approach, highlighting its ability to incorporate prior knowledge and update beliefs with new data while noting its computational intensity and subjectivity in prior selection.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views8 pages

Bayesian Sample Questions

The document explains Bayes' Theorem and its application in various scenarios, including smart traffic management, medical diagnosis, delivery delay prediction, and more. It outlines the components of Bayesian inference such as hypothesis, data, prior, likelihood, evidence, and posterior, providing definitions and examples for each. Additionally, it discusses the pros and cons of the Bayesian approach, highlighting its ability to incorporate prior knowledge and update beliefs with new data while noting its computational intensity and subjectivity in prior selection.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Bayes’ Theorem:

Posterior=Likelihood × Prior\Evidence

P(H∣D) = P(D∣H) × P(H)


P(D)
Where:
 H = Hypothesis (e.g., "There is a traffic jam")
 D = Data/Observation (e.g., "Low speed, high vehicle count")

Component Simple Definition

Hypothesis
The assumption you're testing.
(H)

Data (D) The new evidence you observe.

Prior P(H) Your belief in the hypothesis before seeing the new data.

Likelihood The chance of seeing the current data if the hypothesis is


P(D∣H) true.

The overall chance of seeing the data, regardless of hypothesis


Evidence P(D)
(used for normalisation).

Posterior
Your updated belief in the hypothesis after seeing the data.
P(H∣D)

1. Smart Traffic Management (IoT + Bayesian Inference)


Scenario:
You are designing a smart traffic system for a smart city that aims to predict
congestion at traffic lights based on vehicle sensor data and historical congestion
patterns. The system should decide in real time whether to extend or shorten
green light duration.
Question:
Formulate how Bayesian inference can be used to estimate the probability of a
traffic jam forming in the next 5 minutes at a junction. Describe the prior,
likelihood, and how sensor data (vehicle counts, speed, weather) would update
this estimate.

Component Definition

Hypothesis
"A traffic jam will happen in the next 5 minutes."
(H)

Data (D) Sensors show high vehicle count, low speed, rainy weather.

Prior P(H) From history, jams happen 30% of the time at this junction at 5
Component Definition

PM.

Likelihood If a jam is really happening, how likely is it to see 65 cars and 8


P(D∣H) km/h speed?

Evidence P(D) How likely is it to see 65 cars and 8 km/h speed in general?

Posterior Now that we see the data, what's the probability there will be a
P(H∣D) jam?

2. Medical Diagnosis Support System


Scenario:
You are working on a decision support system for general practitioners. The
system uses patient symptoms, test results, and prior disease prevalence to
suggest possible diagnoses.
Question:
Explain how Bayesian inference can be used to estimate the probability that a
patient has a specific disease (e.g. pneumonia) based on symptoms (e.g. cough,
fever) and test results. How would the prior be determined? How would the
likelihood be calculated?

Component Definition

Hypothesis
Patient has disease A (e.g., pneumonia)
(H)

Patient has symptoms (e.g., fever, cough), test results (e.g., X-


Data (D)
ray), etc.

How common disease A is in the general population (e.g.,


Prior P(H)
prevalence from hospital records)

Likelihood If the patient has disease A, how likely are these symptoms and
P(D∣H) test results?

Evidence Overall probability of seeing this set of symptoms and results in


P(D) any patient

Posterior Updated probability of disease A after observing the symptoms


P(H∣D) and results

3. Delivery Delay Prediction in Logistics


Scenario:
Your company runs a parcel delivery service. You want to estimate the likelihood
of a package arriving late based on weather conditions, traffic reports, and driver
performance.
Question:
How would you apply Bayesian inference to predict delivery delays? Define the
prior (e.g., base delay rate), likelihood (based on traffic/weather conditions), and
posterior. How would this help optimize delivery planning?

Component Definition

Hypothesis
Package is late
(H)

Unfavourable weather conditions, traffic reports, and driver


Data (D)
performance.

Base rate of delays, e.g., 10% of packages arrive late under


Prior P(H)
normal conditions

If the package is late, what’s the likelihood of data being


Likelihood
true(Unfavourable weather conditions, traffic reports, and driver
P(D∣H)
performance. )

Overall probability of seeing Unfavourable weather conditions,


Evidence P(D)
traffic reports, and driver performance.

Posterior
Probability of package being late given the latest data
P(H∣D)

Previous year question:


You are working for Nile, a leading e-commerce platform, to improve their
logistics service (product delivery). The task involves identifying the most
efficient route for multiple delivery vehicles, considering distance and traffic
conditions.
Consequently, it has been agreed that the initial route solutions, determined by
the heuristic optimisation algorithm, should be refined using Bayesian inference
to account for uncertainties in traffic conditions.
Describe a Bayesian approach to further refining these results based on
real-time information such as traffic data. Detail how the Bayesian model would
incorporate this information to update our initial expectations. Describe how you
would combine the two models to determine routes for your drivers.

Component Definition

Hypothesis
Route has delay
(H)

Unfavourable weather conditions, traffic reports, and driver


Data (D)
performance.

Prior P(H) Historic rate of delays in that route

Likelihood The probability of seeing the observed conditions if the route is


Component Definition

actually delayed (e.g., delays often coincide with bad traffic


P(D∣H)
and poor weather).

Overall probability of seeing Unfavourable weather conditions,


Evidence P(D)
traffic reports, and driver performance irrespective of the delay

Posterior
Probability of route being delayed given the latest data
P(H∣D)

• You work as a product manager at a smartphone company. Your prototype


has been tested and been shown to have an average battery life of 10
hours (normal distribution, σ = 0.5).

• Following a software update, you collect data from 20 new phones


(new_data.csv) in which the battery life is x = 14, σ = 2.

• How much should we trust the new data?


• How much should we trust the prototype data?
• What is the real battery life?
• Would your expectation change if we had more data from the new
phones?

Component Corrected Definition (Battery Life Scenario)

Hypothesis The true average battery life μ has changed (possibly ≠ 10


(H) hours).

Data (D) Sample of 20 phones after software update: x̄ = 14, σ = 2.

Belief that battery life is centered around 10 hours (e.g.


Prior P(H)
Normal(10, 0.5²)).

Probability of observing a sample mean of 14 (given sample


Likelihood
size 20 and sample σ = 2) under the assumption that μ has
P(D∣H)
changed

Evidence Total probability of observing x̄ = 14 across all plausible μ


P(D) values.

Posterior Updated belief (distribution) about μ after seeing the new


P(H∣D) sample.

🏫 2. Exam Grading Bias Detection


Scenario:
You suspect that a specific examiner tends to grade more harshly. From historical
data, their average grade is 5 marks lower than others.
This year, the mean grade difference from this examiner's class is 7 marks lower
across 15 students.
Question:
Using Bayesian inference, how can you update your belief about whether this
examiner is grading unfairly?

Corrected Definition (Battery Life


Component
Scenario)

Hypothesis
(H)

Data (D)

Prior P(H)

Likelihood
P(D∣H)

Evidence P(D)

Posterior
P(H∣D)

📦 3. Warehouse Robot Performance


Scenario:
Your warehouse uses robots to move packages. Normally, a robot drops a
package once every 1000 deliveries. After a software update, one robot dropped
3 packages in 500 deliveries.
Question:
Should you believe the robot is malfunctioning? Use Bayesian inference to
update your belief.

Component Corrected Definition (Battery Life Scenario)

Hypothesis
Robot is malfunctioning
(H)

Data (D) One robot dropped 3 packages in 500 deliveries.

Normally, a robot drops a package once every 1000


Prior P(H)
deliveries

Likelihood Probability of robot dropping 3 packages in 500 deliveries


P(D∣H) under the assumption that robot is malfunctioning

Total probability of observing one robot drop 3 packages in


Evidence
500 deliveries regardless of whether the robot is faulty or
P(D)
not

Posterior The updated probability that the robot is faulty, given that
P(H∣D) it dropped 3 in 500.
📱 4. App Crash Probability After Update
Scenario:
You released a new version of a mobile app. Historically, crash rate is 1%. After
the update, 10 out of 500 users report crashes.
Question:
Use Bayesian inference to estimate whether the new version has increased the
likelihood of crashing.

Corrected Definition (Battery Life


Component
Scenario)

Hypothesis
(H)

Data (D)

Prior P(H)

Likelihood
P(D∣H)

Evidence P(D)

Posterior
P(H∣D)

🛒 5. E-commerce Cart Abandonment


Scenario:
An online store observes an increase in cart abandonment. Historically, 25% of
users abandon carts. On a new checkout design, 35 out of 100 do.
Question:
Is this increase statistically significant? Use Bayesian inference to determine the
probability that the new design increased abandonment.

Corrected Definition (Battery Life


Component
Scenario)

Hypothesis
(H)

Data (D)

Prior P(H)

Likelihood
P(D∣H)
Corrected Definition (Battery Life
Component
Scenario)

Evidence P(D)

Posterior
P(H∣D)

The Cumulative Distribution Function (CDF) of a random variable gives the


probability that the variable takes a value less than or equal to a
certain number.
 For example, if the CDF at 70 is 0.85, it means there's an 85% chance the
value is less than or equal to 70.
Key Points:
 The CDF always ranges from 0 to 1.
 It is non-decreasing.
 It helps visualize the overall distribution of data.
Here are clear, exam-friendly pros and cons of the Bayesian approach:

✅ Pros of Bayesian Approach


1. Incorporates prior knowledge
– Allows using existing knowledge or expert belief before observing data.
2. Updates beliefs with new data
– Naturally handles learning from new evidence (posterior becomes new
prior).
3. Handles uncertainty well
– Provides a full probability distribution, not just point estimates.
4. Works well with multiple sources of data
5. Works well with small data
– More robust than frequentist methods when data is limited.
6. Flexible modeling
– Can handle complex models like hierarchical structures or missing data.

❌ Cons of Bayesian Approach


1. Computationally intensive
– Requires complex calculations, especially in large models (e.g., MCMC).
2. Choice of prior can be subjective
– Results may be sensitive to the prior if not chosen carefully.
3. Harder to explain to non-experts
– Requires understanding of probability distributions and Bayes' rule.
4. Slower with big data
– Can be less scalable compared to other fast machine learning methods.

You might also like