diff --git a/your_code/main.ipynb b/your_code/main.ipynb index 7810ccf..d84c3d6 100644 --- a/your_code/main.ipynb +++ b/your_code/main.ipynb @@ -14,11 +14,19 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The sum of observed frequencies does not agree with the sum of expected frequencies within the specified tolerance.\n" + ] + } + ], "source": [ - "# your answer here" + "#The percent difference of 0.012530799505383763 indicates a small discrepancy between the sum of the observed frequencies and the sum of the expected frequencies" ] }, { @@ -60,13 +68,48 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 15, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Reject the null hypothesis..\n", + " Probability: 0.0\n" + ] + } + ], "source": [ - "# your answer here" + "from scipy.stats import binom\n", + "\n", + "# Observed data\n", + "observed_defective = 62 # Replace with the actual number of observed defective tires\n", + "n = 10\n", + "p = 0.05\n", + "\n", + "# Calculate the probability mass function (PMF) for the observed number of defective tires\n", + "observed_probability = binom.pmf(observed_defective, n, p)\n", + "\n", + "# Set the significance level (alpha)\n", + "alpha = 0.05\n", + "\n", + "# Compare the observed probability to the significance level\n", + "if observed_probability < alpha:\n", + " print(\"Reject the null hypothesis..\")\n", + "else:\n", + " print(\"Fail to reject the null hypothesis.\")\n", + "\n", + "print(\" Probability:\", observed_probability)\n" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, { "cell_type": "markdown", "metadata": {}, @@ -89,7 +132,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -103,7 +146,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.3" + "version": "3.9.13" } }, "nbformat": 4,