Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 51 additions & 8 deletions your_code/main.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
{
Expand Down Expand Up @@ -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": {},
Expand All @@ -89,7 +132,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -103,7 +146,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.3"
"version": "3.9.13"
}
},
"nbformat": 4,
Expand Down