document.write( "Question 1165202: Bill Alther is a zoologist who studies Anna's hummingbird (Calypte anna). (Reference: Hummingbirds, K. Long, W. Alther.) Suppose that in a remote part of the Grand Canyon, a random sample of six of these birds was caught, weighed, and released. The weights (in grams) were as follows.
\n" ); document.write( "3.7 2.9 3.8 4.2 4.8 3.1
\n" ); document.write( "The sample mean is x bar = 3.75 grams. Let x be a random variable representing weights of hummingbirds in this part of the Grand Canyon. We assume that x has a normal distribution and σ = 0.64 gram. Suppose it is known that for the population of all Anna's hummingbirds, the mean weight is μ = 4.30 grams. Do the data indicate that the mean weight of these birds in this part of the Grand Canyon is less than 4.30 grams? Use α = 0.10\r
\n" ); document.write( "\n" ); document.write( "Compute the z value of the sample test statistic. (Enter a number. Round your answer to two decimal places.)\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "(c) Find (or estimate) the P-value. (Enter a number. Round your answer to four decimal places.)\r
\n" ); document.write( "\n" ); document.write( "
\n" ); document.write( "

Algebra.Com's Answer #853109 by CPhill(2138)\"\" \"About 
You can put this solution on YOUR website!
The user is asking for the calculation of the $Z$-test statistic and the corresponding $P$-value for a one-sample hypothesis test concerning a population mean ($\mu$), where the population standard deviation ($\sigma$) is known.\r
\n" ); document.write( "\n" ); document.write( "### Given Information:\r
\n" ); document.write( "\n" ); document.write( " * **Population Mean (Hypothesized), $\mu_0$:** $4.30$ grams
\n" ); document.write( " * **Population Standard Deviation (Known), $\sigma$:** $0.64$ grams
\n" ); document.write( " * **Sample Size, $n$:** $6$
\n" ); document.write( " * **Sample Mean, $\bar{x}$:** $3.75$ grams
\n" ); document.write( " * **Level of Significance, $\alpha$:** $0.10$\r
\n" ); document.write( "\n" ); document.write( "### Hypothesis Formulation:\r
\n" ); document.write( "\n" ); document.write( " * **Null Hypothesis ($H_0$):** The mean weight is equal to $4.30$ grams ($\mu = 4.30$).
\n" ); document.write( " * **Alternative Hypothesis ($H_1$):** The mean weight is less than $4.30$ grams ($\mu < 4.30$). (This is a left-tailed test.)\r
\n" ); document.write( "\n" ); document.write( "### (a) Compute the $Z$ value of the sample test statistic.\r
\n" ); document.write( "\n" ); document.write( "The formula for the $Z$-test statistic for a sample mean when $\sigma$ is known is:
\n" ); document.write( "$$Z = \frac{\bar{x} - \mu_0}{\sigma / \sqrt{n}}$$\r
\n" ); document.write( "\n" ); document.write( "### (c) Find the $P$-value.\r
\n" ); document.write( "\n" ); document.write( "Since this is a left-tailed test, the $P$-value is the probability of observing a $Z$-score as extreme as the calculated test statistic or more extreme (i.e., further to the left).
\n" ); document.write( "$$P\text{-value} = P(Z \le Z_{\text{test}})$$\r
\n" ); document.write( "\n" ); document.write( "I will use the code interpreter to perform these calculations.\r
\n" ); document.write( "\n" ); document.write( "```python?code_reference&code_event_index=2
\n" ); document.write( "import numpy as np
\n" ); document.write( "from scipy.stats import norm\r
\n" ); document.write( "\n" ); document.write( "# Given parameters
\n" ); document.write( "mu_0 = 4.30 # Hypothesized population mean
\n" ); document.write( "sigma = 0.64 # Population standard deviation
\n" ); document.write( "n = 6 # Sample size
\n" ); document.write( "x_bar = 3.75 # Sample mean\r
\n" ); document.write( "\n" ); document.write( "# --- Part (a): Compute the Z value of the sample test statistic ---
\n" ); document.write( "# 1. Calculate the standard error of the mean
\n" ); document.write( "SE = sigma / np.sqrt(n)\r
\n" ); document.write( "\n" ); document.write( "# 2. Calculate the Z-score
\n" ); document.write( "Z_test = (x_bar - mu_0) / SE\r
\n" ); document.write( "\n" ); document.write( "# --- Part (c): Find the P-value ---
\n" ); document.write( "# Since H1 is mu < 4.30 (left-tailed test), P-value = P(Z <= Z_test)
\n" ); document.write( "P_value = norm.cdf(Z_test)\r
\n" ); document.write( "\n" ); document.write( "# Output results rounded as requested
\n" ); document.write( "Z_rounded = round(Z_test, 2)
\n" ); document.write( "P_rounded = round(P_value, 4)\r
\n" ); document.write( "\n" ); document.write( "print(f\"Standard Error (SE): {SE}\")
\n" ); document.write( "print(f\"Z-test statistic: {Z_test}\")
\n" ); document.write( "print(f\"Z-test statistic (rounded to 2 d.p.): {Z_rounded}\")
\n" ); document.write( "print(f\"P-value: {P_value}\")
\n" ); document.write( "print(f\"P-value (rounded to 4 d.p.): {P_rounded}\")\r
\n" ); document.write( "\n" ); document.write( "```\r
\n" ); document.write( "\n" ); document.write( "```text?code_stdout&code_event_index=2
\n" ); document.write( "Standard Error (SE): 0.26127890589687236
\n" ); document.write( "Z-test statistic: -2.105030247704293
\n" ); document.write( "Z-test statistic (rounded to 2 d.p.): -2.11
\n" ); document.write( "P-value: 0.017644337582746063
\n" ); document.write( "P-value (rounded to 4 d.p.): 0.0176\r
\n" ); document.write( "\n" ); document.write( "```\r
\n" ); document.write( "\n" ); document.write( "Here are the required calculations for the hypothesis test:\r
\n" ); document.write( "\n" ); document.write( "### (a) Compute the $Z$ value of the sample test statistic.\r
\n" ); document.write( "\n" ); document.write( "The $Z$-test statistic is calculated as:
\n" ); document.write( "$$Z = \frac{\bar{x} - \mu_0}{\sigma / \sqrt{n}}$$\r
\n" ); document.write( "\n" ); document.write( "Using the given values ($\bar{x}=3.75$, $\mu_0=4.30$, $\sigma=0.64$, $n=6$):\r
\n" ); document.write( "\n" ); document.write( "1. **Calculate the Standard Error (SE):**
\n" ); document.write( " $$\text{SE} = \frac{0.64}{\sqrt{6}} \approx 0.26128$$\r
\n" ); document.write( "\n" ); document.write( "2. **Calculate the $Z$-score:**
\n" ); document.write( " $$Z = \frac{3.75 - 4.30}{0.26128} = \frac{-0.55}{0.26128}$$
\n" ); document.write( " $$Z \approx -2.1050$$\r
\n" ); document.write( "\n" ); document.write( "Rounding the answer to two decimal places:
\n" ); document.write( "$$\mathbf{Z \approx -2.11}$$\r
\n" ); document.write( "\n" ); document.write( "### (c) Find the $P$-value.\r
\n" ); document.write( "\n" ); document.write( "Since the alternative hypothesis is $H_1: \mu < 4.30$ (a left-tailed test), the $P$-value is the area under the standard normal curve to the left of the test statistic $Z = -2.1050$.\r
\n" ); document.write( "\n" ); document.write( "$$P\text{-value} = P(Z \le -2.1050)$$
\n" ); document.write( "$$P\text{-value} \approx 0.017644$$\r
\n" ); document.write( "\n" ); document.write( "Rounding the answer to four decimal places:
\n" ); document.write( "$$\mathbf{P\text{-value} \approx 0.0176}$$\r
\n" ); document.write( "\n" ); document.write( "-----\r
\n" ); document.write( "\n" ); document.write( "*(For context: Since the $P$-value $(0.0176)$ is less than the significance level $\alpha$ $(0.10)$, we would reject the null hypothesis and conclude that the data indicates the mean weight of these birds in this part of the Grand Canyon is indeed less than $4.30$ grams.)*
\n" ); document.write( "
\n" );