algorithm to divide by 6

B

Bucky

I'm trying to reverse engineer an algorithm to divide up interest
payments over 6 months. I've got two examples below. (They're
originally in cents, but I've converted to integers so it's easier to
read.) I couldn't figure out an algorithm that would work for both.

46 = 8 + 7 + 8 + 7 + 8 + 8
58 = 10 + 9 + 10 + 10 + 9 + 10

(In case you were wondering, these are I-Bonds payments).
 
A

Anthony Buckland

Bucky said:
I'm trying to reverse engineer an algorithm to divide up interest
payments over 6 months. I've got two examples below. (They're
originally in cents, but I've converted to integers so it's easier to
read.) I couldn't figure out an algorithm that would work for both.

46 = 8 + 7 + 8 + 7 + 8 + 8
58 = 10 + 9 + 10 + 10 + 9 + 10

(In case you were wondering, these are I-Bonds payments).
I'll take a hack at it, inspired by the fact that there are 31 days in
each of
July and August. The algorithm is to divide the interest equally as far as
possible, and distribute the rest over the longer months. The first line
would relate to March through August, and the second to May through
October. Now tell me those aren't the relevant periods, in which case
I'm wrong.
 
B

Bucky

Anthony said:
I'll take a hack at it, inspired by the fact that there are 31 days in
each of
July and August. The algorithm is to divide the interest equally as far as
possible, and distribute the rest over the longer months. The first line
would relate to March through August, and the second to May through
October. Now tell me those aren't the relevant periods, in which case
I'm wrong.

The second line does correspond with May to Oct, but the first line is
for Nov to Apr. I think I'm going to give up on this, because I also
found another example that contradicts #2. I must be missing a
dimension here. The month was a good idea, but it doesn't seem to
match.

example 3 (Nov to Apr): 58 = 10 + 9 + 10 + 10 + 10 + 9
 
K

Keith A. Lewis

Bucky said:
I'm trying to reverse engineer an algorithm to divide up interest
payments over 6 months. I've got two examples below. (They're
originally in cents, but I've converted to integers so it's easier to
read.) I couldn't figure out an algorithm that would work for both.

46 = 8 + 7 + 8 + 7 + 8 + 8
58 = 10 + 9 + 10 + 10 + 9 + 10

(In case you were wondering, these are I-Bonds payments).

Financial institutions normally keep account balances accurate to at least
hundredths of cents, although what they show on your statement is rounded to
the cent.

--Keith Lewis klewis {at} mitre.org
The above may not (yet) represent the opinions of my employer.
 
Top