Server Security Investigation Practice Problem
This data science coding problem helps you practice Probability Fundamentals, server security investigation, and implementation skills. Read the problem statement, write your solution, and strengthen your understanding of Probability Fundamentals.
- Problem ID: 229
- Problem key: 229-server-security-investigation
- URL: https://datacrack.app/solve/229-server-security-investigation
- Difficulty: hard
- Topic: Probability Fundamentals
- Module: Probability
Problem Statement
# 🧩 Server Security Investigation
---
### 🎯 Goal
Calculate the probability that a server request is ultimately investigated.
---
### 💻 Task
A company analyzes 80,000 server requests.
- 14,400 requests come from suspicious IP addresses.
- 11,200 requests trigger abnormal traffic detection.
- 20,800 requests trigger at least one of these two automated checks.
The security system handles requests differently depending on which group they belong to:
- Requests that trigger both checks are always investigated.
- Of requests that trigger exactly one check, 8% are dismissed by an automated verification system. The remaining requests are investigated.
- Of requests that trigger neither check, 3% are later identified as malicious through manual review and are investigated.
Your job is to calculate the probability that a randomly selected request is ultimately investigated.
Implement `investigation_probability(total_requests, suspicious_ip, abnormal_traffic, at_least_one, dismissal_rate, manual_detection_rate)`.
---
### 📥 Input
- `total_requests`: total number of analyzed server requests.
- `suspicious_ip`: number of requests from suspicious IP addresses.
- `abnormal_traffic`: number of requests that trigger abnormal traffic detection.
- `at_least_one`: number of requests that trigger at least one automated check.
- `dismissal_rate`: proportion of exactly-one-check requests dismissed by automated verification.
- `manual_detection_rate`: proportion of remaining requests later identified through manual review.
---
### 📤 Output
- Return the probability that a randomly selected request is ultimately investigated.
- Round the result to 6 decimals.
---
### 🧩 Starter Code
```python
def investigation_probability(
total_requests,
suspicious_ip,
abnormal_traffic,
at_least_one,
dismissal_rate,
manual_detection_rate
):
pass
```
---
### 💡 Example
```python
investigation_probability(
80000,
14400,
11200,
20800,
0.08,
0.03
)
```
The function should return the requested probability as a decimal rounded to 6 decimals.
---
### ⚠️ Common Mistakes
- Treating all automatically flagged requests the same way.
- Applying the dismissal rate to the wrong group.
- Applying the manual review rate before identifying the remaining group.
- Returning a request count instead of a probability.
Starter Code
def investigation_probability(
total_requests,
suspicious_ip,
abnormal_traffic,
at_least_one,
dismissal_rate,
manual_detection_rate
):
pass