Question 1163238
```python?code_reference&code_event_index=2
import math
from scipy.stats import norm

p0 = 0.47
x = 46
n = 118

# 1. Calculate sample proportion
p_hat = x / n

# 2. Calculate standard error
se = math.sqrt(p0 * (1 - p0) / n)

# 3. Calculate z-score
z = (p_hat - p0) / se

# Round z to 2 decimal places
z_rounded = round(z, 2)

# 4. Calculate p-value for a lower-tailed test
# Using rounded z as per instructions "Round 'z' value to 2 decimal places."
p_value = norm.cdf(z_rounded)

print(f"{p_hat=}")
print(f"{se=}")
print(f"{z=}")
print(f"{z_rounded=}")
print(f"{p_value=}")


```
```text?code_stdout&code_event_index=2
p_hat=0.3898305084745763
se=0.04594580447823873
z=-1.7448707762510565
z_rounded=-1.74
p_value=0.040929508978807365

```
To compute the p-value for the given hypothesis test, we follow these steps:

### 1. State the Hypotheses
* **Null Hypothesis ($H_0$):** $p \geq 0.47$
* **Alternative Hypothesis ($H_A$):** $p < 0.47$ (This is a lower-tailed test)

### 2. Identify Sample Information
* Sample size ($n$) = $118$
* Number of successes ($x$) = $46$
* Hypothesized proportion ($p_0$) = $0.47$

### 3. Calculate the Sample Proportion ($\hat{p}$)
$$\hat{p} = \frac{x}{n} = \frac{46}{118} \approx 0.389831$$

### 4. Calculate the Standard Error ($SE$)
The standard error is calculated using the hypothesized proportion $p_0$:
$$SE = \sqrt{\frac{p_0(1 - p_0)}{n}} = \sqrt{\frac{0.47(1 - 0.47)}{118}} = \sqrt{\frac{0.47 \times 0.53}{118}} \approx 0.045946$$

### 5. Calculate the Test Statistic ($z$)
$$z = \frac{\hat{p} - p_0}{SE} = \frac{0.389831 - 0.47}{0.045946} \approx -1.7449$$
Rounding the **$z$ value to 2 decimal places** as requested:
$$z = -1.74$$

### 6. Determine the p-value
For a lower-tailed test, the p-value is the area to the left of our $z$-score in the standard normal distribution ($P(Z \leq -1.74)$). 

Using a standard normal ($z$) table:
* $P(Z \leq -1.74) = 0.0409$

**p-value:** **0.0409**