315 lines
188 KiB
Plaintext
315 lines
188 KiB
Plaintext
|
{
|
||
|
"cells": [
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "6fc01cbe-c0f2-47cf-9e63-d36025f14198",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"# Normen"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"attachments": {
|
||
|
"d843217e-952b-46e6-8a43-0ab6e38fe50d.png": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA5EAAAJUCAYAAACMgKIMAAAgAElEQVR4XuzdD/gVVX7n+cM+M5PQakRaoKcHiLb5kQch0E1w5YcYJAi6bSYgIG6L0YWff6DT8REwvTKwMd3Pj+BmFHvtTgMqONpqLwiIM+nZViDCiqALa7cEZAJPk25gTCMtYEdDMjs7Lt/qPbfPrXuq6lTdU/dW1X1fH5+k/dWtOvU6p+rWp07VOX0+Of9RfBBAAAEEEEAAAQQQQAABBBBwEOhDiHRQYhEEEEAAAQQQQAABBBBAAIFAgBBJQ0AAAQQQQAABBBBAAAEEEHAWIEQ6U7EgAggggAACCCCAAAIIIIAAIZI2gAACCCCAAAIIIIAAAggg4CxAiHSmYkEEEEAAAQQQQAABBBBAAAFCJG0AAQQQQAABBBBAAAEEEEDAWYAQ6UzFgggggAACCCCAAAIIIIAAAoRI2gACCCCAAAIIIIAAAggggICzACHSmYoFEUAAAQQQQAABBBBAAAEECJG0AQQQQAABBBBAAAEEEEAAAWcBQqQzFQsigAACCCCAAAIIIIAAAggQImkDCCCAAAIIIIAAAggggAACzgKESGcqFkQAAQQQQAABBBBAAAEEECBE0gYQQAABBBBAAAEEEEAAAQScBQiRzlQsiAACCCCAAAIIIIAAAgggQIikDSCAAAIIIIAAAggggAACCDgLECKdqVgQAQQQQAABBBBAAAEEEECAEEkbQAABBBBAAAEEEEAAAQQQcBYgRDpTsSACCCCAAAIIIIAAAggggAAhkjaAAAIIIIAAAggggAACCCDgLNCxIfKf1D+p//f8P3wQQAABBKot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|
}
|
||
|
},
|
||
|
"cell_type": "markdown",
|
||
|
"id": "9c937dc2-2946-4835-bf9c-c53a0337e869",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"![grafik.png](attachment:d843217e-952b-46e6-8a43-0ab6e38fe50d.png)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 2,
|
||
|
"id": "0efc8c51-d7ee-4912-92a6-c3c0f93b4895",
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"from math import sqrt\n",
|
||
|
"\n",
|
||
|
"def l1(x: list[float]) -> float:\n",
|
||
|
" a=0\n",
|
||
|
" for i in x:\n",
|
||
|
" a+= abs(i)\n",
|
||
|
" return a\n",
|
||
|
"\n",
|
||
|
"def l2(x: list[float]) -> float:\n",
|
||
|
" a=0\n",
|
||
|
" for i in x:\n",
|
||
|
" a+= i**2\n",
|
||
|
" return sqrt(a)\n",
|
||
|
"\n",
|
||
|
"def li(x: list[float]) -> float:\n",
|
||
|
" return max(x)\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 24,
|
||
|
"id": "a96e8b6e-563d-4a3c-9f74-865f19f69884",
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"from IPython.display import display, Math, Latex\n",
|
||
|
"\n",
|
||
|
"def norms(x: list[float]):\n",
|
||
|
" display(Math(f\"$x = {x}$\"))\n",
|
||
|
" display(Math(f\"$||x||_{{l1}} = {l1(x)}$\"))\n",
|
||
|
" display(Math(f\"$||x||_{{l2}} = {l2(x)}$\"))\n",
|
||
|
" display(Math(f\"$||x||_{{l \\\\infty}} = {li(x)}$\"))"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 26,
|
||
|
"id": "d98ecf8f-0a20-4914-b183-a5a1ed347058",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"text/latex": [
|
||
|
"$\\displaystyle x = (1, 3, 2)$"
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Math object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/latex": [
|
||
|
"$\\displaystyle ||x||_{l1} = 6$"
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Math object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/latex": [
|
||
|
"$\\displaystyle ||x||_{l2} = 3.7416573867739413$"
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Math object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/latex": [
|
||
|
"$\\displaystyle ||x||_{l \\infty} = 3$"
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Math object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/latex": [
|
||
|
"$\\displaystyle x = (20, 3, 2)$"
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Math object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/latex": [
|
||
|
"$\\displaystyle ||x||_{l1} = 25$"
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Math object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/latex": [
|
||
|
"$\\displaystyle ||x||_{l2} = 20.322401432901575$"
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Math object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/latex": [
|
||
|
"$\\displaystyle ||x||_{l \\infty} = 20$"
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Math object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"x = (1,3,2)\n",
|
||
|
"norms(x)\n",
|
||
|
"x = (20,3,2)\n",
|
||
|
"norms(x)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "689e658e-1eb5-4e1a-93f4-82b0fa065eb9",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"# Metriken"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"attachments": {
|
||
|
"87611157-5376-4e9d-bc57-bc2072304dc7.png": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA3UAAALtCAYAAACPTE26AAAgAElEQVR4Xuy9DfBWxZ3n29zZW7OWzor4NvdepBJn8C5KIHGgFMESg2DVzlRE8WVHTGYHVNTdpATZqTBSm8rUn9HaFbWS2YAvmLqJOAu+kR3dGkUjlKCkZM3ogFRphWSAzQQ0qJlMMVs1U1x+J9OP/e9/n9N9zuk+zznP8zkWpfL06ZdP/7rP79uv446feBQPBCAAAQhAAAIQgAAEIAABCHSSwDhEXSfrjUxDAAIQgAAEIAABCEAAAhDICCDqMAQIQAACEIAABCAAAQhAAAIdJoCo63DlkXUIQAACEIAABCAAAQhAAAKIOmwAAhCAAAQgAAEIQAACEIBAhwkg6jpceWQdAhCAAAQgAAEIQAACEIAAog4bgAAEIAABCEAAAhCAAAQg0GECrRN1/6T+qcM4yToEIAABCEAAAhCAAASGh8Cvq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WDdw0kPnmm28qidmBfR9v2oZES9XAKST+qoRo
|
||
|
}
|
||
|
},
|
||
|
"cell_type": "markdown",
|
||
|
"id": "ec76ba02-f936-454e-9096-9aa0ce248091",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"![grafik.png](attachment:87611157-5376-4e9d-bc57-bc2072304dc7.png)\n",
|
||
|
"\n",
|
||
|
"---\n",
|
||
|
"\n",
|
||
|
"![grafik.png](attachment:ecffa3c8-4a1b-4041-99eb-dea0676bc39c.png)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 86,
|
||
|
"id": "dddde255-6445-4913-b2c6-036331b4d318",
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"import numpy as np\n",
|
||
|
"def distance(x: list[float], y: list[float], norm = l2) -> float:\n",
|
||
|
" return abs(norm(np.array(x) - np.array(y)))"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 95,
|
||
|
"id": "0a0172b2-c513-4ad4-adb2-509146773140",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"text/latex": [
|
||
|
"$\\displaystyle a = (1, 2, 3)$"
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Math object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/latex": [
|
||
|
"$\\displaystyle b = (2, -1, 5)$"
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Math object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/latex": [
|
||
|
"$\\displaystyle d(a,b) = 3.7416573867739413$"
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Math object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/latex": [
|
||
|
"$\\displaystyle d(a,b)_{L1} = 6$"
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Math object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/latex": [
|
||
|
"$\\displaystyle d(a,b)_{L1\\infty} = 3$"
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Math object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"a = (1,2,3)\n",
|
||
|
"b = (2,-1,5)\n",
|
||
|
"display(Math(f\"$a = {a}$\"))\n",
|
||
|
"display(Math(f\"$b = {b}$\"))\n",
|
||
|
"display(Math(f\"$d(a,b) = {distance(a,b)}$\"))\n",
|
||
|
"display(Math(f\"$d(a,b)_{{L1}} = {distance(a,b, norm=l1)}$\"))\n",
|
||
|
"display(Math(f\"$d(a,b)_{{L\\\\infty}} = {distance(a,b, norm=li)}$\"))"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"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.2"
|
||
|
}
|
||
|
},
|
||
|
"nbformat": 4,
|
||
|
"nbformat_minor": 5
|
||
|
}
|