[ww-bugs] Bug 3611: New: Are the number of periods off by a factor of 2
bugzilla-daemon at webwork.maa.org
bugzilla-daemon at webwork.maa.org
Wed Feb 24 14:21:29 EST 2016
http://bugs.webwork.maa.org/show_bug.cgi?id=3611
Summary: Are the number of periods off by a factor of 2
Product: Problem Libraries
Version: unspecified
Platform: PC
URL: /opt/webwork/courses/452_Spring_2016/templates/Library
/NAU/setExponentialModeling/bonds2.pg_with_problemSeed
=2843
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P5
Component: Library (OPL)
AssignedTo: jj at asu.edu
ReportedBy: travis at mc.edu
Web browser ---
version:
Since this bond has coupons paid semiannually then it seems to me that there
are twice as many periods to consider when determining the value of the coupon
portion when setting selling price (ie. annuity formula). Further, when
determining the present value of the bond Maturity Value, you can either
presume half the nominal rate for twice the periods or the annual rate for the
given number of periods but not both. Perhaps I am reading this wrong or just
don't understand bond pricing. However, my suggestion:
# If determining value using compounding twice a year (suggested)
$n2 = 2*$n;
$fact1 = ( 1 - (1 + $r2/200 ) ** -$n2 ) / ( $r2/200 );
$P1 = ( $F * ( 1 + $r2/200 ) ** -$n2 ) + ($F * ( $r1/200 ) * $fact1 );
$fact2 = ( 1 - (1 + $r3/200 ) ** -$n2 ) / ( $r3/200 );
$P2 = ( $F * ( 1 + $r3/200 ) ** -$n2 ) + ($F * ( $r1/200 ) * $fact2 );
$fact3 = ( 1 - (1 + $r4/200 ) ** -$n2 ) / ( $r4/200 );
$P3 = ( $F * ( 1 + $r4/200 ) ** -$n2 ) + ($F * ( $r1/200 ) * $fact3 );
# If determining value using compounding once a year (and ignoring time effect
for the six-month coupon..not suggested)
$fact1 = ( 1 - (1 + $r2/100 ) ** -$n ) / ( $r2/200 );
$P1 = ( $F * ( 1 + $r2/100 ) ** -$n ) + ($F * ( $r1/100 ) * $fact1 );
$fact2 = ( 1 - (1 + $r3/100 ) ** -$n ) / ( $r3/200 );
$P2 = ( $F * ( 1 + $r3/100 ) ** -$n ) + ($F * ( $r1/100 ) * $fact2 );
$fact3 = ( 1 - (1 + $r4/100 ) ** -$n ) / ( $r4/100 );
$P3 = ( $F * ( 1 + $r4/100 ) ** -$n ) + ($F * ( $r1/100 ) * $fact3 );
--
Configure bugmail: http://bugs.webwork.maa.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
More information about the webwork-bugs
mailing list