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
134 changes: 125 additions & 9 deletions your-code/main.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,29 @@
"outputs": [],
"source": [
"\"\"\"\n",
"your solution here\n",
"1,3,4\n",
"\"\"\""
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"P(A) = 0.3\n",
"P(B) = 0.6\n",
"P(A int B) = 0.1\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -49,7 +68,21 @@
"outputs": [],
"source": [
"\"\"\"\n",
"your solution here\n",
"- white = 10/30 = 1/3\n",
"\n",
"- white after black\n",
"P(B|A) = P(A int B)/P(A) = 0,333\n",
"\n",
"P(W) = 10/29\n",
"\n",
"\n",
"- red ball after black and red ball\n",
"P(R)= 11/28\n",
"\n",
"\n",
"- red after black and red\n",
"P(R) = 12/30\n",
"\n",
"\"\"\""
]
},
Expand All @@ -75,7 +108,9 @@
"outputs": [],
"source": [
"\"\"\"\n",
"your solution here\n",
"\n",
"P(R|C) = (P(C|R)*P(R))/P(C)= 0.5*0.1/0.4 = 0.125\n",
"\n",
"\"\"\""
]
},
Expand All @@ -102,11 +137,91 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"67.5 67.5\n"
]
}
],
"source": [
"import pandas as pd\n",
"\n",
"woman_yes = (351/520)*100\n",
"man_yes = (324/480)*100\n",
"\n",
"print(woman_yes, man_yes)\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>man</th>\n",
" <th>woman</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>480</td>\n",
" <td>520</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>324</td>\n",
" <td>351</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>156</td>\n",
" <td>169</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" man woman\n",
"0 480 520\n",
"1 324 351\n",
"2 156 169"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# your code here"
"pd.DataFrame({\"man\" : [480, 324, 156], \"woman\" : [520, 351, 169]})"
]
},
{
Expand All @@ -116,14 +231,15 @@
"outputs": [],
"source": [
"\"\"\"\n",
"your solution here\n",
"man and woman have the same opinion about lighting. \n",
"it seems that the gender is irrelevant\n",
"\"\"\""
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -137,7 +253,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.2"
"version": "3.10.9"
}
},
"nbformat": 4,
Expand Down