Medical Follow-up Planning Practice Problem
This data science coding problem helps you practice Probability Fundamentals, medical follow-up planning, and implementation skills. Read the problem statement, write your solution, and strengthen your understanding of Probability Fundamentals.
- Problem ID: 228
- Problem key: 228-medical-follow-up-planning
- URL: https://datacrack.app/solve/228-medical-follow-up-planning
- Difficulty: medium
- Topic: Probability Fundamentals
- Module: Probability
Problem Statement
# 🧩 Medical Follow-up Planning
---
### 🎯 Goal
Calculate the probability that a patient needs exactly one type of follow-up test.
---
### 💻 Task
A clinic reviews 1,000 patients.
- 220 patients need a blood test.
- 180 patients need an imaging test.
- 330 patients need at least one of these two tests.
The clinic wants to know the probability that a randomly selected patient needs exactly one of the two tests.
Implement `exactly_one_followup(total_patients, blood, imaging, at_least_one)`.
---
### 📥 Input
- `total_patients`: total number of reviewed patients.
- `blood`: number of patients who need a blood test.
- `imaging`: number of patients who need an imaging test.
- `at_least_one`: number of patients who need at least one of the two tests.
---
### 📤 Output
- Return the probability that a randomly selected patient needs exactly one of the two tests.
- Round the result to 6 decimals.
---
### 🧩 Starter Code
```python
def exactly_one_followup(total_patients, blood, imaging, at_least_one):
pass
```
---
### 💡 Example
```python
exactly_one_followup(1000, 220, 180, 330)
```
The function should return the requested probability as a decimal rounded to 6 decimals.
---
### ⚠️ Common Mistakes
- Treating patients who need both tests as exactly-one-test patients.
- Assuming the shared group is given directly.
- Returning a patient count instead of a probability.
Starter Code
def exactly_one_followup(total_patients, blood, imaging, at_least_one):
pass