diff --git a/notebooks/week-2.ipynb b/notebooks/week-2.ipynb index 0c178b1..a4f9f52 100644 --- a/notebooks/week-2.ipynb +++ b/notebooks/week-2.ipynb @@ -38,6 +38,7 @@ "\n", "from src.maths.diagrams import *;\n", "from src.maths.sets import *;\n", + "from src.widgets import *;\n", "\n", "np.random.seed(8007253); # zur Wiederholbarkeit" ] @@ -48,6 +49,20 @@ "metadata": {}, "outputs": [], "source": [ + "FunctionDiagramWidget(\n", + " N = 2,\n", + " fnames = ['f', 'g', 'h'],\n", + " setnames = ['X', 'Y', 'Z', 'W'],\n", + ").run();" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# ohne Zufallserzeugung:\n", "X = ['a', 'b', 'c', 'd', 'e'];\n", "Y = [2, 3, 5, 7, 11, 13, 17];\n", "Z = ['α', 'β', 'γ', 'δ'];\n", @@ -59,24 +74,6 @@ ");\n", "comp.draw(show_labels=True);" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "X = randomset_alphabet(N=3);\n", - "Y = randomset_integers(N=5);\n", - "Z = randomset_greek(N=7);\n", - "f = random_function(X, Y, injective=True);\n", - "g = random_function(Y, Z, injective=True);\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": {