|
44 | 44 | "here \n",
|
45 | 45 | "\n",
|
46 | 46 | "\\begin{eqnarray}\n",
|
47 |
| - "\\|e\\|_2 & = & \\left(e_1^2 + e_2^2 + \\dots + e_N\\right)^{\\frac{1}{2}}\n", |
| 47 | + "\\|e\\|_2 & = & \\left(e_1^2 + e_2^2 + \\dots + e_N^2\\right)^{\\frac{1}{2}}\n", |
48 | 48 | "\\end{eqnarray}\n",
|
49 | 49 | "\n",
|
50 | 50 | "Another possibility is measuring the error with other norms, such as the absolute error\n",
|
51 | 51 | "\\begin{eqnarray}\n",
|
52 |
| - "\\|e\\|_1 & = & \\left|e_1\\right| + \\left|e_2\\right| + \\dots + \\left|e_2\\right|\n", |
| 52 | + "\\|e\\|_1 & = & \\left|e_1\\right| + \\left|e_2\\right| + \\dots + \\left|e_N\\right|\n", |
53 | 53 | "\\end{eqnarray}\n",
|
54 | 54 | "\n",
|
55 | 55 | "and more general $p$ norms\n",
|
56 | 56 | "\\begin{eqnarray}\n",
|
57 |
| - "\\|e\\|_p & = & \\left( \\left|e_1\\right|^p + \\left|e_2\\right|^p + \\dots + \\left|e_2\\right|^p\\right)^{\\frac{1}{p}}\n", |
| 57 | + "\\|e\\|_p & = & \\left( \\left|e_1\\right|^p + \\left|e_2\\right|^p + \\dots + \\left|e_N\\right|^p\\right)^{\\frac{1}{p}}\n", |
58 | 58 | "\\end{eqnarray}\n",
|
59 | 59 | "\n",
|
60 | 60 | "\n",
|
|
827 | 827 | "plt.show()"
|
828 | 828 | ]
|
829 | 829 | },
|
830 |
| - { |
831 |
| - "cell_type": "markdown", |
832 |
| - "metadata": {}, |
833 |
| - "source": [ |
834 |
| - "## Drawing norm-balls in 2-D\n", |
835 |
| - "\n", |
836 |
| - "Calculate the points in polar coordinates. \n", |
837 |
| - "\n", |
838 |
| - "In $2-D$, take rays of the form \n", |
839 |
| - "$$x = \\left( \\begin{array}{c} x_1 \\\\ x_2 \\end{array} \\right) = \n", |
840 |
| - "\\left( \\begin{array}{c} \\alpha \\cos(\\theta) \\\\ \\alpha \\sin(\\theta) \\end{array} \\right)\n", |
841 |
| - "$$\n", |
842 |
| - "where $\\alpha>0$ and $0\\leq \\theta \\leq 2\\pi$.\n", |
843 |
| - "\n", |
844 |
| - "The $p$-norm of a vector $x$ with $\\|x\\|_p = 1 $ satisfies \n", |
845 |
| - "\n", |
846 |
| - "$\\left|x_1\\right|^p + \\left|x_2\\right|^p = \\alpha^p (\\left|\\cos(\\theta)\\right|^p + \\left|\\sin(\\theta)\\right|^p) = 1 $\n", |
847 |
| - "\n", |
848 |
| - "Solve for $\\alpha(\\theta)$:\n", |
849 |
| - "$$\\alpha = \\left(\\frac{1}{\\left|\\cos(\\theta)\\right|^p + \\left|\\sin(\\theta)\\right|^p}\\right)^{1/p} $$" |
850 |
| - ] |
851 |
| - }, |
852 | 830 | {
|
853 | 831 | "cell_type": "code",
|
854 | 832 | "execution_count": 11,
|
|
1009 | 987 | "plt.xlim((-5,N))\n",
|
1010 | 988 | "plt.show()"
|
1011 | 989 | ]
|
1012 |
| - }, |
1013 |
| - { |
1014 |
| - "cell_type": "markdown", |
1015 |
| - "metadata": {}, |
1016 |
| - "source": [ |
1017 |
| - "The Matrix norm\n", |
1018 |
| - "\n", |
1019 |
| - "\\begin{eqnarray}\n", |
1020 |
| - "\\|A\\|_{(p,q)} = \\sup_{\\|x\\|\\neq 0} \\frac{\\|A x\\|_{(p)}}{\\|x\\|_{(q)}} = \\sup_{\\|x\\|_{(q)} = 1} {\\|A x\\|_{(p)}}\n", |
1021 |
| - "\\end{eqnarray}\n", |
1022 |
| - "\n" |
1023 |
| - ] |
1024 | 990 | }
|
1025 | 991 | ],
|
1026 | 992 | "metadata": {
|
|
0 commit comments