programmieren_wise_24_25/Material/wise_24_25/SciPy_Lösungen.ipynb

440 lines
127 KiB
Plaintext
Raw Normal View History

2024-11-29 13:22:29 +01:00
{
"cells": [
{
"cell_type": "markdown",
"id": "5fbb6606-ab9a-4481-bfb5-72a958b0d72c",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": "slide"
},
"tags": []
},
"source": [
"# Lösungen SciPy"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "8455dadf-ad76-4c6e-b6c4-e72764d41e86",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": "skip"
},
"tags": []
},
"outputs": [],
"source": [
"from scipy import stats\n",
"import matplotlib.pyplot as plt"
]
},
{
"cell_type": "markdown",
"id": "78aed4e3-89b5-4baa-995a-2235e17ddd8b",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": "slide"
},
"tags": []
},
"source": [
"### Aufgabe\n",
"\n",
"*7 Punkte*\n",
"\n",
"Bestimme mittels Linearer Regression die *best fit* Funktion für die beiden gegebenen Datensets `x_data` & `y_data`, unter beachtung folgender Punkte:\n",
"\n",
"- Plotte das Ergebnis angemessen\n",
"- Nutze SciPys `linregress` Funktion, speichere den Output vor dem entpacken in der Variablen `l`\n",
"- Definiere die Funktion `reg_line` mit einem Eingabeparameter\n",
"- Bestimme die Werte für `-0.3` & `3.4` speichere diese als liste in variablen `future`"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "a5dadce5-e415-4b39-80a5-0ad3cb5e6352",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": "fragment"
},
"tags": []
},
"outputs": [],
"source": [
"import numpy as np\n",
"random = np.random.default_rng(420)\n",
"\n",
"# 2 scuffed up One-Liners :)\n",
"x_data: np.array = np.sort(np.round(random.random(40)*np.pi, decimals=2))\n",
"y_data: np.array = np.flip(np.sort(np.round(random.random(40)*np.sqrt(2), decimals=2)))"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "7b2b2652-1771-4434-ac6e-bf7d80ba15cf",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": "subslide"
},
"tags": []
},
"outputs": [],
"source": [
"l = stats.linregress(x_data,y_data)\n",
"slope, intercept, _, _, stderr = l\n",
"\n",
"def reg_line(x: float) -> float:\n",
" return float(np.round(slope*x+intercept,decimals=2))\n",
"\n",
"ext: tuple = (-0.3, 3.4)\n",
"rl: np.array = np.vectorize(reg_line)(ext)\n",
"\n",
"future: list = [reg_line(ext[0]), reg_line(ext[1])]"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "bf16eea1-0524-46e4-84d5-b5b87308941e",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": "skip"
},
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"Text(0, 0.5, 'Y')"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAkIAAAHHCAYAAABTMjf2AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAyS0lEQVR4nO3de1xVdb7/8TcgbMS7oqBEoqihZWKQhpfUwqgcL3UyJ02RU2qlnZLjpOYF8YZjZXbMcrTMpsm0i1aTjEoo00U7lopject7OYGCGSUNIHx/f/yGfdyCBSbsLd/X8/Hw8XB/93et9Vnrs22/W2vtvb2MMUYAAAAW8nZ3AQAAAO5CEAIAANYiCAEAAGsRhAAAgLUIQgAAwFoEIQAAYC2CEAAAsBZBCAAAWIsgBAAArEUQAlAlevfurd69e7u7jEty9OhReXl5acWKFe4upcqMHDlSYWFh7i4DcDuCEFAJu3fv1j333KOWLVvK399fISEh6tu3rxYtWlRl21y5cqUWLlxYZvyf//ynZsyYoczMzCrbdnUICwuTl5eX80+dOnXUpUsX/fnPf3Z3aR5hx44d8vLy0tSpUy865+uvv5aXl5cSExOrtTagJiAIARW0ZcsWRUdHa9euXRo1apSef/55Pfjgg/L29tZzzz1XZdv9pSCUnJx8xQchSYqMjNRrr72m1157TTNmzNAPP/yg+Ph4LVu2zN2lud0NN9ygiIgIvfHGGxeds3LlSknS/fffX42VATVDLXcXAFwp5syZowYNGujzzz9Xw4YNXZ47efKk2+q63M6ePas6depU6zZDQkJc3sRHjhyp1q1b69lnn9WoUaOqtRZPNGzYME2bNk2fffaZbrrppjLPv/HGG4qIiNANN9zglvqAKxlnhIAKOnTokK699toyIUiSmjVrVmbsL3/5i7p06aKAgAA1atRIN998szZu3Oh8/r333lO/fv3UokULORwOhYeHa9asWSouLnbO6d27t9atW6djx445Lx2FhYUpIyNDN954oyQpISHB+dz597T87//+r26//XY1aNBAAQEB6tWrlz799FOXGmfMmCEvLy/t2bNHQ4cOVaNGjdSjRw+XfYiKilLt2rXVuHFj/f73v9c333xTZl+XLl2q8PBw1a5dW126dNHHH398Sce4VNOmTRUREaFDhw65jH/88ccaPHiwrr76ajkcDoWGhmr8+PH6+eefXeaNHDlSdevW1YkTJzRo0CDVrVtXTZs21YQJE1yOrySdOXNGI0eOVIMGDdSwYUPFx8frzJkz5da1adMm9ezZU3Xq1FHDhg01cOBA7d2712VO6TE9cOCA7r//fjVo0EBNmzbVtGnTZIzRN998o4EDB6p+/foKDg7WM88886vHY9iwYdJ5Z37Ot337du3fv985pyKvq/JkZGTIy8tLGRkZLuMXu19q3759uueee9S4cWP5+/srOjpa77//vsucoqIiJScnq23btvL391eTJk3Uo0cPpaWl/eo+A9WFIARUUMuWLbV9+3Z9+eWXvzo3OTlZw4cPl6+vr2bOnKnk5GSFhoZq06ZNzjkrVqxQ3bp1lZiYqOeee05RUVGaPn26Jk2a5JwzZcoURUZGKjAw0HnpaOHChWrfvr1mzpwpSRo9erTzuZtvvln69xv2zTffrLy8PCUlJWnu3Lk6c+aMbrnlFm3btq1MvYMHD1Z+fr7mzp3rPAMzZ84cjRgxQm3bttWCBQv0+OOPKz09XTfffLNLUHj55Zc1ZswYBQcHa/78+erevbsGDBh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p58qQeeugh+fn5OZcvvdRUURs3blTTpk3VtGlTdezYUa+99poSEhL01FNPucw7/5idPXtWOTk56tatm4wx2rlzZ5n1XrhfPXv21OHDh52PU1NTVatWLT388MPOMR8fHz366KMuy3333XfKzMzUyJEj1bhxY+f49ddfr759+yo1NbXMth988EGXdUZHR8sYowceeMA53rBhQ11zzTUuNV3MkCFD5Ovr63J57O9//7tOnDjhvCx24TG6nK+rUqdPn9amTZt07733Otefk5Oj3NxcxcXF6euvv9aJEyec+/fVV1/p66+//s3bBaoKN0sDlXDjjTdqzZo1Kiws1K5du7R27Vo9++yzuueee5SZmakOHTro0KFD8vb2VocOHX5xXV999ZWmTp2qTZs2KS8vz+W5H3744ZJrLH3TKe/yzvnrP/+yU6tWrcqswxijtm3blru8r6+vJOnYsWOSVGaer6+vWrduXeGaSy8dFRcX68svv9Ts2bP1/fffu4QrSTp+/LimT5+u999/X99//32ZfTqfv7+/mjZt6jLWqFEjl+WOHTum5s2bq27dui7zrrnmGpfHpft54bgktW/fXhs2bChzk/nVV1/tMq9Bgwby9/dXYGBgmfHc3NyLHJn/06RJE8XFxWnt2rVasmSJ/P39tXLlStWqVUv33nuvc15Vva5KHTx4UMYYTZs2TdOmTSt3zsmTJxUSEqKZM2dq4MCBateuna677jrdfvvtGj58uK6//vrfXAdwuRCEgEvg5+enG2+8UTfeeKPatWunhIQEvfXWW0pKSqrQ8mfOnFGvXr1Uv359zZw5U+Hh4fL399eOHTs0ceLEMmdsKqN02aeeekqRkZHlzrnwjf/8swil6/Dy8tLf/vY3+fj4/Oryv1VgYKBiY2MlSXFxcYqIiNDvfvc7Pffcc87vxikuLlbfvn11+vRpTZw4UREREapTp45OnDihkSNHljlm5dVdncrb/sVqMsZUaJ3333+/PvjgA33wwQcaMGCA3nnnHd12223OwPdbXlfnn60834X3JJWuY8KECYqLiyt3mTZt2kiSbr75Zh06dEjvvfeeNm7cqJdeeknPPvuslixZ4nLGDHAnghDwG0VHR0v/vnwiSeHh4SopKdGePXsuGkQyMjKUm5urNWvWOG9wlqQjR46UmXuxN6iLjYe
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.title(\"Scattered Random Values\")\n",
"plt.grid()\n",
"plt.xlabel(\"X\")\n",
"plt.ylabel(\"Y\")"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "0a27e646-5b06-4f83-abf4-7925350a0ea7",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": "subslide"
},
"tags": []
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAi8AAAGdCAYAAADaPpOnAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABrWElEQVR4nO3deVxVdf7H8dfhsqpc3BFZvK4ILoBQpg2TTjbaNJaRo2mT5lS2j2ZN5UxpuzVtUmNZtlhNuYyRzVQ/W0yS0hY2c8FdAhFck01luff8/jBIEhCUy2V5P3vch95zv99zPqfL9X74roZpmiYiIiIizYSbqwMQERERqQ8lLyIiItKsKHkRERGRZkXJi4iIiDQrSl5ERESkWVHyIiIiIs2KkhcRERFpVpS8iIiISLPi7uoAGprD4WDfvn34+vpiGIarwxEREZE6ME2TwsJCunfvjptb7W0rLS552bdvH8HBwa4OQ0RERM5CdnY2QUFBtZZpccmLr68v/HzzVqvV1eGIiIhIHRQUFBAcHFz5PV6bFpe8VHQVWa1WJS8iIiLNTF2GfGjAroiIiDQrSl5ERESkWVHyIiIiIs1KixvzIiIi58Y0TcrLy7Hb7a4ORVoYDw8PLBbLOZ9HyYuIiFQqLS0lNzeXY8eOuToUaYEMwyAoKIh27dqd03mUvIiICPy8yOeePXuwWCx0794dT09PLfYpDcY0TQ4ePMjevXvp27fvObXAKHkRERH4udXF4XAQHBxMmzZtXB2OtEBdunQhMzOTsrKyc0peNGBXRESqONPS7CJnq6Fa8tTyUld2OyQlQW4uBARAbCw0wKAjERERqR+l13WRkAA2G4wcCZMnn/zTZjt5XEREmrXMzEwMwyA9Pb3OdRYvXkz79u1dHkdrpeTlTBISYPx42Lu36vGcnJPHlcCIiLhcdnY2f/nLXyoHGvfo0YMZM2Zw+PDhM9YNDg4mNzeXgQMH1vl6EydOZPv27ecYdf2NGDECwzAwDAMvLy8CAwMZO3YsCWfxXfTggw8SGRnplDidTclLbex2mDEDTPP01yqOzZx5spyIiLjE7t27iYmJYceOHSxZsoSdO3eycOFCVq9ezbBhwzhy5EiNdUtLS7FYLHTr1g1397qPpPDx8aFr164NdAf1c+ONN5Kbm8uuXbt47733CA8P5+qrr2b69OkuiccVlLzUJimpssXFgTs/8DiHOe+X100TsrNPlhMREQDsDjuJmYks2biExMxE7A7n/oJ322234enpyaeffspFF11ESEgIl156KZ9//jk5OTn84x//qCxrs9l45JFHmDJlClarlenTp1fbXfPf//6Xvn374u3tzciRI3nzzTcxDIOjR49CNd1GFa0Yb7/9NjabDT8/P66++moKCwsry6xatYrf/OY3tG/fnk6dOvHHP/6RXbt21ft+27RpQ7du3QgKCuKCCy7gySef5OWXX2bRokV8/vnnleXuvfde+vXrR5s2bejVqxcPPPAAZWVllfE/9NBDbNiwobIlZ/HixQA8++yzDBo0iLZt2xIcHMytt95KUVFRveN0JiUvtcnNrfzrXuI4wjA28k92cSMOLNWWExFpzRIyErDF2xj55kgmJ0xm5JsjscXbSMhwThf7kSNH+OSTT7j11lvx8fGp8lq3bt245pprWLZsGeYpLehPP/00ERERpKWl8cADD5x2zj179jB+/HjGjRvHhg0buOmmm6okQDXZtWsXK1eu5MMPP+TDDz/kyy+/5Iknnqh8vbi4mFmzZpGcnMzq1atxc3PjyiuvxOFwnPP/h6lTp9KhQ4cq3Ue+vr4sXryYLVu2EB8fz6JFi3juuefg526vu+66iwEDBpCbm0tubi4TJ06En2ebPf/882zevJk333yTL774gnvuueecY2xImm1Um4CAyr8G8j4n6MY+riSbyeQzmHAewZsDVcqJiLRWCRkJjF8+HpOqXe05BTmMXz6eFRNWEBcW16DX3LFjB6ZpEhYWVu3rYWFh/PTTTxw8eLCym+d3v/sdd911V2WZzMzMKnVefvllQkNDeeqppwAIDQ1l06ZNPPbYY7XG4nA4WLx4Mb6+vgBce+21rF69urLeVVddVaX866+/TpcuXdiyZUu9xttUx83NjX79+lW5l/vvv7/y7zabjbvvvpulS5dyzz334OPjQ7t27XB3d6dbt25VzjVz5swq9R599FFuvvlmXnzxxXOKsSGp5aU2sbEQFASGgYUy+vE84czFQhEFDCSZVzjUeezJciIirZjdYWfGqhmnJS5A5bGZq2Y6rQvJrG5sYg1iYmJqfX3btm2cd955VY6df/75ZzyvzWarTFwAAgICOHDgQOXzHTt2MGnSJHr16oXVasVmswGQlZVV59hrY5pmlXVUli1bxoUXXki3bt1o164d999/f52u9fnnn3PxxRcTGBiIr68v1157LYcPH25SW0YoeamNxQLx8Sf//vMPRFfWEsN0fNlKOX5sOjSLnffswVF67s1+IiLNVVJWEnsL9tb4uolJdkE2SVkNO0awT58+GIZBRkZGta9nZGTQoUMHunTpUnmsbdu2DRpDBQ8PjyrPDcOo0iU0duxYjhw5wqJFi/j222/59ttv4edBw+fKbrezY8cOevbsCcD69eu55ppr+MMf/sCHH35IWloa//jHP854rczMTP74xz8yePBg3nvvPVJSUliwYEGDxdlQlLycSVwcrFgBgYGVh3zIJSronwT98QQAe5/dS1psGsf3HHdhoCIirpNbWLexf3UtV1edOnXikksu4cUXX+T48ar/Bufl5fHOO+8wceLEeq3sGhoaSnJycpVj33///TnFefjwYbZt28b999/PxRdfXNmd1VDefPNNfvrpp8quqXXr1tGjRw/+8Y9/EBMTQ9++ffnxxx+r1PH09Dxt5/CUlBQcDgfPPPMMF1xwAf369WPfvn0NFmdDUfJSF3FxkJkJa9bAu+/CmjW4Ze6gz//GMHDlQNzbu1P4XSHJUckcTDjo6mhFRBpdgG/dxv7VtVx9/Otf/6KkpITRo0ezdu1asrOzWbVqFZdccgmBgYFnHKvyazfddBNbt27l3nvvZfv27SxfvrxyJs7ZLm/foUMHOnXqxCuvvMLOnTv54osvmDVr1lmd69ixY+Tl5bF3716++eYb7r33Xm6++WZuueUWRo4cCUDfvn3Jyspi6dKl7Nq1i+eff57333+/ynlsNht79uwhPT2dQ4cOUVJSQp8+fSgrK+OFF15g9+7dvP322yxcuPCs4nQmJS91ZbHAiBEwadLJP3/eGqDzFZ2JSY/BeoEVe76dzVdtZscdO3CUqBtJRFqP2JBYgqxBGFT/5W5gEGwNJjak4ccI9u3bl+TkZHr16sWECRPo3bs306dPZ+TIkaxfv56OHTvW63w9e/ZkxYoVJCQkMHjwYF566aXK2UZeXl5nFaObmxtLly4lJSWFgQMHcuedd1YOCK6vRYsWERAQQO/evYmLi2PLli0sW7asyoDayy+/nDvvvJPbb7+dyMhI1q1bd9rMqquuuooxY8YwcuRIunTpwpIlS4iIiODZZ5/lySefZODAgbzzzjvMmzfvrOJ0JsOszyinZqCgoAA/Pz/y8/OxWq2Ndl1HmYM9f99D9tPZALQb0o7wZeG06aOdWUWkeThx4gR79uyhZ8+eeHt717t+xWwjThmky8+JC+CU2UaN5bHHHmPhwoVkZ2e7OpRmrbafsfp8f6vlpYG4ebjR+6neDPpwEO6d3ClKLSJlSAoHlh+oQ20RkeYvLiyOFRNWEGgNrHI8yBrU7BKXF198ke+//76y6+Spp55i6tSprg5LfqZ1XhpYp8s6EZMeQ8akDPK/ymfLxC0cXXOU3s/2xuKjXahFpGWLC4vjitArSMpKIrcwlwDfAGJDYrG4Na9//3bs2MGjjz7KkSNHCAkJ4a677mL27NmuDkt+pm4jJ3GUO8ick0nWvJNz6tsObsuA5QNoE6puJBFpms6120jkTNRt1MS5ubvR6/FeDF41GI8uHhT/UExydDL739nv6tBERESaNSUvTtZxdEdi0mNoP6I9jmIHGX/OYOsNW7Ef007
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.scatter(x_data,y_data, color='g', label=\"Original Data\")\n",
"plt.plot(ext, rl, color='m', label=\"Fitted Line\")\n",
"plt.scatter(ext, future, color='r', label=\"Predicted Data\")\n",
"plt.legend()\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"id": "9ca0bc7d-6fcb-475f-bdfc-c0b63579cc93",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": "slide"
},
"tags": []
},
"source": [
"### Aufgabe \n",
"\n",
"*6 Punkte*\n",
"\n",
"Gegeben sind die nach Altersgruppe aufgeschlüsselten Durschnittskörpergrößen (in cm) von Frauen in Deutschland. (Zu finden beim [Statistischen Bundesamt](https://www.destatis.de/DE/Themen/Gesellschaft-Umwelt/Gesundheit/Gesundheitszustand-Relevantes-Verhalten/Tabellen/koerpermasse-frauen.html))\n",
"\n",
"Gehe wie folgt vor:\n",
"\n",
"- Berechne das arithmetische Mittel nutze dafür NumPy. und speichere das Ergebnis mit einer Genauigkeit von 1 Dezimalstelle nach dem Komma in der Variablen `avg_height`.\n",
"- Gegeben ist auch die Standardabweichung von 15cm, stelle die Normalverteilung mittels `norm.pdf` auf. Speichere den Wert in `norm_height` und finde einen geeigneten linespace zum plotten.\n",
"- Berechne folgend die Körpergröße unter die 80% aller Frauen (nach Datenset) fallen. Speichere den Wert in der Variablen `avg_percentile`.\n",
"- Plotte das Ergebnis. Orientiere dich gerne an dem Bienenbeispiel. Finde eine geeignete Darstellung. *Tipp: Da die Y-Achse in diesem Beispiel keinen Sinn ergibt kannst du sie einfach austellen mit `plt.yticks([])`*"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "2b3711d0-aed5-4be2-a6a5-18df1767a97f",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": "subslide"
},
"tags": []
},
"outputs": [],
"source": [
"# Given\n",
"avg_height_per_woman = {\n",
" \"18 - 20\": 167.6,\n",
" \"20 - 25\": 167.7,\n",
" \"25 - 30\": 167.3,\n",
" \"30 - 35\": 167.2,\n",
" \"35 - 40\": 167.3,\n",
" \"40 - 45\": 167.5,\n",
" \"45 - 50\": 167.1,\n",
" \"50 - 55\": 167.1,\n",
" \"55 - 60\": 166.9,\n",
" \"60 - 65\": 165.4,\n",
" \"65 - 70\": 164.5,\n",
" \"70 - 75\": 163.9,\n",
" \"75+\": 162.8\n",
"}\n",
"\n",
"avg_height = None\n",
"norm_height = None\n",
"avg_percentile = None"
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "9e931834-455b-4596-b1d6-4166a1e06852",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": "subslide"
},
"tags": []
},
"outputs": [],
"source": [
"avg_height = np.round(\n",
" np.mean(list(avg_height_per_woman.values()))\n",
" , decimals=1)\n",
"std_sigma = 15\n",
"\n",
"norm_x = np.linspace(120, 220, 1000)\n",
"norm_height = stats.norm(avg_height, std_sigma).pdf(norm_x)\n",
"\n",
"# Height of 80th percentile of woman heights\n",
"avg_percentile = stats.norm(avg_height, std_sigma).ppf(0.8)\n",
"\n",
"x_percentile = np.arange(norm_x[0], avg_percentile, 0.01)\n",
"y_percentile = stats.norm(avg_height, std_sigma).pdf(x_percentile)"
]
},
{
"cell_type": "code",
"execution_count": 32,
"id": "e36af98b-3fa7-4c3b-9418-cb2792da5235",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": "subslide"
},
"tags": []
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAs0AAAE8CAYAAAA7aYygAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABjkklEQVR4nO3dd3gUVdvH8e9kU0mlJASk996LdJAqCKIiSlFAfBQREF/ELmIXe3nsBXt/BDuKCkgRFBUpCoJSpJdAGqk75/1jyMISIAESJuX3ua692J2ZPXvPng25c/aecyxjjEFERERERI4rwO0ARERERESKOiXNIiIiIiJ5UNIsIiIiIpIHJc0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yyCMYY/yOyyllefvtt2ncuDEhISHMmTPHV6O7aNEiJk2aRGxsLDExMVx99dVkZmZy4MABLr/8csqWLUvZsmW58cYbc7X9yCOP0LFjR8qXL09YWBitW7fmo48+yjP2k1W+fHnee+89AgMDue+++3zbj1XTvHPnTsaMGUOVKlUICQmhUqVKnH/++b5+rFGjBmvWrGHBggW+vunevTscUbe8YMECxo8fT1xcHFWqVPHbd6zPwzfffEOLFi0IDQ2lUaNGfPzxx377c34ejnZ0myeK7Xg1zR9++CGtW7cmLCyMChUqMHLkSLZt2+Z3TE6507Zt2xg8eDARERHExsZyww034PV6T6FHRCQvGmkWKSSdO3fmzTffZNmyZb5fkosXL6Zjx4507NiRxMREVq9eTbNmzXz7GjRoQPny5QG48soref311xkyZAhTpkxh2bJlPPDAA/z555+5aqU3bNjA8OHDufrqqxk5ciSPPPIIAwcO5Pnnn+fWW29l/PjxADzwwAMMHTqUdevWERDg/M08d+5c/vnnH8aMGUN8fDxr1qzhxRdfZM2aNSxdujRXYjB06FBq1qzJAw88wK+//srLL79MXFwcM2bMyNf7snfv3nwdZ9s2gwYNYtGiRVx11VU0bNiQVatW8fjjj/PXX38xe/bs4z5327ZtvuT2lltuITw8nJdffvm4I9IbNmxgyJAhjB07llGjRvHqq68yevRoWrduTePGjenatSuTJk3iqaee4tZbb6Vhw4YAvn9PpEuXLpxzzjk89NBDXHPNNccdbTbGMGjQIObNm8fYsWNp0aIFX3/9NVOnTmXbtm08/vjjfsd///33fPDBB0yYMIEKFSpQo0YNVqxYAcDEiROJj4/nrrvuYunSpbz44ovExMSwZMkSqlWrxv3338+XX37Jww8/TJMmTbj88st97T755JMMGjSIESNGkJmZyXvvvcfFF1/M559/zoABA/I835NRrVo1unXrxrx580hKSiIqKuqYx1100UWsWbOGiRMnUqNGDXbv3s3cuXPZsmULNWrU4IknnmDixIlERERw2223AVCxYkW/NsaPH09sbCzTpk0jNTX1hHGtX7+eSy65hHHjxjFq1ChmzpzJxRdfzJw5c+jdu/dJnWN+YjvSa6+9xpgxY2jbti0PPPAAu3bt4sknn2Tx4sX89ttvxMTE+I71er307duX9u3b88gjj/Dtt9/y6KOPUrt2ba655pqTilNE8sGISKFYs2aNAcw999xjjDEmKyvLhIeHm9dff90YY0zFihXNM888Y4wxJikpyXg8HvOf//zHGGPMihUrDGCuvPJKvzZvuOEGA5jvv//et6169eoGMEuWLPFt+/rrrw1gwsLCzObNm33bX3jhBQOYefPm+bYdPHgwV+zvvvuuAcwPP/zg23bnnXcawFxxxRV+x15wwQWmfPnyeb4fo0aNMsAJb9dee63v+DfffNMEBASYhQsX+rXz/PPPG8AsXrzY7z0YNWqU7/HEiRONZVnmt99+823bt2+fKVeunAHMxo0bc71/R57r7t27TUhIiJkyZYpv24cffpjrvTuRnPdrz549ZsGCBQYwjz32mN/rDhgwwPd49uzZBjD33nuvXztDhgwxlmWZDRs2+LYBJiAgwKxZs8bv2JkzZxrA9O3b19i27dveoUMHY1mWGTdunG9bdna2qVKliunWrZtfG0d/HjIzM02TJk3MOeec47f96Pf8eI7u16Ndd911BjC///67McaYjRs3GsDMnDnTGGPM/v37DWAefvjhE75O48aNc52LOeI96dy5s8nOzj7mvmN9Hv73v//5tiUmJppKlSqZli1b+rbl9O/xXu/INo8X27x58/w+U5mZmSYuLs40adLEpKWl+Y77/PPPDWCmTZvm25bz83T33Xf7tdmyZUvTunXrE75XInJqVJ4hUkgaNmxI+fLlfbXKv//+O6mpqb7ZMTp27Oi7GPDHH3/E6/X66pm//PJLAP7v//7Pr80pU6YA8MUXX/htb9SoER06dPA9bt++PQDnnHMO1apVy7X9n3/+8W07cuQzPT2dvXv3cvbZZwPw66+/5jqvcePG+T3u0qUL+/btIykpKc/3JDQ0lLlz5x7zdrQPP/yQhg0b0qBBA/bu3eu7nXPOOQDHnH0kx5w5c+jQoQMtWrTwbStXrhwjRow45vGNGjWiS5cuvsexsbHUr1/f7306HV27dqVHjx489NBDfuU6R/ryyy/xeDxMmjTJb/uUKVMwxvDVV1/5be/WrRuNGjU6Zltjx471+4agffv2GGMYO3asb5vH46FNmza5zvHIz8P+/ftJTEykS5cux/wsFIScGVWSk5OPuT8sLIzg4GDmz5/P/v37T/l1/vOf/+S7frly5cpccMEFvsdRUVFcfvnl/Pbbb+zcufOUY8jL8uXL2b17N+PHj/erdR4wYAANGjTI9XPPcX4eC+pzKyL+VJ4hUkgsy6Jjx4788MMP2LbN4sWLiYuLo06dOnAoaf7vf/8Lh0ozOOIiwM2bNxMQEOA7Nkd8fDwxMTFs3rzZb/uRiTFAdHQ0AFWrVj3m9iOTj4SEBO666y7ee+89du/e7Xd8YmJirvM6+rXKli3ra/N4X6/n8Hg89Or
"text/plain": [
"<Figure size 900x300 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig, ax = plt.subplots(figsize=(9,3))\n",
"ax.plot(norm_x, norm_height, color='r')\n",
"ax.fill_between(x_percentile, y_percentile, 0, alpha=.5, color='#fa0000')\n",
"ax.text(0.4,0.18,\n",
"f\"80th percentile of Womens heigth\\n fall under {avg_percentile:.1f}cm\",\n",
"ha='center', va='center', transform=ax.transAxes,\n",
"bbox={'facecolor':'#fafafa','alpha':1,'edgecolor':'none','pad':1},\n",
"color='#de2e0b'\n",
")\n",
"plt.title(\"Woman Height Normal Distribution\")\n",
"plt.xlabel(\"Height\")\n",
"plt.yticks([]) # hide y\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"id": "7335367c-46e3-4396-bc41-d9d2e6621194",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": "slide"
},
"tags": []
},
"source": [
"### Aufgabe\n",
"\n",
"*7 Punkte*\n",
"\n",
"Gegeben sind zwei Würfel aus dem Spiel **Super Mario Party**. Es wird im folgenden angenommen das die Charaktere ihre Würfel würfeln und deren Augenzahl addiert wird.\n",
"\n",
"- Stelle alle Kombinationen der Gegebenen Daten auf, speichere diese als Dictionary in der Variablen `dist_mp`.\n",
"- Exthrahiere den am dritt häufigsten Aufkommenden Wert und speicher diesen in der Variablen `best3` als tuple in der Form `(<Augenzahl>, <Auftritte>)`.\n",
"- Plotte eine geeignete binomiale Verteilung. *Tipp: schaue dir an wie du den Plot mittels matplotlib vergrößerst*"
]
},
{
"cell_type": "markdown",
"id": "27720a28-4a96-4567-b2f0-52961bdd387f",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": "subslide"
},
"tags": []
},
"source": [
"Einige der Würfel gebem dem Charakter Münzen. Finde eine logische Schlussfolgerung diese mit anderen Werten zu ersetzen. Überlege dabei welche Auswirkungen es auf die Augenzahl hat das der Charakter Münzen bekomment.\n",
"\n",
"|Charakter|Dice|\n",
"|-|-|\n",
"|Mario|1, 3, 3, 3, 5, 6|\n",
"|Peach|0, 2, 4, 4, 4, 6|\n",
"|Boo|-2 Coins, -2 Coins, 5, 5, 7, 7|\n",
"|Donkey Kong|+5 Coins, 0, 0, 0, 10, 10|"
]
},
{
"cell_type": "code",
"execution_count": 25,
"id": "e6b079fa-95b0-4a6c-90d2-fc39b8a045b7",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": "subslide"
},
"tags": []
},
"outputs": [],
"source": [
"# define dices\n",
"mario = [1, 3, 3, 3, 5, 6]\n",
"peach = [0, 2, 4, 4, 4, 6]\n",
"boo = [0, 0, 5, 5, 7, 7]\n",
"dk = [0, 0, 0, 0, 10, 10]\n",
"\n",
"# Create Keys\n",
"keys: set = {\n",
" m+p+b+d\n",
" for m in mario for p in peach\n",
" for b in boo for d in dk\n",
"}\n",
"\n",
"# Creating a dict with all keys\n",
"dist_mp: dict = {k: 0 for k in keys}\n",
"\n",
"# Summing all possible combinations and store them inside the dict\n",
"for m in mario:\n",
" for p in peach:\n",
" for b in boo:\n",
" for d in dk:\n",
" dice_roll: int = m+p+b+d\n",
" dist_mp[dice_roll] += 1\n",
"\n",
"best3: tuple = (10, dist_mp[10])"
]
},
{
"cell_type": "code",
"execution_count": 26,
"id": "ecbad816-1cf1-4cb8-ad95-e4da62fd6164",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": "subslide"
},
"tags": []
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjsAAAHHCAYAAABZbpmkAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABWlUlEQVR4nO3deVhUZf8/8PewDZuMgqwKiisuuOESampJ4JL7o5m482iZuGGpPOVWJmpqZm5ZipaaZu6YoOJWhigKmkoKiksqYAGDgLLevz++Mj9HthkYHDi9X9c11+Xc59zn/szMEd6cc58zMiGEABEREZFEGei7ACIiIqLKxLBDREREksawQ0RERJLGsENERESSxrBDREREksawQ0RERJLGsENERESSxrBDREREksawQ0RERJLGsENUQTKZDAsWLNB3GdXWnTt3IJPJsGXLFn2XopVTp05BJpPh1KlT/4oaFixYAJlMptYmk8ng7+9f6WMDwJYtWyCTyXDnzp1XMh5JC8MOVXuFPwRlMhl+++23IsuFEHB2doZMJsPbb7+tlxq1UfhaZDIZDAwM4OTkBG9vb53/QtuxYwdWrVql023ipfqNjIxgbW0NDw8PTJs2DdevX9f5eFJRGPoKH8bGxqhduzY6d+6M//3vf7h3757Oxlq8eDH279+vs+3pUlWujaovGb8bi6q7LVu2YNy4cTA1NcW4ceOwbt06teWnTp3CG2+8AblcDi8vL4SEhOh0/GfPnsHIyAhGRkY62Z5MJsNbb72F0aNHQwiBhIQErFu3DsnJyTh8+DB69+6tk3HefvttXL16Ved/Kb9cv1KpxOXLl7F7925kZmZi6dKlCAgIUK0vhEB2djaMjY1haGio01oqU+F+dfLkSfTo0aPC27tz5w5cXV3x7rvvok+fPigoKEBqaiouXLiAvXv3QiaTYdOmTRg+fLiqT0FBAXJycmBiYgIDA83/drW0tMR//vMfrY6m5eXlIS8vD6ampqo2mUyGyZMnY82aNVq80vLVlp+fj9zcXMjl8iJHmIjKopufzkRVQJ8+fbB7926sXr1aLXjs2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681PHz8/Nx9OhRDBw4EA0aNFC1Ozo6YsSIEfjtt9+Qnp5e5uvYtGkTbG1tYWdnh06dOuHs2bMICAhQHa14se7MzEz8/fff6Ny5M4QQiI6OLrK9SZMmlTlmIS8vLzg5OWH79u2qtqtXr+LKlStF5pKUh6WlJQDgyZMnxS5//Pgxzpw5g/Hjx8PFxUVtWeEpDyEE9uzZg379+kEIgb///lv18PHxgVKpLPYzfNnLn2lFPr+YmBjExcVhxIgR+Oeff1T1ZGZmomfPnjhz5gwKCgo0fJeKV9Z7p1AoAABhYWHIysoq9zjvv/++xut6enrCw8ND9dzFxQUDBgxAWFgY8vPzy11DWY4fP46cnBxMnz5dbXL2hAkTYGVlhcOHD6utb2lpqbb/mpiYoGPHjrh9+3al1UhVB09jkaTY2trCy8sLO3bsQFZWFvLz8/Gf//ynxPVDQkKwaNEixMTEIDs7W9Ve3NwEV1fXMsd//PgxsrKy0LRp0yLLmjVrhoKCAty/fx8tWrQodTsDBgyAv78/ZDIZatSogRYtWqhNKr537x7mzZuHgwcPIjU1Va1v4dyMQkZGRqhbt26ZtRcyMDCAr68v1q9fj6ysLJibm2P79u0wNTXF0KFDNd5OSTIyMgAANWrUKHZ54S+f0k6BPH78GGlpadi4cSM2btxY7DrJycll1vLyZ1qRzy8uLg4AMGbMmBLHUyqVqFWrVpl1laSs987V1RUBAQFYuXIltm/fjtdffx39+/fHyJEjVUFIE5rs64UaN25cpK1JkybIysrC48eP4eDgoPG2tHH37l0AKPJ
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Plot\n",
"plt.bar(dist_mp.keys(), dist_mp.values(), color='#F00a00')\n",
"plt.xticks(list(dist_mp.keys()))\n",
"plt.title(\"Mario Party Dice role Distribution\")\n",
"plt.xlabel(\"Points rolled\")\n",
"plt.ylabel(\"Number of occurrences\")\n",
"plt.show()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.7"
}
},
"nbformat": 4,
"nbformat_minor": 5
}