{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Conditioning of $2\\times2$ matrices\n", "\n", "This mini-demo gives you the opportunity to play around with the 2-norm condition number of a $2\\times 2$ matrix. \n", "\n", "* What happens if you choose the columns of the matrix to be nearly linearly dependent?\n", "* What happens if you choose the diagonal entries to be very different in magnitude?" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import numpy as np\n", "import numpy.linalg as la" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "1.1442369886119867" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "la.cond([\n", " [1.1, 0.1],\n", " [0, 1]\n", " ], 2)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.5.0+" } }, "nbformat": 4, "nbformat_minor": 0 }