summaryrefslogtreecommitdiff
path: root/Quantitative_Aptitude_for_Competitive_Examinations/Chapter18.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Quantitative_Aptitude_for_Competitive_Examinations/Chapter18.ipynb')
-rwxr-xr-xQuantitative_Aptitude_for_Competitive_Examinations/Chapter18.ipynb823
1 files changed, 823 insertions, 0 deletions
diff --git a/Quantitative_Aptitude_for_Competitive_Examinations/Chapter18.ipynb b/Quantitative_Aptitude_for_Competitive_Examinations/Chapter18.ipynb
new file mode 100755
index 00000000..d667f507
--- /dev/null
+++ b/Quantitative_Aptitude_for_Competitive_Examinations/Chapter18.ipynb
@@ -0,0 +1,823 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# 18: Shares and Debentures"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example number 18.1, Page number 18.6"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "cost of purchase in 1st case is 4750.0 Rs\n",
+ "cost of purchase in 2nd case is 3000 Rs\n",
+ "cost of purchase in 3rd case is 2750.0 Rs\n",
+ "cost of purchase in 4th case is 920.0 Rs\n",
+ "cost of purchase in 5th case is 2202.0 Rs\n",
+ "cost of purchase in 6th case is 2110.0 Rs\n",
+ "cost of purchase in 7th case is 945.0 Rs\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "a1=5000; #amount(Rs)\n",
+ "mv1=95; #market value\n",
+ "a2=3000; #amount(Rs)\n",
+ "a3=2500; #amount(Rs)\n",
+ "mv2=100+10; #market value\n",
+ "a4=1000; #amount(Rs)\n",
+ "d1=8; #discount(%)\n",
+ "a5=2200; #amount(Rs)\n",
+ "b1=1/11; #brokerage(%)\n",
+ "a6=2000; #amount(Rs)\n",
+ "mv3=100+5; #market value\n",
+ "b2=1/2; #brokerage(%)\n",
+ "d2=6; #discount\n",
+ "a7=1000; #amount(Rs)\n",
+ "b3=1/2; #brokerage(%)\n",
+ "\n",
+ "#Calculation\n",
+ "cp1=a1*mv1/100; #cost of purchase in 1st case(Rs)\n",
+ "cp2=a2; #cost of purchase in 2nd case(Rs)\n",
+ "cp3=a3*mv2/100; #cost of purchase in 3rd case(Rs) \n",
+ "cp4=a4*(100-d1)/100; #cost of purchase in 4th case(Rs) \n",
+ "cp5=a5*(100+b1)/100; #cost of purchase in 5th case(Rs) \n",
+ "cp6=a6*(mv3+b2)/100; #cost of purchase in 6th case(Rs) \n",
+ "mv4=100-d2; #market value\n",
+ "cp7=a7*(mv4+b3)/100; #cost of purchase in 7th case(Rs) \n",
+ "\n",
+ "#Result\n",
+ "print \"cost of purchase in 1st case is\",cp1,\"Rs\"\n",
+ "print \"cost of purchase in 2nd case is\",cp2,\"Rs\"\n",
+ "print \"cost of purchase in 3rd case is\",cp3,\"Rs\"\n",
+ "print \"cost of purchase in 4th case is\",cp4,\"Rs\"\n",
+ "print \"cost of purchase in 5th case is\",cp5,\"Rs\"\n",
+ "print \"cost of purchase in 6th case is\",cp6,\"Rs\"\n",
+ "print \"cost of purchase in 7th case is\",cp7,\"Rs\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example number 18.2, Page number 18.7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "sale realisation is 2110.0 Rs\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "a=2000; #amount(Rs)\n",
+ "mv=100+6; #market value\n",
+ "b=1/2; #brokerage(%)\n",
+ "\n",
+ "#Calculation\n",
+ "sr=a*(mv-b)/100; #sale realisation(Rs) \n",
+ "\n",
+ "#Result\n",
+ "print \"sale realisation is\",sr,\"Rs\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example number 18.3, Page number 18.7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "amount of stock is 1200.0 Rs\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "mv=100+(9/4); #market value\n",
+ "b=1/2; #brokerage(%)\n",
+ "sr=1221; #sale realisation(Rs) \n",
+ " \n",
+ "#Calculation\n",
+ "a=sr*100/(mv-b); #amount of stock(Rs) \n",
+ "\n",
+ "#Result\n",
+ "print \"amount of stock is\",a,\"Rs\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example number 18.4, Page number 18.7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "amount of stock is 2000.0 Rs\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "b=1/2; #brokerage(%)\n",
+ "d=8; #discount(%)\n",
+ "pc=1850; #purchase cost(Rs)\n",
+ "\n",
+ "#Calculation\n",
+ "a=pc*100/(100-d+b); #amount of stock(Rs) \n",
+ "\n",
+ "#Result\n",
+ "print \"amount of stock is\",a,\"Rs\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example number 18.5, Page number 18.7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "annual income is 112.0 Rs\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "a=2800; #amount of stock(Rs) \n",
+ "r=4/100; #rate of stock(%)\n",
+ "\n",
+ "#Calculation\n",
+ "I=a*r #annual income(Rs)\n",
+ "\n",
+ "#Result\n",
+ "print \"annual income is\",I,\"Rs\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example number 18.6, Page number 18.8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "annual income is 100.0 Rs\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "i=2800; #investment(Rs)\n",
+ "r=4; #rate of stock(%)\n",
+ "mvb=112; \n",
+ "\n",
+ "#Calculation\n",
+ "I=i*r/mvb; #annual income(Rs)\n",
+ "\n",
+ "#Result\n",
+ "print \"annual income is\",I,\"Rs\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example number 18.7, Page number 18.8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "rate percent obtained is 7.35 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "i=100; #investment(Rs)\n",
+ "r=7; #rate of stock(%)\n",
+ "b=1/(4*100); #brokerage(%)\n",
+ "mv=1-(5/100); #market value\n",
+ "\n",
+ "#Calculation\n",
+ "R=i*r/(mv+b); #rate percent obtained(%)\n",
+ "\n",
+ "#Result\n",
+ "print \"rate percent obtained is\",round(R/100,2),\"%\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example number 18.8, Page number 18.8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "market value is 29.75\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "i=1220; #investment(Rs)\n",
+ "r=6; #rate of stock(%)\n",
+ "b=1/4; #brokerage(%)\n",
+ "I=244; #annual income(Rs)\n",
+ "\n",
+ "#Calculation\n",
+ "mv=(i*r/I)-b; #market value\n",
+ "\n",
+ "#Result\n",
+ "print \"market value is\",mv"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example number 18.9, Page number 18.8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "investment is 4950.0 Rs\n",
+ "answer given in the book is wrong\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "r=20/3; #rate of stock(%)\n",
+ "mvb=110;\n",
+ "b=1/4; #brokerage(%)\n",
+ "i=300; #annual income(Rs)\n",
+ "\n",
+ "#Calculation\n",
+ "I=i*mvb/r; #investment(Rs)\n",
+ "\n",
+ "#Result\n",
+ "print \"investment is\",I,\"Rs\"\n",
+ "print \"answer given in the book is wrong\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example number 18.10, Page number 18.8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "gain by share holder is 13500 Rs\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "fv=20; #face value(Rs)\n",
+ "mv=74; #market value(Rs)\n",
+ "n=250; #number of shares\n",
+ "\n",
+ "#Calculation\n",
+ "a=mv*n; #amount paid by buyer(Rs)\n",
+ "cp=fv*n; #purchase cose(Rs)\n",
+ "g=a-cp; #gain by share holder(Rs)\n",
+ "\n",
+ "#Result\n",
+ "print \"gain by share holder is\",g,\"Rs\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example number 18.11, Page number 18.9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "sale realisation is 4180.0 Rs\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "pc=4220; #purchase cost(Rs)\n",
+ "mv=105; #market value\n",
+ "b=1/2; #brokerage(%)\n",
+ "\n",
+ "#Calculation\n",
+ "sr=pc*(mv-b)/(mv+b); #sale realisation(Rs) \n",
+ "\n",
+ "#Result\n",
+ "print \"sale realisation is\",sr,\"Rs\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example number 18.12, Page number 18.9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "cost of 80 shares is 780.0 Rs\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "fv=10; #face value(Rs)\n",
+ "d=3/8; #discount\n",
+ "b=1/8; #brokerage(%)\n",
+ "n=80; #number of shares\n",
+ "\n",
+ "#Calculation\n",
+ "c1=fv-d+b; #cost of 1 share(Rs)\n",
+ "C=n*c1; #cost of 80 shares(Rs)\n",
+ "\n",
+ "#Result\n",
+ "print \"cost of 80 shares is\",C,\"Rs\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example number 18.13, Page number 18.9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "amount invested in 3% stock is 540.0 Rs\n",
+ "amount invested in 8% stock is 4860.0 Rs\n",
+ "answer given in the book is wrong\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "from fractions import gcd\n",
+ "\n",
+ "#Variable declaration\n",
+ "mvb=120;\n",
+ "a=4500; #amount(Rs)\n",
+ "r=5; #rate of stock(%)\n",
+ "i=75; #income(Rs)\n",
+ "x1=99;\n",
+ "x2=132; \n",
+ "r1=3; #rate(%) \n",
+ "r2=8; #rate(%)\n",
+ "\n",
+ "#Calculation\n",
+ "sr=mvb*a/100; #sale realisation(Rs) \n",
+ "Is=a*r/100; #income before selling(Rs)\n",
+ "Ias=Is+i; #income after sale(Rs)\n",
+ "\n",
+ "\n",
+ "l=x1*x2/gcd(x1,x2); #lcm of x1 and x2\n",
+ "X=l*Ias;\n",
+ "f1=l/x1;\n",
+ "f2=l/x2;\n",
+ "c1=r2*f1; #c1=r2*f1\n",
+ "c2=r1*f1;\n",
+ "c=l*r2*sr/x2;\n",
+ "x=(c-X)/(c1-c2); #amount invested in 3% stock(Rs)\n",
+ "y=sr-x; #amount invested in 8% stock(Rs)\n",
+ "\n",
+ "#Result\n",
+ "print \"amount invested in 3% stock is\",x,\"Rs\"\n",
+ "print \"amount invested in 8% stock is\",y,\"Rs\"\n",
+ "print \"answer given in the book is wrong\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example number 18.14, Page number 18.10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "income derived is 300.0 Rs\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "from fractions import gcd\n",
+ "\n",
+ "#Variable declaration\n",
+ "i=2592; #investment(Rs)\n",
+ "mvb=108;\n",
+ "fv=100; #face value(Rs)\n",
+ "d=25/2; #dividend(%)\n",
+ "\n",
+ "#Calculation\n",
+ "I=i*d*fv/(mvb*100); #income derived(Rs)\n",
+ "\n",
+ "#Result\n",
+ "print \"income derived is\",I,\"Rs\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example number 18.15, Page number 18.10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "rate of interest on investment is 3.37 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "from fractions import gcd\n",
+ "\n",
+ "#Variable declaration\n",
+ "r=17/4; #rate(%)\n",
+ "fv=20; #face value(Rs)\n",
+ "n=88; #number of shares\n",
+ "p=5; #premium\n",
+ "b=1/4; #brokerage(%)\n",
+ "\n",
+ "#Calculation\n",
+ "d=r*fv*n/100; #dividend(Rs)\n",
+ "pc=fv+p+b; #purchase cost(Rs)\n",
+ "R=r*fv/pc; #rate of interest on investment(%)\n",
+ "\n",
+ "#Result\n",
+ "print \"rate of interest on investment is\",round(R,2),\"%\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example number 18.16, Page number 18.10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "market value of each share is 110.0 Rs\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "from fractions import gcd\n",
+ "\n",
+ "#Variable declaration\n",
+ "i=4444; #investment(Rs)\n",
+ "I=600; #annual income(Rs)\n",
+ "fv=100; #face value(Rs)\n",
+ "d=15; #dividend(%)\n",
+ "b=1/100; #brokerage(%)\n",
+ "\n",
+ "#Calculation\n",
+ "M=i*d*fv/(I*100*(1+b)); #market value of each share(Rs)\n",
+ "\n",
+ "#Result\n",
+ "print \"market value of each share is\",M,\"Rs\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example number 18.17, Page number 18.11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "investment is 10504.0 Rs\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "from fractions import gcd\n",
+ "\n",
+ "#Variable declaration\n",
+ "I=1500; #annual income(Rs)\n",
+ "fv=100; #face value(Rs)\n",
+ "d=15; #dividend(%)\n",
+ "b=1/100; #brokerage(%)\n",
+ "M=104; #market value(Rs)\n",
+ "\n",
+ "#Calculation\n",
+ "i=I*100*M*(1+b)/(d*fv); #investment(Rs)\n",
+ "\n",
+ "#Result\n",
+ "print \"investment is\",i,\"Rs\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example number 18.18, Page number 18.11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "investment is better\n",
+ "investment in 1st case is 1440 Rs\n",
+ "investment in 2nd case is 1512 Rs\n",
+ "answer given in the book for 2nd case is wrong\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "from fractions import gcd\n",
+ "\n",
+ "#Variable declaration\n",
+ "d1=15; #debenture(%)\n",
+ "d2=14; #debenture(%)\n",
+ "p=8; #premium(%)\n",
+ "d=4; #discount(%)\n",
+ "\n",
+ "#Calculation\n",
+ "M1=100-d; #market value(Rs)\n",
+ "M2=100+p; #market value(Rs)\n",
+ "x=d1*M1; #investment(Rs)\n",
+ "y=d2*M2; #investment(Rs)\n",
+ "if(x<y):\n",
+ " print \"investment is better\"\n",
+ "else:\n",
+ " print \"investment is not better\"\n",
+ " \n",
+ "#Result\n",
+ "print \"investment in 1st case is\",x,\"Rs\"\n",
+ "print \"investment in 2nd case is\",y,\"Rs\"\n",
+ "print \"answer given in the book for 2nd case is wrong\""
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.9"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}