Present value function for one future cash flow
////////////////////////////////
 The present value for a given future value is 
                                  FV
    pv(one future cash flow)=  ----------
                                (1 + R) ^n
  where FV is the future value
        R  is the period rate
        n is the number of periods
             Note: R and n should be consistent, i.e., with the same frequencies. 

   For example, what is the present value of $100 received
    at the end of year 5 with an annual discount of 5%?
  
////////////////////////////////

OpenAI offers boy's names
///////////////////////////////////////////
from langchain.llms import OpenAI
llm = OpenAI(temperature=0.9)
text = "What would be a good name for a born boy?"
print(llm(text))

Some good names for a baby boy include:
1. Liam
2. Noah
3. Elijah
4. James
5. Benjamin
6. Lucas
7. Mason
8. Logan
9. Jackson
10. Ethan

https://python.langchain.com/en/latest/getting_started/getting_started.html
///////////////////////////////////////////

Excel mmult() function 
/////////////////////////////////////
 Example #1:
               =mmult(myRow,myClumn)                Ctrl-Shit-Enter

 Example 2: 
               =mmultmyClumn, myRow)                Ctrl-Shit-Enter

 Example 3: 
               =mmult(myRow,transpose(myrow))        Ctrl-Shit-Enter

 Example 4: 
               =mmult(myColumn,transpose(myColumn))  Ctrl-Shit-Enter

 Example 5: 
               =mmult(matrixA,matrixB)               Ctrl-Shit-Enter

  Note for dimension requirements, see 

   >e10(9)

/////////////////////////////////////

Derivation of the present value of an annuity
///////////////////////////////////////////
  1) Same amounts of cash flows
  2) Happen at the same intervals
  3) for n periods 
  4) 1st cash flow happens at the end of the 1st period
                c       c       c       c             c     
       |--------|-------|-------|-------|---.....-----|
       0        1       2       3       4             n     
Formula: 
                  c           1
   pv_annuity=  -----*(1 -  ----- )
                  R         (1+R)^n
Just image that the above cash flows are the summation of two perpetuities 
  Assume that n =5
                c       c       c       c       c     
       |--------|-------|-------|-------|--------|
       0        1       2       3       4        5

Equivalent to two perpetuities shown below. 
                c       c       c       c       c       c   --> c
       |--------|-------|-------|-------|-------|-------|-- --> infinity
       0        1       2       3       4       5       6   
                                                       -c   --> c
       |--------|-------|-------|-------|-------|-------|-- --> infinity
       0        1       2       3       4       5       6   
Case #1: receive $10 at the end of each year for the next 5 years
Case #2: receive $10 at the end of each year forever, plus pay $10 forever starting year 6
  pv(annuity) = pv(perpetuity #1) - pv(perpetuity #2)
                     c            c        
              =     ----   - pv (----)  = 
                     R            R       
                     c          c    1    
              =     ---   -   ----* ---
                     R          R   (1+R)^n
                   c            1
              =  ---- [ 1 -   ----    ]
                   R          (1+R)^n
///////////////////////////////////////////