diff --git a/info4/kapitel-0/Mengentheorie.ipynb b/info4/kapitel-0/Mengentheorie.ipynb index 3e5d2a5f07a46facb29de7f756ebfb9cf9919f31..8a2e8cc1d7b29a69f4a14496653871b424e599fc 100644 --- a/info4/kapitel-0/Mengentheorie.ipynb +++ b/info4/kapitel-0/Mengentheorie.ipynb @@ -741,6 +741,1129 @@ "Gesetze von De Morgan: $Op1( x ~ Op2 ~ y)$ wird umgewandelt nach $Op1(x) ~ Op2' ~ Op1(y)$, wo Op2' der duale Operator von Op2 ist." ] }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\renewcommand{\\emptyset}{\\mathord\\varnothing}\\emptyset$" + ], + "text/plain": [ + "∅" + ] + }, + "execution_count": 37, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "{2,4} ∩ (ℤ \\ {2,4})" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Teilmenge\n", + "\n", + "\n", + "Eine Menge $x$ ist eine Teilmenge oder Untermenge von $y$ wenn gilt:\n", + "* $\\forall a. a\\in x \\Rightarrow a \\in y$\n", + "\n", + "Wir benutzen diese Schreibweise $x \\subseteq y$.\n", + "In diesem Fall ist $y$ auch eine Obermenge von $y$, geschrieben als $y \\supseteq x$.\n", + "\n", + "Für die echte Teilmenge benutzen wir folgende Schreibweise und Definition:\n", + "* $x \\subset y$ $\\Leftrightarrow$ $(x \\subseteq y \\wedge x\\neq y)$." + ] + }, + { + "cell_type": "code", + "execution_count": 68, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\newcommand{\\upto}{\\mathbin{.\\mkern1mu.}}\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{x} = \\{1,3\\}$\n", + "* $\\mathit{y} = (1 \\upto 5)$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tx = {1,3}\n", + "\ty = (1 ‥ 5)" + ] + }, + "execution_count": 68, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "x={1,3} ∧ y = 1..5 ∧ ∀a.(a∈x ⇒ a∈y)" + ] + }, + { + "cell_type": "code", + "execution_count": 67, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\mathit{FALSE}$" + ], + "text/plain": [ + "FALSE" + ] + }, + "execution_count": 67, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "x={1,3} ∧ y = 1..5 ∧ ∀a.(a∈y ⇒ a∈x)" + ] + }, + { + "cell_type": "code", + "execution_count": 61, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$" + ], + "text/plain": [ + "TRUE" + ] + }, + "execution_count": 61, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "{1,3} ⊂ 1..5" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Kardinalität\n", + "\n", + "Die Anzahl der Elemente einer Menge $x$ schreiben wir als \n", + "* $\\mid x\\mid$ oder auch als $card(x)$ (B Schreibweise)." + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$3$" + ], + "text/plain": [ + "3" + ] + }, + "execution_count": 38, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "card({1,2,3})" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$3$" + ], + "text/plain": [ + "3" + ] + }, + "execution_count": 39, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "card({1,1,2,3,2})" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$0$" + ], + "text/plain": [ + "0" + ] + }, + "execution_count": 40, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "card(∅)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Achtung, die Kardinalität kann auch unendlich sein: je nach Formalismus, ist folgender Ausdruck entweder unendlich oder nicht wohl definiert: $\\mid \\{x \\mid x>0\\} \\mid$" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": {}, + "outputs": [ + { + "ename": "CommandExecutionException", + "evalue": ":eval: NOT-WELL-DEFINED: \ncard applied to very large set, cardinality not representable in ProB: closure([x],[integer],b(greater(b(identifier(...),integer,[...]),b(value(...),integer,[...])),pred,[nodeid(pos(...))]))\n\n", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:eval: NOT-WELL-DEFINED: \u001b[0m", + "\u001b[1m\u001b[31mcard applied to very large set, cardinality not representable in ProB: closure([x],[integer],b(greater(b(identifier(...),integer,[...]),b(value(...),integer,[...])),pred,[nodeid(pos(...))]))\u001b[0m" + ] + } + ], + "source": [ + "card({x|x>0})" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# SEND+MORE=MONEY\n", + "\n", + "Klassisches arithmetisches Puzzle wo acht unterschiedliche Ziffern gefunden werden sollen die folgende Gleichung erfüllen:\n", + "\n", + "| | | | | |\n", + "|---|---|---|---|---|\n", + "| | S | E | N | D |\n", + "| + | M | O | R | E |\n", + " |\n", + "|= M| O | N | E | Y |\n", + "| | | | | |\n", + "\n", + "Wir können dies nun in Logik, Mengentheorie und Arithmetik modellieren und lösen.\n", + " " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Wir haben acht Ziffern:" + ] + }, + { + "cell_type": "code", + "execution_count": 69, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{R} = 0$\n", + "* $\\mathit{S} = 0$\n", + "* $\\mathit{D} = 0$\n", + "* $\\mathit{E} = 0$\n", + "* $\\mathit{Y} = 0$\n", + "* $\\mathit{M} = 0$\n", + "* $\\mathit{N} = 0$\n", + "* $\\mathit{O} = 0$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tR = 0\n", + "\tS = 0\n", + "\tD = 0\n", + "\tE = 0\n", + "\tY = 0\n", + "\tM = 0\n", + "\tN = 0\n", + "\tO = 0" + ] + }, + "execution_count": 69, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "{S,E,N,D,M,O,R,Y} ⊆ 0..9" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "diese Ziffern sind alle unterschiedlich:" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{R} = 1$\n", + "* $\\mathit{S} = 7$\n", + "* $\\mathit{D} = 4$\n", + "* $\\mathit{E} = 6$\n", + "* $\\mathit{Y} = 0$\n", + "* $\\mathit{M} = 3$\n", + "* $\\mathit{N} = 5$\n", + "* $\\mathit{O} = 2$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tR = 1\n", + "\tS = 7\n", + "\tD = 4\n", + "\tE = 6\n", + "\tY = 0\n", + "\tM = 3\n", + "\tN = 5\n", + "\tO = 2" + ] + }, + "execution_count": 43, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "{S,E,N,D,M,O,R,Y} ⊆ 0..9 ∧\n", + "card({S,E,N,D,M,O,R,Y}) = 8" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "und wobei die zwei führenden Ziffern S und M ungleich 0 sind:" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{R} = 1$\n", + "* $\\mathit{S} = 7$\n", + "* $\\mathit{D} = 4$\n", + "* $\\mathit{E} = 6$\n", + "* $\\mathit{Y} = 0$\n", + "* $\\mathit{M} = 3$\n", + "* $\\mathit{N} = 5$\n", + "* $\\mathit{O} = 2$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tR = 1\n", + "\tS = 7\n", + "\tD = 4\n", + "\tE = 6\n", + "\tY = 0\n", + "\tM = 3\n", + "\tN = 5\n", + "\tO = 2" + ] + }, + "execution_count": 45, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "{S,E,N,D,M,O,R,Y} ⊆ 0..9 ∧ card({S,E,N,D,M,O,R,Y}) = 8 ∧\n", + "S ≠ 0 & M ≠ 0" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "und wo die Summe von SEND+MORE MONEY ergibt:" + ] + }, + { + "cell_type": "code", + "execution_count": 70, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{R} = 8$\n", + "* $\\mathit{S} = 9$\n", + "* $\\mathit{D} = 7$\n", + "* $\\mathit{E} = 5$\n", + "* $\\mathit{Y} = 2$\n", + "* $\\mathit{M} = 1$\n", + "* $\\mathit{N} = 6$\n", + "* $\\mathit{O} = 0$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tR = 8\n", + "\tS = 9\n", + "\tD = 7\n", + "\tE = 5\n", + "\tY = 2\n", + "\tM = 1\n", + "\tN = 6\n", + "\tO = 0" + ] + }, + "execution_count": 70, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "{S,E,N,D,M,O,R,Y} ⊆ 0..9 ∧ card({S,E,N,D,M,O,R,Y}) = 8 ∧ S ≠ 0 & M ≠ 0 ∧\n", + " S*1000 + E*100 + N*10 + D +\n", + " M*1000 + O*100 + R*10 + E =\n", + " M*10000 + O*1000 + N*100 + E*10 + Y" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Aber ist dies die einzige Lösung ? Wir können einfach die Menge aller Lösungen berechnen:" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\{(9\\mapsto 5\\mapsto 6\\mapsto 7\\mapsto 1\\mapsto 0\\mapsto 8\\mapsto 2)\\}$" + ], + "text/plain": [ + "{(9↦5↦6↦7↦1↦0↦8↦2)}" + ] + }, + "execution_count": 48, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + " {S,E,N,D, M,O,R, Y |\n", + " {S,E,N,D, M,O,R, Y} ⊆ 0..9 ∧ S >0 ∧ M >0 ∧ \n", + " card({S,E,N,D, M,O,R, Y}) = 8 ∧ \n", + " S*1000 + E*100 + N*10 + D +\n", + " M*1000 + O*100 + R*10 + E =\n", + " M*10000 + O*1000 + N*100 + E*10 + Y }" + ] + }, + { + "cell_type": "code", + "execution_count": 71, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "|S|E|N|D|M|O|R|Y|\n", + "|---|---|---|---|---|---|---|---|\n", + "|$9$|$5$|$6$|$7$|$1$|$0$|$8$|$2$|\n" + ], + "text/plain": [ + "S\tE\tN\tD\tM\tO\tR\tY\n", + "9\t5\t6\t7\t1\t0\t8\t2\n" + ] + }, + "execution_count": 71, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + ":table {S,E,N,D, M,O,R, Y |\n", + " {S,E,N,D, M,O,R, Y} ⊆ 0..9 ∧ S >0 ∧ M >0 ∧ \n", + " card({S,E,N,D, M,O,R, Y}) = 8 ∧ \n", + " S*1000 + E*100 + N*10 + D +\n", + " M*1000 + O*100 + R*10 + E =\n", + " M*10000 + O*1000 + N*100 + E*10 + Y }" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "| | | | | |\n", + "|---|---|---|---|---|\n", + "| | S=9 | E=5 | N=6 | D=7 |\n", + "| + | M=1 | O=0 | R=8 | E=5 |\n", + " |\n", + "|= M=1| O=0 | N=6 | E=5 | Y=2 |\n", + "| | | | | |" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Ein anderes arithmetisches Puzzle ist KISS*KISS=PASSION." + ] + }, + { + "cell_type": "code", + "execution_count": 72, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "|K|I|S|P|A|O|N|\n", + "|---|---|---|---|---|---|---|\n", + "|$2$|$0$|$3$|$4$|$1$|$8$|$9$|\n" + ], + "text/plain": [ + "K\tI\tS\tP\tA\tO\tN\n", + "2\t0\t3\t4\t1\t8\t9\n" + ] + }, + "execution_count": 72, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + ":table {K, I, S, P, A, O, N |\n", + " {K,P} ⊆ 1..9 ∧\n", + " {I,S,A,O,N} ⊆ 0..9 ∧\n", + " (1000*K+100*I+10*S+S) * (1000*K+100*I+10*S+S) \n", + " = 1000000*P+100000*A+10000*S+1000*S+100*I+10*O+N &\n", + " card({K, I, S, P, A, O, N}) = 7}" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Mengen von Mengen\n", + "\n", + "Mengen können selber auch Mengen beinhalten\n", + "Dies sind alles unterschiedliche Mengen:\n", + "* $\\{\\{2\\},\\{3,4\\}\\}$\n", + "* $\\{\\{2,3\\},\\{4\\}\\}$\n", + "* $\\{\\{2,3\\},\\{3,4\\}\\}$\n", + "* $\\{\\{2,3,4\\}\\}$\n", + "* $\\{2,3,4\\}$ \n", + "\n", + "Wir haben zum Beispiel:\n", + "* $\\mathit{card}(\\{\\{2,3,4\\}\\}) = 1$\n", + "* $\\mathit{card}(\\{\\{2\\},\\{3,4\\}\\}) = 2$\n", + "* $\\mathit{card}(\\{2,3,4\\}) = 3$\n", + "* $\\{2\\} \\in \\{\\{2\\},\\{3,4\\}\\} $\n", + "* $\\{2\\} \\not\\in \\{\\{2,3\\},\\{4\\}\\} $" + ] + }, + { + "cell_type": "code", + "execution_count": 57, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$3$" + ], + "text/plain": [ + "3" + ] + }, + "execution_count": 57, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "card({2,3,4})" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$1$" + ], + "text/plain": [ + "1" + ] + }, + "execution_count": 52, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "card({{2,3,4}})" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$2$" + ], + "text/plain": [ + "2" + ] + }, + "execution_count": 53, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "card({{2},{3,4}})" + ] + }, + { + "cell_type": "code", + "execution_count": 55, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$" + ], + "text/plain": [ + "TRUE" + ] + }, + "execution_count": 55, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "{2} ∈ {{2}, {3,4}}" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\mathit{FALSE}$" + ], + "text/plain": [ + "FALSE" + ] + }, + "execution_count": 56, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "{2} ∈ {{2,3}, {4}}" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Mengen von Mengen und die leere Menge\n", + "\n", + "Achtung: man muss die leere Menge von der Menge die die leere Menge beinhaltet unterscheiden:\n", + "* $\\emptyset \\neq \\{\\emptyset\\}$" + ] + }, + { + "cell_type": "code", + "execution_count": 76, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\mathit{FALSE}$" + ], + "text/plain": [ + "FALSE" + ] + }, + "execution_count": 76, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "∅ = {∅}" + ] + }, + { + "cell_type": "code", + "execution_count": 77, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$0$" + ], + "text/plain": [ + "0" + ] + }, + "execution_count": 77, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "card(∅)" + ] + }, + { + "cell_type": "code", + "execution_count": 78, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$1$" + ], + "text/plain": [ + "1" + ] + }, + "execution_count": 78, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "card({∅})" + ] + }, + { + "cell_type": "code", + "execution_count": 83, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$" + ], + "text/plain": [ + "TRUE" + ] + }, + "execution_count": 83, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "∅ ∈ {∅}" + ] + }, + { + "cell_type": "code", + "execution_count": 84, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\mathit{FALSE}$" + ], + "text/plain": [ + "FALSE" + ] + }, + "execution_count": 84, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "∅ ∈ ∅" + ] + }, + { + "cell_type": "code", + "execution_count": 85, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$" + ], + "text/plain": [ + "TRUE" + ] + }, + "execution_count": 85, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "∅ ∉ ∅" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Potenzmenge\n", + "Die Menge aller Untermengen einer Menge $A$ schreiben wir als $\\pow(\\mathit{A}) $ oder auch als $2^{A}$." + ] + }, + { + "cell_type": "code", + "execution_count": 86, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\renewcommand{\\emptyset}{\\mathord\\varnothing}\\{\\emptyset,\\{1\\},\\{1,2\\},\\{2\\}\\}$" + ], + "text/plain": [ + "{∅,{1},{1,2},{2}}" + ] + }, + "execution_count": 86, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "POW({1,2})" + ] + }, + { + "cell_type": "code", + "execution_count": 87, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\renewcommand{\\emptyset}{\\mathord\\varnothing}\\{\\emptyset\\}$" + ], + "text/plain": [ + "{∅}" + ] + }, + "execution_count": 87, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "POW(∅)" + ] + }, + { + "cell_type": "code", + "execution_count": 88, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\renewcommand{\\emptyset}{\\mathord\\varnothing}\\{\\emptyset,\\{1\\},\\{1,2\\},\\{1,3\\},\\{2\\},\\{1,2,3\\},\\{2,3\\},\\{3\\}\\}$" + ], + "text/plain": [ + "{∅,{1},{1,2},{1,3},{2},{1,2,3},{2,3},{3}}" + ] + }, + "execution_count": 88, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "POW(1..3)" + ] + }, + { + "cell_type": "code", + "execution_count": 98, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "|Elements|\n", + "|---|\n", + "|$\\renewcommand{\\emptyset}{\\mathord\\varnothing}\\emptyset$|\n", + "|$\\{1\\}$|\n", + "|$\\{1,2\\}$|\n", + "|$\\{1,3\\}$|\n", + "|$\\{2\\}$|\n", + "|$\\{1,2,3\\}$|\n", + "|$\\{2,3\\}$|\n", + "|$\\{3\\}$|\n" + ], + "text/plain": [ + "Elements\n", + "{}\n", + "{1}\n", + "{1,2}\n", + "{1,3}\n", + "{2}\n", + "{1,2,3}\n", + "{2,3}\n", + "{3}\n" + ] + }, + "execution_count": 98, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + ":table POW(1..3)" + ] + }, + { + "cell_type": "code", + "execution_count": 101, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "|Elements|\n", + "|---|\n", + "|$\\renewcommand{\\emptyset}{\\mathord\\varnothing}\\renewcommand{\\emptyset}{\\mathord\\varnothing}\\renewcommand{\\emptyset}{\\mathord\\varnothing}\\emptyset$|\n", + "|$\\{\\emptyset\\}$|\n", + "|$\\{\\emptyset,\\{1\\}\\}$|\n", + "|$\\{\\{1\\}\\}$|\n" + ], + "text/plain": [ + "Elements\n", + "{}\n", + "{{}}\n", + "{{},{1}}\n", + "{{1}}\n" + ] + }, + "execution_count": 101, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + ":table POW(POW({1}))" + ] + }, + { + "cell_type": "code", + "execution_count": 90, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$8$" + ], + "text/plain": [ + "8" + ] + }, + "execution_count": 90, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "card(POW(1..3))" + ] + }, + { + "cell_type": "code", + "execution_count": 91, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$1024$" + ], + "text/plain": [ + "1024" + ] + }, + "execution_count": 91, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "card(POW(1..10))" + ] + }, + { + "cell_type": "code", + "execution_count": 92, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$1267650600228229401496703205376$" + ], + "text/plain": [ + "1267650600228229401496703205376" + ] + }, + "execution_count": 92, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "card(POW(1..100))" + ] + }, + { + "cell_type": "code", + "execution_count": 95, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$340282366920938463463374607431768211456$" + ], + "text/plain": [ + "340282366920938463463374607431768211456" + ] + }, + "execution_count": 95, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "card(POW(POW(1..7)))" + ] + }, + { + "cell_type": "code", + "execution_count": 96, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "$115792089237316195423570985008687907853269984665640564039457584007913129639936$" + ], + "text/plain": [ + "115792089237316195423570985008687907853269984665640564039457584007913129639936" + ] + }, + "execution_count": 96, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "card(POW(POW(POW(1..3))))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Relationen\n", + "* Was ist eine Relation?\n", + "* Wie kann man Relationen in Mengentheorie und Logik abbilden?" + ] + }, { "cell_type": "code", "execution_count": null,