MET CS 563 Software Development with C++ for Mathematical by byt34827

VIEWS: 0 PAGES: 13

									          MET CS 563
Software Development with C++ for
      Mathematical Finance

           Dr. Tanya Zlateva
    MET Computer Science Department
    755 Commonwealth Ave., Room 103
            Boston, MA 02215
          phone: 617-353-2568
      e-mail: ―lastname at bu-do-edu‖
        MET CS 563 Software Development with C++ for
                          Mathematical Finance
Goals:
(i) Programming and object oriented methods in C++; Focus!
(ii) illustrated on finite differences solutions for the basic models of financial
     derivatives;
(iii) design and develop software for modeling financial derivatives.

Prerequisites:
• CAS MA 226 or equivalent knowledge of differential equations
• Prior programming experience in high level language recommended

NOTE: NO credit towards the MS in Computer Science




  3/22/2010                      MET CS 563--Fall 2008                           2
                                    1. Introduction
The science of computing – ancient and young

Computer science is unique in that it
• Traces its intellectual roots as far back as the 3d
  millennium BC, when the scribes of ancient
  Mesopotamia recorded computing recipes - or
  algorithms as we will call them today - on clay
  tablets;
• Implements these algorithms in the latest
  technologies, e.g. giga and tera flop
  supercomputers, optical computing, etc.
3/22/2010            MET CS 563--Fall 2008              3
                        1. Introduction
            Computing through the ages with
              ―pencil and paper‖ - software
• Computing recipes in ancient Mesopotamia and
  Egypt on clay tablets (4th - 3d millennium BC);
• Euclid formulates the first formal algorithm that
  finds the greatest common devisor of two
  integers (ca. 300 BC);
• 9th century AD: Al-Khwarizmi writes textbooks
  on computing with

formulas            finite sequence of steps
algebra               algorithm


3/22/2010              MET CS 563--Fall 2008          4
                          1. Introduction
            Computing through the ages with a
             ―mechanical‖ device - hardware
• abacus, invented some 5,000 years ago in Asia,
  performs digital computations (still in use);
• mechanical calculators in the 17th century:
  Wilhelm Schickard (Germany), Blaise Pascal
  (France), Gottfried Wilhelm Leibnitz (Germany);
• analog devices: slide rule, analog computers for
  special purpose computations.




3/22/2010              MET CS 563--Fall 2008         5
                          1. Introduction
             Modern General Purpose Computers
The key difference of today’s computers to their precursors is
that they are
                general purpose computing devices
i.e. they are not limited to solving a specific class of problems,
such as arithmetic operations, differential equations, predicting
tides, but can perform
         any computation specified in a way the computer
                        understands/accepts.
This generality led to the development of
• a new concept of computation and
• formal computer languages
 3/22/2010                MET CS 563--Fall 2008                  6
                             1. Introduction
                  computation
3.1415*2.1*2.1            numerical

 true and false = false            logical
     xdx  x 2
             2
                                    symbolic
         “hello”  “password”                       text
                                          any other data…,
                                           even the brain
                                           ―computes‖…
  3/22/2010                 MET CS 563--Fall 2008            7
                               1. Introduction
  Computer Languages: high level vs. machine

source code: program in a        high level language:
                                    independent of the
                                    specific computer
                                    architecture:
        Compiler
                                 Pascal, C, C++, Java

object code: translation of
source code into another
language, typically into a       machine language:
                                   specific for a given
                                   computer architecture
 3/22/2010                MET CS 563--Fall 2008            8
                             1. Introduction
Computer Languages: imperative vs. object oriented
Imperative or Procedural: specify       do action-1 on data-object-1     c=a+b
• sequence of actions on                do action-2 on data-object -1     f=d*e
• data (objects)                        …                                             C
                                        do action-n on data-object -n print c,f
Object Oriented: bundle actions &
   data together into
objects, (e.g. date, place, person) with                 object today
• data or attributes; and                       attributes/data:
                                                               day      18
• behavior or actions object can do
Objects can                                                  month      09
• interact with each other                                            2008
                                                                                  C++
                                                              year
                                                behavior:
• change each other,
                                                     advance
• create new objects and                             tellMo/tellDay/tellYear
thus ultimately producing the desired
   result
    3/22/2010                      MET CS 563--Fall 2008                          9
                                      1. Introduction
What Is Needed To Get This Done?--Procedural
Formal specifications for:

(i) actions and type   (ii) variable with            (iii) applying
    of data              unique value                    actions to data
                         assigned in memory

       +                            a    5

     int --                                                c=a+b
                                    b 10
       indicates
       operation on
                                    c 15
       integer



  3/22/2010                  MET CS 563--Fall 2008                   10
                                1. Introduction
    What Is Needed To Get This Done?—Object
                    Oriented
Formal specifications for:
(i) bundling actions    (ii) defining objects        (iii) applying
    and data                                             actions on
                                                         objects
         Date                     today              today.advance()
attributes/data:         attributes/data:            today.tellMo()
       day                      day        8         today.tellDay()
                                                     today.tellYear()
     month                    month        9

      year                     year       2008

behavior:                behavior:
   advance()                advance()
  tellMo()                 tellMo()
  tellDay()                tellDay()
  tellYear()               tellYear()
                                                                      11
  3/22/2010                  MET CS 563--Fall 2008
                                1. Introduction
                   ProceduralObject Oriented
(i) type                      (ii) objects               (iii) actions on
                                                             objects
                       a    5 b 10             c 15            c=a+b
  int

         Date                       today              today.advance()
attributes/data:           attributes/data:            today.tellMo()
                                                       today.tellDay()
                                 day           8
      day                                              today.tellYear()
                               month           9
    month
                                year          2008
     year
behavior:                  behavior:
   advance()                  advance()
  tellMo()                   tellMo()
  tellDay()                  tellDay()
  tellYear()                 tellYear()

  3/22/2010                    MET CS 563--Fall 2008                        12
                                  1. Introduction
                         Why C++?
    • Remains the dominant programming language for large
      numeric software applications in engineering, finance, and
      science.
    • Existence of large number of software packages written in
      in C and C++.

     Pros:                                   Cons:
•   Expressive                              • Complex
•   Efficient
                                            • Difficult to learn.
•   Downward compatible with C
•   Inherited C tool support.

3/22/2010                 MET CS 563--Fall 2008                     13
                             1. Introduction

								
To top