# Learning Finance - Take it easy

## Learning finance in interactive and smart way

Published Mar 11, 2024

The main goal of this project is to create a pair of FINANCE BUDDY and FINANCE TEACHER for anyone to learn about finance with hands on problems about

- company valuation.
- lottery valuation
- Retirement Investing
- investment in art or painting or even in education
- partial amortization with balloon
- a contract to purchase valuable thing
- individual economic plan
- business plan
- Loan Amortization or student debt to learn MBA/become a doctor
- etc.

To this end, I summarized the finance problem into 9 different sub problems including:

- Delayed Annuity
- Annuity Due
- The Infrequent Annuity
- Simple Interest versus Compound Interest
- Future Value (FV) and Present Value (PV) Calculations
- Interest Rate Calculation
- Number of Periods Calculation - to esitmate the period to pay the loan
- Annuities Calculation
- Growing Annuities Calculation

However, my prompt is too long and detailed. I have written down the characteristic to teach the LLM about the main key characteristic of 9 sub problems. The total characters of my prompt is 27000 characters (the limit is 24000 characters for one prompt). So, I use 9 Static Text with detailed information about step-by-step to identify the problem and solve it. Luckily, the Finance BUDDY can formulate the finance problem step-by-step with arbitrary inputs. It can give the guidance how to solve the problem with equations to verify its correctiveness. In addition, I asked the assistant to generate the python code. The main reason why I do it because I do NOT trust the LLM calculations - after many testing - I expect the next version of Amazon Bedrock should have CODE INTERPRETER for python code. Then I use the python code in other python IDE or code editor to estimate the result. Amazingly, the result is great - it solved correctly 40 problems given 62 problems from Corporate finance book written by Ross Westerfield Jaffe in chapter 4.

You can TEST the FINANCE BUDDY to solve the one of the following problems:

A. John takes out a $200,000 loan from the bank to start his business. The loan has a 10-year term with monthly payments at an annual interest rate of 5%. However, the loan is amortized over only a 20-year period, meaning there will be a large balloon payment due at the end of the 10-year term

If John makes monthly payments of $1,331, what will the remaining balloon payment be at the end of the 10-year term?

B. You want to buy a new sports car from Muscle Motors for $73,000. The contract is in the form of a 60-month annuity due at a 6.45 percent APR. What will your monthly payment be?

C. David has just won the state lottery, paying $50,000 a year for 20 years.

He is to receive his first payment a year from now. The state advertises this as the Million Dollar

Lottery because $1,000,000 = $50,000 * 20. If the interest rate is 9 percent, can I call him as a millionaire?

NOTE: do not trust the result calculated by any LLMs, use the python with another IDE (as illustrated in the video) or the equations to calculate on your own. You should re-formulate the problems by yourself to compare the guidance by the FINANCE BUDDY.

Lastly, I used all the detailed instructions above to make a FINANCE PROBLEM GENERATION - TEACHER. I asked the LLM to generate a random problem for me to practice my finance skills with the 9 sub detailed instructions.

You can chat to FINANCE BUDDY or FINANCE TEACHER to learn finance now.

KEY TAKEAWAY: I have typed very detailed instructions with equations for the 9 sub problems. It is the way to guide LLM to solve the big problem. You will be amazed by its abilities in solving and generating finance problems.

**Community Impact:**

I do hope that anyone can learn finance easily with the assistant. They can ask generic questions and learn how to break the sophisticated problem into smaller ones. Then, by formulating the problems with math equations, you can solve your daily life problems. All the knowledge I made in the prompt with equations are extracted from FINANCE book. I also derived all the equations from Finance book published by Mc Graw Hill Education Publisher. If you can point out any equation wrong in my prompt, I am very happy to correct it to make it smarter to get the prize.

Here is the Live demo link of the app, Try it out or Remix -

Video demo about learning finance :

https://youtu.be/DmqFH_JiMl4

**Alternative Development Scenario with Amazon Bedrock:**

I would love to use Amazon Bedrock with Lambda to run my python code seamlessly instead of copying my python code from partyrock to code IDE now. The characters limit for the prompt limiting the capability of the FINANCE BUDDY and FINANCE TEACHER. Therefore, I do hope I can develop a better version by using Amazon Bedrock.