# add helping materials pv_perpetuity<-function(c,r){ "Objective: estimate the present value of perpetuity c Formula: pv(perpeturity) = ------ r c : cash flow with the 1st one at the end of 1st period r : effective period rate Example #1: pv_perpetuity(10,0.08) [1] 125 Example #2: pv_perpetuity(r=0.10,c=100) [1] 1000 " return(c/r) } # The second program below has the same codes. pv_perpetuity_due<-function(c,r){ " Objective: estimate the present value of a perpetuity c Formula: pv(perpeturity) = ------ r c: cash flow (1st at the end of 1st period r: effective period discount rate e.g., pv_perpetuity(10,0.08) [1] 125 " return(c/r*1(1+r)) }