All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info
Home > Algorithms
An algorithm is a sequence of steps to be followed to accomplish a certain task. Often used in computer programming, they can become interesting puzzles because even though there can be many ways to accomplish something, one may be better than another.
Difficulty: 3 of 5 Latest: Savings Bonds
Years ago, U.S. Savings Bonds were sold via payroll deductions. Say a bond worth $25 at maturity was sold for $18.75. You could have a certain amount deducted each pay period and when you built up enough in your bond account to pay the purchase price, you'd get a savings bond, and you might still have an amount left over in you account to go toward you next bond.

Say you had started with 3.75 taken out each pay period. After five such deductions you'd have exactly enough to buy an 18.75 bond. But suppose at some time when you happened to have 7.50 built up in your account you decided you wanted to get bonds more frequently and shifted to having 6.25 taken out each pay period so you'd get a bond every three pay periods. Next pay period you'd have 13.75 in your account, then next time you'd have $20, which is enough to get a bond and have 1.25 left over in your account, followed by a balance of 7.50 the next time, and this cycle would repeat forever, with your balance never going below 1.25. That 1.25 that hangs around in your balance is not helping you get your bond any sooner.

Devise an algorithm or formula so you can determine if such "dead money" is in a person's account, and how large that perpetually low balance is, based on a bond purchase price, the current balance, and the amount deducted each period, so that that lowest balance in the cycle can be refunded to the employee and the cycle will include a zero balance at some point.

Make sure your method allows for the fact that it may take a while before the balance goes to zero. The number given above were chosen to be simple, but allow for deduction amounts that may bear no simple relation to the purchase price.

(Solution Posted, 1 Comments) Submitted on 2025-04-01 by Charlie   
Page 6 of 8   << prev next >>    
Difficulty: 3 of 5Hat Exchange | Rating: 3.00
Posted on 2005-02-24 by Avin (Solution Posted, 9 Comments)
Difficulty: 3 of 5Random Check | Rating: 3.00
Posted on 2005-02-11 by Charlie (Solution Posted, 11 Comments)
Difficulty: 4 of 5Whadduzitdo? | Rating: 3.71
Posted on 2005-01-14 by e.g. (Solution Posted, 10 Comments)
Difficulty: 2 of 5Sequence of Musical Tones | Rating: 3.83
Posted on 2004-12-14 by Erik O. (Solution Posted, 20 Comments)
Difficulty: 3 of 5The Card Sorting Machine | Rating: 3.00
Posted on 2004-11-12 by Brian Smith (Solution Posted, 5 Comments)
Difficulty: 3 of 5Select an Item | Rating: 3.25
Posted on 2004-10-22 by Brian Smith (Solution Posted, 13 Comments)
Difficulty: 3 of 5Firing Line | Rating: 3.75
Posted on 2004-08-25 by Larry (Solution Posted, 16 Comments)
Difficulty: 4 of 5Just by hand, only by hand, nothing but by hand? | Rating: 4.17
Posted on 2004-07-26 by Federico Kereki (Solution Posted, 7 Comments)
Difficulty: 3 of 5Four Corners | Rating: 4.25
Posted on 2004-07-17 by red_sox_fan_032003 (No Solution Yet, 7 Comments)
Difficulty: 3 of 5Root Route | Rating: 2.20
Posted on 2004-06-29 by Gamer (No Solution Yet, 7 Comments)
Difficulty: 2 of 5Maze Master | Rating: 4.33
Posted on 2004-06-21 by Gamer (No Solution Yet, 12 Comments)
Difficulty: 3 of 5Random Number Generator | Rating: 2.00
Posted on 2004-06-08 by Brian Smith (Solution Posted, 27 Comments)
Difficulty: 4 of 5Answer Machine Hacking | Rating: 4.43
Posted on 2004-05-24 by SilverKnight (No Solution Yet, 12 Comments)
Difficulty: 3 of 5Finding the maximum | Rating: 4.00
Posted on 2004-04-21 by e.g. (Solution Posted, 16 Comments)
Difficulty: 2 of 5Rotating an array | Rating: 4.00
Posted on 2004-04-19 by e.g. (Solution Posted, 26 Comments)
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (2)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (4)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2025 by Animus Pactum Consulting. All rights reserved. Privacy Information