Solver and Data Analysis Add-ins for Excel for Mac 2019
/////////////////////////////////////////////////
 
 Solver and Data Analysis Add-ins for Excel for Mac 2019
 
   https://support.ivey.ca/s/article/Solver-and-Data-Analysis-Add-ins-for-Excel-for-Mac-2019

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

Definition of a function
////////////////////////////////
In programming and mathematics, a function is a named block of code or a mathematical
    expression that performs a specific task or computation. Functions take input values 
    (arguments or parameters) and return a result or perform actions 
    based on those inputs. The primary purpose of functions is to encapsulate reusable 
    pieces of code, making programs more modular, readable, and easier to maintain.

In mathematics, a function is a relation between a set of inputs (domain) and possible 
   outputs (range), where each input is related to exactly one output. In programming, functions
   serve a similar purpose, allowing developers to break down complex tasks into smaller, more
   manageable units. Functions are defined using a name, a list of parameters, and a body of 
   code that specifies what the function does when called. When a function is called, the specified 
   code block is executed, and the function may return a value or perform specific actions. 

 Functions promote code reuse, and abstraction, and help organize code into logical units, enhancing
   the clarity and efficiency of software development.

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

The simplest function written in R
////////////////////////////////
Objective: double any input value

  dd<-function(x)x^2


  where dd is function name
        function is the reserve word
        x is the input 
        x^ is the output 

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

pv function for one given future flow
////////////////////////////////
Write an R program to calculate the present value for one given 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%?

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