Question 1162262
```python?code_reference&code_event_index=2
import numpy as np

data = [317, 355, 433, 468, 471, 391, 408, 437, 455, 345, 519, 467, 425, 534, 425, 530, 513, 348, 521, 389]
data.sort()

# Calculate Q1 and Q3 using the method typically used in statistics textbooks
# (Divide data into two halves, find medians of halves)
n = len(data)
# Median of the lower half
lower_half = data[:n//2]
# Median of the upper half
upper_half = data[n//2:]

q1 = np.median(lower_half)
q3 = np.median(upper_half)
iqr = q3 - q1
upper_fence = q3 + 1.5 * iqr

print(f"{data=}")
print(f"{q1=}")
print(f"{q3=}")
print(f"{iqr=}")
print(f"{upper_fence=}")


```
```text?code_stdout&code_event_index=2
data=[317, 345, 348, 355, 389, 391, 408, 425, 425, 433, 437, 455, 467, 468, 471, 513, 519, 521, 530, 534]
q1=390.0
q3=492.0
iqr=102.0
upper_fence=645.0

```
To determine the cutoff point for identifying unusual activity, we need to calculate the **upper fence** of the dataset. The upper fence is a standard statistical threshold used to identify potential outliers and is calculated using the first quartile ($Q_1$), the third quartile ($Q_3$), and the Interquartile Range ($IQR$).

### 1. Organize and Sort the Data
First, we sort the 20 monthly phone use values (in minutes) in ascending order:
$317, 345, 348, 355, 389, 391, 408, 425, 425, 433, 437, 455, 467, 468, 471, 513, 519, 521, 530, 534$

### 2. Find the Quartiles
Since there are $n = 20$ data points, we divide the data into two halves (each with 10 values):
* **Lower Half:** $317, 345, 348, 355, 389, 391, 408, 425, 425, 433$
* **Upper Half:** $437, 455, 467, 468, 471, 513, 519, 521, 530, 534$

**Calculate $Q_1$ (Median of the lower half):**
The two middle values are $389$ and $391$.
$$Q_1 = \frac{389 + 391}{2} = 390$$

**Calculate $Q_3$ (Median of the upper half):**
The two middle values are $471$ and $513$.
$$Q_3 = \frac{471 + 513}{2} = 492$$

### 3. Calculate the Interquartile Range ($IQR$)
$$IQR = Q_3 - Q_1 = 492 - 390 = 102$$

### 4. Calculate the Upper Fence
The upper fence is the boundary beyond which a value is considered an outlier:
$$\text{Upper Fence} = Q_3 + 1.5 \times IQR$$
$$\text{Upper Fence} = 492 + (1.5 \times 102)$$
$$\text{Upper Fence} = 492 + 153 = 645$$

**Conclusion:**
The cutoff point for contacting the customer is **645 minutes**.