From 0abb8df55751eb2c72e2d167df43ef04f035899a Mon Sep 17 00:00:00 2001 From: pinar Date: Wed, 22 Feb 2017 12:41:52 +0200 Subject: [PATCH] final --- .../Exercise 3.3-checkpoint.ipynb | 142 ++++++++++ Exercise 3.3.ipynb | 247 ++++++++++++++++++ octave-workspace | Bin 0 -> 54 bytes 3 files changed, 389 insertions(+) create mode 100644 .ipynb_checkpoints/Exercise 3.3-checkpoint.ipynb create mode 100644 Exercise 3.3.ipynb create mode 100644 octave-workspace diff --git a/.ipynb_checkpoints/Exercise 3.3-checkpoint.ipynb b/.ipynb_checkpoints/Exercise 3.3-checkpoint.ipynb new file mode 100644 index 0000000..85a6813 --- /dev/null +++ b/.ipynb_checkpoints/Exercise 3.3-checkpoint.ipynb @@ -0,0 +1,142 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Exercise 3.3\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Vector and matrix p-norms are related by various inequalities, often involving the dimensions m or n. \n", + "\n", + "For each of the following, verify the inequality and give an example of a nonzero vector or matrix(for general m,n) for which equality is achieved.\n", + "\n", + "In this problem x is an m-vector and A is an m x n matrix." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## (a) $$ ||x||_\\infty \\leq ||x||_2 $$\n", + "\n", + "$$ \\Vert x \\Vert_\\infty $$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Lets consider a vector x; \n", + "\\begin{equation}\n", + " x\n", + " =\n", + " \\begin{bmatrix}\n", + " 1 \\\\\n", + " 2 \\\\\n", + " 3\n", + " \\end{bmatrix}\n", + "\\end{equation}\n", + "\n", + "Here, \n", + "\\begin{equation*}\n", + "||x||_\\infty = max |x_i| , where (1\\leq i \\leq m) = 3 \n", + "\\end{equation*}\n", + "\n", + "\\begin{equation*}\n", + "||x||_2 = (\\sum_{i=1}^m |x_i|^2)^{1/2} = 3.742\n", + "\\end{equation*}\n", + "\n", + "\\begin{equation*}\n", + "3 \\leq 3.742\n", + "\\end{equation*}\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### (b) $$||x||_2 \\leq \\sqrt{m}||x||_\\infty $$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\\begin{equation*}\n", + "\\sqrt{m}||x||_\\infty = 1.732*3 = 5.196\n", + "\\end{equation*}\n", + "\n", + "\\begin{equation*}\n", + "3.742 \\leq 5.196\n", + "\\end{equation*}" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### (c) $$||A||_\\infty \\leq \\sqrt{n}||A||_2 $$" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### (d) $$||A||_2 \\leq \\sqrt{m}||A||_\\infty $$" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Octave", + "language": "octave", + "name": "octave" + }, + "language_info": { + "file_extension": ".m", + "help_links": [ + { + "text": "GNU Octave", + "url": "https://www.gnu.org/software/octave/support.html" + }, + { + "text": "Octave Kernel", + "url": "https://github.com/Calysto/octave_kernel" + }, + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "octave", + "version": "4.2.0" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/Exercise 3.3.ipynb b/Exercise 3.3.ipynb new file mode 100644 index 0000000..90f214f --- /dev/null +++ b/Exercise 3.3.ipynb @@ -0,0 +1,247 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "deletable": true, + "editable": true + }, + "source": [ + "# Exercise 3.3\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "deletable": true, + "editable": true + }, + "source": [ + "Vector and matrix p-norms are related by various inequalities, often involving the dimensions m or n. \n", + "\n", + "For each of the following, verify the inequality and give an example of a nonzero vector or matrix(for general m,n) for which equality is achieved.\n", + "\n", + "In this problem x is an m-vector and A is an m x n matrix." + ] + }, + { + "cell_type": "markdown", + "metadata": { + "deletable": true, + "editable": true + }, + "source": [ + "## (a) $$ \\Vert x\\Vert_\\infty \\leq \\Vert x\\Vert_2 $$\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "deletable": true, + "editable": true + }, + "source": [ + "$$ \\Vert x\\Vert_\\infty = max |x_i| , where 1 \\leq i \\leq m$$\n", + "$$ \\Vert x\\Vert_2 = (\\sum_{i=1}^m |x_i|^2)^{1/2} $$\n", + "\n", + "\\begin{equation*}\n", + "max |x_i| = max (|x_i|^2)^{1/2} \\leq (\\sum_{i=1}^m |x_i|^2)^{1/2}\n", + "\\end{equation*}\n", + "\n", + "So, it can be seen that;\n", + "\n", + "\\begin{equation*}\n", + "\\Vert x\\Vert_\\infty \\leq \\Vert x\\Vert_2\n", + "\\end{equation*}\n", + "\n", + "For example, lets consider a vector x; \n", + "\\begin{equation*}\n", + " x\n", + " =\n", + " \\begin{bmatrix}\n", + " 1 \\\\\n", + " 2 \\\\\n", + " 3\n", + " \\end{bmatrix}\n", + "\\end{equation*}\n", + "\n", + "\\begin{equation*}\n", + "\\Vert x\\Vert_\\infty = 3 \n", + "\\end{equation*}\n", + "\n", + "\\begin{equation*}\n", + "\\Vert x\\Vert_2 = 3.742\n", + "\\end{equation*}\n", + "\n", + "\\begin{equation*}\n", + "3 \\leq 3.742\n", + "\\end{equation*}\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "deletable": true, + "editable": true + }, + "source": [ + "## (b) $$\\Vert x\\Vert_2 \\leq \\sqrt{m}\\Vert x\\Vert_\\infty $$" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "deletable": true, + "editable": true + }, + "source": [ + "This can be verified by following; \n", + "\n", + "\\begin{equation*}\n", + "(\\sum_{i=1}^m |x_i|^2)^{1/2} \\leq (\\sum_{i=1}^m max (|x_i|^2))^{1/2} = (m\\Vert x\\Vert_\\infty^2)^{1/2} = \\sqrt{m}\\Vert x\\Vert_\\infty\n", + "\\end{equation*}\n", + "\n", + "For the same x vector above, \n", + "\n", + "\\begin{equation*}\n", + "\\sqrt{m}\\Vert x\\Vert_\\infty = 1.732*3 = 5.196\n", + "\\end{equation*}\n", + "\n", + "\\begin{equation*}\n", + "3.742 \\leq 5.196\n", + "\\end{equation*}" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "deletable": true, + "editable": true + }, + "source": [ + "## (c) $$\\Vert A\\Vert_\\infty \\leq \\sqrt{n}\\Vert A\\Vert_2 $$" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "deletable": true, + "editable": true + }, + "source": [ + "\\begin{equation*}\n", + "\\Vert A\\Vert_\\infty = sup \\frac{\\Vert Ax\\Vert_\\infty}{\\Vert x\\Vert_\\infty}\n", + "\\end{equation*}\n", + "\n", + "Since we know that $ \\Vert x\\Vert_\\infty \\leq \\Vert x\\Vert_2 $;\n", + "\n", + "\\begin{equation*}\n", + "sup \\frac{\\Vert Ax\\Vert_\\infty}{\\Vert x\\Vert_\\infty} \\leq sup \\frac{\\Vert Ax\\Vert_2}{\\Vert x\\Vert_\\infty}\n", + "\\end{equation*}\n", + "\n", + "\n", + "As well, since $ \\Vert x\\Vert_2 \\leq \\sqrt{m}\\Vert x\\Vert_\\infty $ and $x$ is in $\\mathbb{C}^n$ ;\n", + "\n", + "\\begin{equation*}\n", + "sup \\frac{\\Vert Ax\\Vert_2}{\\Vert x\\Vert_\\infty} \\leq sup \\frac{\\Vert Ax\\Vert_2}{\\Vert x\\Vert_2/\\sqrt{n}} = \\sqrt{n}\\Vert A\\Vert_2\n", + "\\end{equation*}\n", + "\n", + "\n", + "Lets consider a vector x; \n", + "\\begin{equation}\n", + " A\n", + " =\n", + " \\begin{bmatrix}\n", + " 1 & 3\\\\\n", + " 2 & 1\\\\\n", + " 3 & 4\n", + " \\end{bmatrix}\n", + "\\end{equation}\n", + "\n", + "Here, \n", + "\\begin{equation*}\n", + "\\Vert A\\Vert_\\infty = max \\Vert a_{i}^{*}\\Vert _1 , where (1\\leq i \\leq m) = 7 \n", + "\\end{equation*}\n", + "\n", + "However, finding the 2-norm is a bit of a problem. \n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "deletable": true, + "editable": true + }, + "source": [ + "## (d) $$||A||_2 \\leq \\sqrt{m}||A||_\\infty $$" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true, + "deletable": true, + "editable": true + }, + "source": [ + "\\begin{equation*}\n", + "\\Vert A\\Vert_2 = sup \\frac{\\Vert Ax\\Vert_2}{\\Vert x\\Vert_2}\n", + "\\end{equation*}\n", + "\n", + "From the inequality b and $Ax$ is in $\\mathbb{C}^m$, we can write:\n", + "\n", + "\\begin{equation*}\n", + "sup \\frac{\\Vert Ax\\Vert_2}{\\Vert x\\Vert_2} \\leq sup \\sqrt{m}\\frac{\\Vert Ax\\Vert_\\infty}{\\Vert x\\Vert_2}\n", + "\\end{equation*}\n", + "\n", + "And from the inequality a,\n", + "\n", + "\\begin{equation*}\n", + "sup \\sqrt{m}\\frac{\\Vert Ax\\Vert_\\infty}{\\Vert x\\Vert_2} \\leq sup \\sqrt{m}\\frac{\\Vert Ax\\Vert_\\infty}{\\Vert x \\Vert_\\infty} = \\sqrt{m} \\Vert A\\Vert_\\infty\n", + "\\end{equation*}" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Octave", + "language": "octave", + "name": "octave" + }, + "language_info": { + "file_extension": ".m", + "help_links": [ + { + "text": "GNU Octave", + "url": "https://www.gnu.org/software/octave/support.html" + }, + { + "text": "Octave Kernel", + "url": "https://github.com/Calysto/octave_kernel" + }, + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "octave", + "version": "4.2.0" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/octave-workspace b/octave-workspace new file mode 100644 index 0000000000000000000000000000000000000000..065d6207a9c8e53cfec154eae7d87eb6fe25b978 GIT binary patch literal 54 zcmeZIE=ep))iu=hVPIxpU`Wg>29gX6|2cs~abbLMNl|8A`oI7G|1$ywSb^9?&q&Vz E0EcJ}Q~&?~ literal 0 HcmV?d00001