{
 "metadata": {
  "name": "",
  "signature": "sha256:5b530b225e354d5204b6b04a92931fcee5b92fa42094bc3f03e4022169e39d78"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Interest Formulas and their Application"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.1 Page 29"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variable\n",
      "P=20000.0;#in rupees\n",
      "n=10.0;#in years\n",
      "i=18.0;#% per annum\n",
      "\n",
      "#calculation\n",
      "F=P*(1+i/100)**n;\n",
      "\n",
      "#result\n",
      "print \"Maturity value after 18 years is  \", round(F,3),\" Rupees.\";\n",
      "print \" Ans in the book is not correct\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Maturity value after 18 years is :  104676.711  Rupees.\n",
        " Ans in the book is not correct\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.2 Page 30"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variable\n",
      "F=100000.0;#in rupees\n",
      "n=10.0;#in years\n",
      "i=15.0;#% per annum\n",
      "\n",
      "#calculation\n",
      "P=F/((1.0+i/100.0)**n);\n",
      "\n",
      "#result\n",
      "print \"The person has to invest  \", round(P,3),\" Rupees.\";\n",
      "print \" Ans in the book is not correct\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The person has to invest   24718.471  Rupees.\n",
        " Ans in the book is not correct\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.3 Page 31"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variable\n",
      "A=10000.0;#in rupees\n",
      "n=25.0;#in years\n",
      "i=20.0;#% per annum\n",
      "\n",
      "#calculation\n",
      "F=A*(((1+i/100)**n-1)/(i/100));\n",
      "\n",
      "#result\n",
      "print \"The future sum of the annual equal payment after 25 years is \",round(F,3),\" Rupees.\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The future sum of the annual equal payment after 25 years is  4719810.832  Rupees.\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.4 Page 32"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variable\n",
      "F=500000.0;#in rupees\n",
      "n=15.0;#in years\n",
      "i=18.0;#% per annum\n",
      "\n",
      "#calculation\n",
      "A=F*((i/100)/((1+i/100)**n-1));\n",
      "\n",
      "#result\n",
      "print \"The annual equal ammount which must be deposited for 15 years is  \",round(A,3),\" Rupees.\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The annual equal ammount which must be deposited for 15 years is   8201.391  Rupees.\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.5 Page 33"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initiasation of variable\n",
      "A=1000000.0;#in rupees\n",
      "n=20.0;#in years\n",
      "i=15.0;#% per annum\n",
      "\n",
      "#calculation\n",
      "P=A*(((1+i/100)**n-1)/((i/100)*(1+i/100)**n));\n",
      "\n",
      "#result\n",
      "print \"The amount of reserve which must be setup now is : \",round(P,3),\" Rupees\";\n",
      "print \" Ans in the book is not correct\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The amount of reserve which must be setup now is :  6259331.474  Rupees\n",
        " Ans in the book is not correct\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.6 Page 34"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variable\n",
      "P=1000000.0;#in rupees\n",
      "n=15.0;#in years\n",
      "i=18.0;#% per annum\n",
      "\n",
      "#calculation\n",
      "A=P*(((i/100)*(1+i/100)**n)/((1+i/100)**n-1));\n",
      "\n",
      "#result\n",
      "print \"The annual equivalent installment to be paid by the company to the bank is \",round(A),\" Rupees.\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The annual equivalent installment to be paid by the company to the bank is :  196403.0  Rupees.\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.7 Page 35"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initiation of variable\n",
      "A1=4000.0;#in rupees\n",
      "G=500.0;#in rupees\n",
      "n=10.0;#in years\n",
      "i=15.0;#% per annum\n",
      "\n",
      "#calculation\n",
      "A=A1+G*(((1+i/100)**n-(i/100)*n-1)/((i/100)*(1+i/100)**n-(i/100)));\n",
      "F=A*(((1+i/100)**n-1)/(i/100));\n",
      "\n",
      "#result\n",
      "print \"At the end of 10th year, the compound amountr of all his payments will be : \",round(F,3),\" Rupees.\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "At the end of 10th year, the compound amountr of all his payments will be :  115560.6  Rupees.\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.8 Page 36"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initiation of variable\n",
      "A1=8500.0;#in rupees\n",
      "G=-500.0;#in rupees\n",
      "n=10.0;#in years\n",
      "i=15.0;#% per annum\n",
      "\n",
      "#calculation\n",
      "A=A1+G*(((1+i/100)**n-(i/100)*n-1)/((i/100)*(1+i/100)**n-(i/100)));\n",
      "F=A*(((1+i/100)**n-1)/(i/100));\n",
      "\n",
      "#result\n",
      "print \"At the end of 10th year, the compound amountr of all his payments will be : \",round(F,3),\" Rupees.\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "At the end of 10th year, the compound amountr of all his payments will be :  138235.878  Rupees.\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.9 Page 38"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initiation of variable\n",
      "P=5000.0;#in rupees\n",
      "n=10.0;#in years\n",
      "i=12.0;#% per annum\n",
      "m=4.0;#no. of interest periods per year for quarterly\n",
      "\n",
      "#calculation\n",
      "N=n*m;\n",
      "r=i/m;\n",
      "F=P*(1+r/100)**N;\n",
      "\n",
      "#result\n",
      "print\"Maturity value after 10 years is  \",round(F,3),\" Rupees.\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Maturity value after 10 years is :  16310.189  Rupees.\n"
       ]
      }
     ],
     "prompt_number": 18
    }
   ],
   "metadata": {}
  }
 ]
}