Finance
- Home
- All courses
- Finance
- Basic Finance
Perpetuities
A function that can give a good idea of how the value accumulates over time is accumulate from the itertools library. This function takes a list and gets a rolling sum. Let’s see what happens when we use it.
from itertools import accumulate
#We will get back an object that is not helpful at first look.
total_PV = accumulate(PV)
print(total_PV)
<itertools.accumulate object at 0x10d8760c0>
You can convert this to a list and then it will be more helpful.
#Convert it to a list to use it
total_PV = list(total_PV)
print(total_PV)
[98.0392156862745, 194.15609381007306, 288.3883272647775, 380.77286986742894, 471.34595085042054, 560.1430890690398, 647.1991069304312, 732.5481440494423, 816.2236706367081, 898.2585006242236, 978.6848045335526, 1057.5341220917182, 1134.8373745997237, 1210.6248770585526, 1284.9263500574045, 1357.770931428828, 1429.1871876753214, 1499.2031251718838, 1567.8462011489057, 1635.1433344597115, 1701.120916136972, 1765.8048197421294, 1829.2204115118916, 1891.392560305776, 1952.3456473586039, 2012.1035758417684, 2070.6897802370277, 2128.1272355264978, 2184.4384662024486, 2239.6455551004397, 2293.7701520592545, 2346.833482411034, 2398.8563553049353, 2449.8591718675834, 2499.861933203513, 2548.8842482387386, 2596.945341410528, 2644.0640602064, 2690.258882555294, 2735.5479240738173, 2779.948945170409, 2823.4793580102046, 2866.1562333433376, 2907.9963071993507, 2949.015987450344, 2989.231360245435, 3028.658196319054, 3067.311957175543, 3105.2078011524927, 3142.360589365189, 3178.784891534499, 3214.494991700489, 3249.504893824009, 3283.82832727844, 3317.4787522337647, 3350.4693649350634, 3382.813102877513, 3414.5226498799143, 3445.6104410587395, 3476.0886677046465, 3505.9692820633786, 3535.26400202292, 3563.9843157087453, 3592.141485988966, 3619.746554891143, 3646.810347932493, 3673.343478365189, 3699.3563513384206, 3724.8591679788437, 3749.8619293910233, 3774.3744405794346, 3798.4063142935634, 3821.966974797611, 3845.065661566285, 3867.711432908123, 3889.9131695177675, 3911.6795779585955, 3933.019194077054, 3953.940386350053, 3974.4513591667182, 3994.560156045802, 4014.274662790002, 4033.602610578433, 4052.551578998464, 4071.1289990181017, 4089.3421559000994, 4107.1981920589205, 4124.704109861686, 4141.866774374203, 4158.69291605314, 4175.189133385431, 4191.361895475912, 4207.217544584228, 4222.762298611988, 4238.0022535411645, 4252.943385824671, 4267.591554730069, 4281.952504637323, 4296.031867291493, 4309.835164011267, 4323.367807854183, 4336.635105739396, 4349.642260528819, 4362.394373067469, 4374.896444183793, 4387.153376650777, 4399.169977108605, 4410.9509579496125, 4422.500939166287, 4433.824450163026, 4444.925931532378, 4455.809736796449, 4466.480134114166, 4476.941307955064, 4487.197360740259, 4497.252314451234, 4507.110112207092, 4516.774619810874, 4526.249627265563, 4535.5388502603555, 4544.6459316278, 4553.574442772352, 4562.327885070933, 4570.909691246013, 4579.323226711777, 4587.5717908939, 4595.658618523431, 4603.5868809053245, 4611.359687162083, 4618.980085453022, 4626.45106416963, 4633.77555310748, 4640.956424615177, 4647.996494720762, 4654.89852423604, 4661.665219839255, 4668.299235136525, 4674.803171702475, 4681.1795801004655, 4687.430960882809, 4693.559765571381, 4699.568397619001, 4705.459213351962, 4711.23452289408, 4716.896591072627, 4722.4476383064975, 4727.889841476958, 4733.225334781331, 4738.456210569932, 4743.584520166601, 4748.612274673138, 4753.541445757978, 4758.37396642939, 4763.1117317935195, 4767.756599797568, 4772.3103919584, 4776.774894076862, 4781.1518569381005, 4785.4429969981375, 4789.649997056998, 4793.774506918625, 4797.818144037868, 4801.782494154772, 4805.669111916443, 4809.479521486709, 4813.215217143832, 4816.877663866502, 4820.468297908335, 4823.9885273611135, 4827.439732706974, 4830.823267359778, 4834.14045819586, 4837.392606074372, 4840.580986347424, 4843.70684936022, 4846.7714209413925, 4849.775902883718, 4852.7214734154095, 4855.609287662166, 4858.440478100163, 4861.21615500016, 4863.937406862902, 4866.605300845982, 4869.2208831823355, 4871.785179590524, 4874.299195676985, 4876.763917330377, 4879.180311108213, 4881.549324615895, 4883.871886878328, 4886.148908704243, 4888.381283043375, 4890.569885336642, 4892.715573859453, 4894.819190058287, 4896.881558880674, 4898.9034890986995, 4900.885773626176, 4902.829189829585, 4904.734499832926, 4906.602450816595, 4908.433775310387, 4910.229191480772, 4911.989403412522, 4913.715101384825, 4915.406962141986, 4917.06564915881, 4918.691812900794, 4920.28609107921, 4921.849108901186, 4923.381479314888, 4924.88380324989, 4926.356669852833, 4927.800656718464, 4929.216330116141, 4930.604245211903, 4931.964946286179, 4933.2989669472345, 4934.606830340426, 4935.889049353359, 4937.146126817019, 4938.37855570296, 4939.586819316627, 4940.771391486889, 4941.932736751852, 4943.071310541031, 4944.187559353953, 4945.281920935247, 4946.354824446321, 4947.4066906336475, 4948.437931993772, 4949.44895293507, 4950.440149936343, 4951.411911702297, 4952.3646193159775, 4953.2986463882135, 4954.214359204131, 4955.112116866795, 4955.992271438035, 4956.855168076504, 4957.701145173043, 4958.530534483376, 4959.343661258212, 4960.140844370796, 4960.922396441957, 4961.688623962703, 4962.439827414414, 4963.17630138668, 4963.8983346928235, 4964.60621048316, 4965.300206356039, 4965.980594466705, 4966.647641634025, 4967.301609445122, 4967.942754357963, 4968.571327801925, 4969.187576276397, 4969.791741447448, 4970.384060242596, 4970.964764943722, 4971.5340832781585, 4972.092238507998, 4972.6394495176455, 4973.1759308996525, 4973.701893038875, 4974.217542194975, 4974.723080583309, 4975.218706454224, 4975.704614170808, 4976.180994285106, 4976.648033612849, 4977.105915306714, 4977.554818928152, 4977.994920517795, 4978.426392664505, 4978.849404573044, 4979.264122130436, 4979.670707971015, 4980.069321540211, 4980.460119157069, 4980.8432540755575, 4981.218876544664, 4981.587133867318, 4981.948170458155, 4982.302127900151, 4982.649145000149, 4982.989357843283, 4983.3228998463555, 4983.649901810152, 4983.970491970737, 4984.284796049743, 4984.59293730367, 4984.895036572225, 4985.191212325711, 4985.481580711481, 4985.766255599491, 4986.045348626952, 4986.318969242109, 4986.587224747166, 4986.850220340359, 4987.1080591572145, 4987.3608423109945, 4987.608668932347, 4987.851636208184, 4988.0898394197875, 4988.323371980184, 4988.552325470769, 4988.776789677224, 4988.996852624729, 4989.21260061248, 4989.424118247529, 4989.6314884779695, 4989.83479262546, 4990.0341104171175, 4990.229520016782, 4990.421098055668, 4990.60891966242, 4990.793058492568, 4990.973586757419, 4991.150575252372, 4991.324093384678, 4991.494209200665, 4991.660989412417, 4991.824499423938, 4991.984803356801, 4992.141964075296, 4992.296043211074, 4992.4471011873275, 4992.595197242478, 4992.74038945341, 4992.882734758245, 4993.022288978671, 4993.159106841834, 4993.293242001798, 4993.424747060586, 4993.55367358881, 4993.680072145892, 4993.803992299894, 4993.925482646955, 4994.044590830348, 4994.161363559165, 4994.275846626632, 4994.38808492807, 4994.498122478501, 4994.606002429902, 4994.711767088139, 4994.815457929548, 4994.917115617203, 4995.016780016866, 4995.114490212613, 4995.21028452217, 4995.304200511931, 4995.396275011697, 4995.486544129115, 4995.575043263838, 4995.66180712141, 4995.746869726872, 4995.83026443811, 4995.912023958931, 4995.992180351893, 4996.070765050875, 4996.147808873407, 4996.223342032751, 4996.297394149756, 4996.369994264466, 4996.441170847515, 4996.5109518112895, 4996.579364520872, 4996.646435804777, 4996.712191965467, 4996.776658789674, 4996.839861558504, 4996.901825057356, 4996.962573585643, 4997.022130966317, 4997.080520555212, 4997.137765250208, 4997.193887500203, 4997.248909313925, 4997.302852268554, 4997.35573751819, 4997.407585802147, 4997.4584174530855, 4997.508252404986, 4997.557110200966, 4997.605010000947, 4997.651970589163, 4997.698010381532, 4997.743147432874, 4997.787399443994, 4997.830783768622, 4997.873317420217, 4997.915017078644, 4997.95589909671, 4997.995979506578, 4998.035274026057, 4998.073798064762, 4998.111566730158, 4998.1485948334885, 4998.1848968955765, 4998.2204871525255, 4998.255379561299, 4998.289587805195, 4998.323125299211, 4998.3560051953045, 4998.388240387553, 4998.419843517209, 4998.450826977656, 4998.481202919271, 4998.510983254187, 4998.540179660967, 4998.568803589183, 4998.596866263904, 4998.624378690102, 4998.651351656963, 4998.677795742121, 4998.703721315805, 4998.729138544906, 4998.754057396966, 4998.778487644085, 4998.802438866749, 4998.825920457597, 4998.848941625095, 4998.871511397152, 4998.893638624659, 4998.915331984959, 4998.936599985254, 4998.957450965935, 4998.977893103858, 4998.997934415547, 4999.017582760341, 4999.036845843471, 4999.0557312190895, 4999.074246293225, 4999.092398326691, 4999.1101944379325, 4999.127641605816, 4999.1447466723685, 4999.161516345459, 4999.17795720143, 4999.194075687677, 4999.209878125173, 4999.225370710954, 4999.240559520543, 4999.255450510336, 4999.270049519937, 4999.284362274448, 4999.298394386713, 4999.312151359522, 4999.325638587767, 4999.338861360556, 4999.35182486329, 4999.3645341796955, 4999.376994293819, 4999.389210091979, 4999.401186364686, 4999.412927808515, 4999.4244390279555, 4999.435724537211, 4999.446788761971, 4999.457636041148, 4999.468270628577, 4999.478696694683, 4999.48891832812, 4999.498939537372, 4999.508764252326, 4999.51839632581, 4999.527839535107, 4999.5370975834385, 4999.5461741014105, 4999.555072648442, 4999.563796714158, 4999.572349719763, 4999.580735019375, 4999.5889559013485, 4999.5970155895575, 4999.604917244664, 4999.612663965357, 4999.620258789565, 4999.627704695652, 4999.6350046035805, 4999.642161376059, 4999.649177819666, 4999.656056685947, 4999.662800672497, 4999.669412424017, 4999.6758945333495, 4999.682249542499, 4999.688479943627, 4999.694588180026, 4999.700576647084, 4999.706447693219, 4999.712203620803, 4999.717846687062, 4999.723379104962, 4999.72880304408, 4999.734120631451, 4999.739333952403, 4999.744445051376, 4999.7494559327215, 4999.754368561492, 4999.759184864208, 4999.763906729615, 4999.7685360094265, 4999.773074519046, 4999.77752403828, 4999.781886312039, 4999.786163051019, 4999.790355932371, 4999.794466600364, 4999.798496667024, 4999.802447712768, 4999.8063212870275, 4999.81011890885, 4999.8138420675, 4999.817492223039, 4999.821070806901, 4999.824579222452, 4999.828018845541, 4999.83139102504, 4999.834697083373, 4999.837938317032, 4999.84111599709, 4999.844231369696, 4999.847285656565, 4999.850280055456, 4999.8532157406435, 4999.8560938633755, 4999.858915552329, 4999.861681914048, 4999.86439403338, 4999.867052973902, 4999.8696597783355, 4999.872215468957, 4999.874721047997, 4999.877177498036, 4999.879585782388, 4999.8819468454785, 4999.884261613214, 4999.886530993347, 4999.888755875831, 4999.890937133167, 4999.893075620752, 4999.895172177207, 4999.897227624713, 4999.8992427693265, 4999.901218401301, 4999.903155295393, 4999.905054211169, 4999.9069158933025, 4999.908741071865, 4999.910530462613, 4999.912284767267, 4999.914004673791, 4999.915690856658, 4999.917343977116, 4999.918964683447, 4999.920553611222, 4999.922111383551, 4999.923638611324, 4999.925135893455, 4999.926603817113, 4999.928042957954, 4999.929453880347, 4999.930837137595, 4999.932193272151, 4999.933522815834, 4999.934826290034, 4999.936104205915, 4999.937357064623, 4999.938585357473, 4999.9397895661505, 4999.940970162893, 4999.94212761068, 4999.943262363411, 4999.94437486609, 4999.94546555499, 4999.946534857833, 4999.947583193954, 4999.948610974465, 4999.949618602416, 4999.950606472957, 4999.9515749734865, 4999.9525244838105, 4999.953455376285, 4999.954368015966, 4999.955262760751, 4999.95613996152, 4999.9569999622745, 4999.957843100269, 4999.958669706146, 4999.959480104065, 4999.960274611828, 4999.9610535410075, 4999.961817197066, 4999.962565879477, 4999.96329988184, 4999.964019491999, 4999.964724992156, 4999.965416658977, 4999.966094763703, 4999.966759572258, 4999.96741134535, 4999.968050338579, 4999.9686768025285, 4999.969290982871, 4999.969893120461, 4999.970483451432, 4999.971062207286, 4999.971629614986, 4999.972185897045, 4999.972731271613, 4999.973265952562, 4999.97379014957, 4999.974304068206, 4999.974807910005, 4999.975301872554, 4999.975786149563, 4999.976260930944, 4999.976726402886, 4999.977182747927, 4999.9776301450265, 4999.978068769634, 4999.978498793758, 4999.978920386037, 4999.979333711801, 4999.979738933138, 4999.980136208958, 4999.980525695057, 4999.9809075441735, 4999.981281906053, 4999.981648927503, 4999.982008752453, 4999.982361522013, 4999.982707374523, 4999.983046445611, 4999.983378868246, 4999.983704772791, 4999.98402428705, 4999.984337536323, 4999.984644643454, 4999.9849457288765, 4999.985240910663, 4999.9855303045715, 4999.985814024089, 4999.986092180479, 4999.986364882823, 4999.986632238062, 4999.986894351041, 4999.98715132455, 4999.9874032593625, 4999.987650254277, 4999.987892406153, 4999.9881298099535, 4999.988362558778, 4999.9885907439, 4999.988814454804, 4999.989033779219, 4999.989248803156, 4999.989459610938, 4999.989666285233, 4999.9898689070915, 4999.990067555972, 4999.990262309776, 4999.990453244878, 4999.9906404361545, 4999.990823957014, 4999.991003879425, 4999.991180273946, 4999.991353209751, 4999.991522754657, 4999.991688975154, 4999.9918519364255, 4999.992011702378, 4999.992168335664, 4999.99232189771, 4999.9924724487355, 4999.992620047779, 4999.992764752725, 4999.9929066203185, 4999.993045706195, 4999.993182064896, 4999.993315749898, 4999.993446813625, 4999.993575307476, 4999.993701281839, 4999.993824786116, 4999.993945868741, 4999.994064577198, 4999.994180958037, 4999.994295056898, 4999.994406918528, 4999.994516586792, 4999.994624104698, 4999.99472951441, 4999.994832857265, 4999.994934173788, 4999.995033503714, 4999.995130885994, 4999.9952263588175, 4999.995319959625, 4999.995411725122, 4999.995501691295, 4999.995589893427, 4999.995676366105, 4999.99576114324, 4999.995844258078, 4999.995925743214, 4999.996005630602, 4999.996083951571, 4999.996160736834, 4999.996236016504, 4999.9963098201015, 4999.99638217657, 4999.996453114284, 4999.996522661063, 4999.996590844179, 4999.996657690372, 4999.996723225854, 4999.996787476328, 4999.996850466988, 4999.996912222537, 4999.996972767192, 4999.997032124698, 4999.997090318331, 4999.997147370913, 4999.997203304816, 4999.997258141976, 4999.997311903898, 4999.997364611664, 4999.997416285945, 4999.997466947005, 4999.997516614711, 4999.997565308539, 4999.997613047587, 4999.9976598505755, 4999.997705735858, 4999.99775072143, 4999.997794824931, 4999.997838063658, 4999.997880454566, 4999.99792201428, 4999.997962759098, 4999.998002704998, 4999.998041867645, 4999.998080262397, 4999.998117904311, 4999.998154808148, 4999.99819098838, 4999.998226459196, 4999.998261234506, 4999.998295327947, 4999.9983287528885, 4999.998361522439, 4999.99839364945, 4999.998425146519, 4999.998456025999, 4999.998486299999, 4999.998515980391, 4999.9985450788145, 4999.998573606681, 4999.998601575177, 4999.998628995272, 4999.998655877717, 4999.998682233056, 4999.998708071623, 4999.998733403551, 4999.998758238776, 4999.998782587035, 4999.998806457877, 4999.998829860664, 4999.998852804572, 4999.9988752986, 4999.998897351568, 4999.9989189721255, 4999.99894016875, 4999.998960949754, 4999.998981323289, 4999.999001297342, 4999.999020879747, 4999.9990400781835, 4999.99905890018, 4999.999077353117, 4999.999095444233, 4999.99911318062, 4999.999130569236, 4999.999147616897, 4999.999164330291, 4999.999180715971, 4999.9991967803635, 4999.999212529768, 4999.99922797036, 4999.999243108196, 4999.999257949212, 4999.999272499227, 4999.999286763948, 4999.999300748968, 4999.999314459773, 4999.999327901738, 4999.999341080135, 4999.999354000132, 4999.999366666796, 4999.999379085094, 4999.999391259896, 4999.999403195976, 4999.999414898016, 4999.999426370604, 4999.999437618239, 4999.999448645332, 4999.999459456209, 4999.999470055106, 4999.999480446182, 4999.999490633511, 4999.999500621089, 4999.999510412832, 4999.99952001258, 4999.999529424098, 4999.999538651076, 4999.9995476971335, 4999.999556565817, 4999.999565260605, 4999.999573784907, 4999.999582142065, 4999.999590335358, 4999.999598367998, 4999.9996062431355, 4999.999613963858, 4999.999621533194, 4999.999628954111, 4999.999636229521, 4999.999643362275, 4999.999650355171, 4999.999657210952, 4999.999663932306, 4999.999670521869, 4999.999676982225, 4999.999683315907, 4999.999689525399, 4999.999695613136, 4999.999701581506, 4999.999707432849, 4999.99971316946, 4999.999718793588, 4999.999724307439, 4999.999729713175, 4999.999735012916, 4999.999740208741, 4999.999745302687, 4999.999750296752, 4999.999755192894, 4999.999759993033, 4999.999764699051, 4999.999769312795, 4999.9997738360735, 4999.9997782706605, 4999.999782618294, 4999.99978688068, 4999.99979105949, 4999.999795156363, 4999.999799172904, 4999.999803110691, 4999.999806971266, 4999.999810756142, 4999.999814466806, 4999.999818104712, 4999.999821671287, 4999.999825167928, 4999.999828596007, 4999.9998319568695, 4999.999835251832, 4999.999838482188, 4999.999841649204, 4999.999844754122, 4999.999847798159, 4999.9998507825085, 4999.999853708341, 4999.999856576805, 4999.999859389024, 4999.999862146102, 4999.999864849119, 4999.999867499137, 4999.999870097193, 4999.999872644306, 4999.999875141477, 4999.999877589683, 4999.999879989885, 4999.999882343024, 4999.999884650024, 4999.999886911788, 4999.999889129203, 4999.99989130314, 4999.999893434451, 4999.999895523972, 4999.999897572521, 4999.999899580903, 4999.999901549904, 4999.999903480299, 4999.999905372842, 4999.999907228276, 4999.999909047329, 4999.999910830715, 4999.999912579132, 4999.999914293267, 4999.999915973791, 4999.999917621363, 4999.99991923663, 4999.999920820225, 4999.99992237277, 4999.999923894872, 4999.999925387129, 4999.999926850127, 4999.999928284438, 4999.999929690625, 4999.99993106924, 4999.999932420824, 4999.999933745906, 4999.999935045005, 4999.9999363186325, 4999.999937567287, 4999.999938791458, 4999.999939991625, 4999.999941168259, 4999.999942321822, 4999.999943452767, 4999.999944561537, 4999.999945648566, 4999.99994671428, 4999.999947759097, 4999.999948783428, 4999.999949787675, 4999.9999507722305, 4999.999951737481, 4999.999952683805, 4999.999953611573, 4999.999954521149, 4999.999955412892, 4999.999956287149, 4999.999957144263, 4999.999957984572, 4999.999958808404, 4999.999959616082, 4999.999960407924, 4999.999961184239, 4999.999961945332, 4999.999962691501, 4999.999963423041, 4999.9999641402355, 4999.999964843368, 4999.999965532713, 4999.999966208542, 4999.99996687112, 4999.9999675207055, 4999.999968157555, 4999.999968781916, 4999.999969394035, 4999.999969994152, 4999.999970582501, 4999.999971159315, 4999.999971724818, 4999.999972279234, 4999.999972822778, 4999.999973355664, 4999.999973878102, 4999.999974390295, 4999.9999748924465, 4999.999975384751, 4999.999975867403, 4999.999976340591, 4999.999976804501, 4999.999977259315, 4999.99997770521, 4999.999978142362, 4999.999978570943, 4999.999978991121, 4999.999979403059, 4999.99997980692, 4999.999980202862, 4999.999980591041, 4999.999980971609, 4999.999981344715, 4999.9999817105045, 4999.999982069122, 4999.999982420708, 4999.9999827654, 4999.999983103333, 4999.99998343464, 4999.9999837594505, 4999.999984077893, 4999.9999843900905, 4999.999984696167, 4999.999984996242, 4999.999985290434, 4999.9999855788565, 4999.999985861624, 4999.999986138847, 4999.999986410634, 4999.999986677092, 4999.9999869383255, 4999.9999871944365, 4999.999987445526]
#Now we can also graph this
plt.plot(t,total_PV)
plt.xlabel("t")
plt.ylabel("Cummulative Present Value")
plt.title("Cummulative PV of $100 Perpetuity with r=2%")
plt.show()
As you can see, as we get to a larger and larger number of years the values approach $5000. There is an actual equation which we can use to find this value that a perpetuity should approach. This equation is:
$$ PV = \frac{P}{r} $$
where
$$ PV = \text{Perpetuity Present Value} $$$$ P = \text{Annual Payment} $$$$ r = \text{Discount Rate} $$
print(100/.02)
5000.0
If we instead have a perpetuity due, meaning we also get a payment right away, we can convert it to be:
$$ PV = \frac{P}{r} + P $$
where
$$ PV = \text{Perpetuity Present Value} $$$$ P = \text{Annual Payment} $$$$ r = \text{Discount Rate} $$
#Present value for a perpetuity due
print(100+100/.02)
5100.0