From 7b237246da925a92c600cdc25d1e446f3db4feec Mon Sep 17 00:00:00 2001 From: raj_mathe Date: Thu, 20 Oct 2022 16:22:22 +0200 Subject: [PATCH] master > master: notebook woche 2 --- notebooks/week-0.ipynb | 67 --------------------------- notebooks/week-2.ipynb | 100 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+), 67 deletions(-) delete mode 100644 notebooks/week-0.ipynb create mode 100644 notebooks/week-2.ipynb diff --git a/notebooks/week-0.ipynb b/notebooks/week-0.ipynb deleted file mode 100644 index dd1be41..0000000 --- a/notebooks/week-0.ipynb +++ /dev/null @@ -1,67 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Woche 0 - 10.-16. Oktober 2022 #\n", - "\n", - "Herzlich willkommen zur 0. Woche!" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import os;\n", - "import sys;\n", - "\n", - "# NOTE: need this to force jupyter to reload imports:\n", - "for key in list(sys.modules.keys()):\n", - " if key.startswith('src.'):\n", - " del sys.modules[key];\n", - "\n", - "os.chdir(os.path.dirname(_dh[0]));\n", - "sys.path.insert(0, os.getcwd());\n", - "\n", - "from src.thirdparty.maths import *;\n", - "from src.thirdparty.render import *;\n", - "\n", - "np.random.seed(8007253); # zur Wiederholbarkeit" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "A = np.random.randint(-100, 100, size=(4, 7));\n", - "display(array_to_latex(A, precision=3));" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3.10.6 64-bit", - "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.10.6" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/notebooks/week-2.ipynb b/notebooks/week-2.ipynb new file mode 100644 index 0000000..2309790 --- /dev/null +++ b/notebooks/week-2.ipynb @@ -0,0 +1,100 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Woche 2 - 17.-23. Oktober 2022 #\n", + "\n", + "Herzlich willkommen zur 2. Woche!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import os;\n", + "import sys;\n", + "\n", + "# NOTE: need this to force jupyter to reload imports:\n", + "for key in list(sys.modules.keys()):\n", + " if key.startswith('src.'):\n", + " del sys.modules[key];\n", + "\n", + "os.chdir(os.path.dirname(_dh[0]));\n", + "sys.path.insert(0, os.getcwd());\n", + "\n", + "from src.thirdparty.maths import *;\n", + "from src.thirdparty.render import *;\n", + "\n", + "from src.maths.diagrams import *;\n", + "from src.maths.sets import *;\n", + "\n", + "np.random.seed(8007253); # zur Wiederholbarkeit" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "A = np.random.randint(-100, 100, size=(4, 7));\n", + "\n", + "X = ['a', 'b', 'c', 'd', 'e'];\n", + "Y = [2, 3, 5, 7, 11, 13, 17];\n", + "Z = ['α', 'β', 'γ', 'δ'];\n", + "f = [('a', 5), ('b', 5), ('c', 17), ('d', 2)]\n", + "g = [(2, 'γ'), (3, 'α'), (5, 'β'), (7, 'δ'), (11, 'β'), (13, 'γ'), (17, 'β')];\n", + "comp = Functions(\n", + " Function(name=('$f$', 'X', 'Y'), domain=X, codomain=Y, fct=f),\n", + " Function(name=('$g$', 'Y', 'Z'), domain=Y, codomain=Z, fct=g),\n", + ");\n", + "comp.draw(show_labels=True);" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "A = np.random.randint(-100, 100, size=(4, 7));\n", + "\n", + "X = randomset_alphabet(low=2, high=5);\n", + "Y = randomset_integers(low=2, high=5);\n", + "Z = randomset_greek(low=2, high=5);\n", + "f = random_function(X, Y);\n", + "g = random_function(Y, Z);\n", + "comp = Functions(\n", + " Function(name=('$f$', 'X', 'Y'), domain=X, codomain=Y, fct=f),\n", + " Function(name=('$g$', 'Y', 'Z'), domain=Y, codomain=Z, fct=g),\n", + ");\n", + "comp.draw(show_labels=False);" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3.10.8 64-bit", + "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.10.8" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +}