Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typo in example graphic in README and in paper. #9

Open
vinceolsen opened this issue Jun 7, 2024 · 0 comments
Open

Typo in example graphic in README and in paper. #9

vinceolsen opened this issue Jun 7, 2024 · 0 comments

Comments

@vinceolsen
Copy link

vinceolsen commented Jun 7, 2024

Hello,

I was studying your paper and I noticed that there are some typos in the simple interest vs compound interest example in the graphic on the readme and in figure 1 in your paper on arxiv: https://arxiv.org/pdf/2211.12588. The answer that you are claiming is correct is actually incorrect. I performed the calculation using three different solving techniques and each time came up with a rate of about 12.646198272705078%.

Here is a sample program (actually produced by github copilot using your exact prompt) that finds the correct answer:

def find_interest_rate(P, T, N, diff):
    def f(R):
        return P * (1 + R/N)**(N*T) - P - P*R*T - diff

    a, b = 0, 1
    while abs(b - a) >= 1e-6:
        c = (a + b) / 2
        if f(c) == 0:
            break
        elif f(a) * f(c) < 0:
            b = c
        else:
            a = c
    return c

P = 20000  # principal amount
T = 3  # time in years
N = 1  # number of times interest is compounded per year
diff = 1000  # difference between compound interest and simple interest

R = find_interest_rate(P, T, N, diff)
print(f"The interest rate is {R * 100}%")

There are also some typos in the paper related to this example in the paragraph right after the heading 2.2 Program of Thoughts. In some places the paper refers to a 2 year period and in others it refers to a 3 year period. (By the way I did check the calculation using a 2 year period and that also does not match the number that is in the graphic.)

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant