object oriented programming mathematics l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Object Oriented Programming & Mathematics PowerPoint Presentation
Download Presentation
Object Oriented Programming & Mathematics

Loading in 2 Seconds...

play fullscreen
1 / 20

Object Oriented Programming & Mathematics - PowerPoint PPT Presentation


  • 177 Views
  • Uploaded on

Object Oriented Programming & Mathematics. The Beauty of Implementing Abstract Structures as Abstract Structures. Marc Conrad, University of Luton. Once upon a time. Mathematics before the 20 th century. there was two branches of Mathematics. axiomatic.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Object Oriented Programming & Mathematics' - jana


Download Now An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
object oriented programming mathematics

Object Oriented Programming & Mathematics

The Beauty of Implementing Abstract Structures as

Abstract Structures.

Marc Conrad, University of Luton.

Marc Conrad, University of Luton

once upon a time
Once upon a time...

Mathematics before the 20th century

Marc Conrad, University of Luton

there was two branches of mathematics
there was two branches of Mathematics

axiomatic

Mathematics before the 20th century

algorithmic

Marc Conrad, University of Luton

axiomatic
Axiomatic

Hilbert,

N. Bourbaki,

etc.

axiomatic

Mathematics before the 20th century

algorithmic

Marc Conrad, University of Luton

algorithmic
Algorithmic

axiomatic

Mathematics before the 20th century

algorithmic

Turing,

Church,

etc.

Marc Conrad, University of Luton

pure mathematics computer science
Pure Mathematics & Computer Science

axiomatic

"pure" mathematics

Mathematics before the 20th century

algorithmic

computer science

Marc Conrad, University of Luton

with links in between
With links in between.

axiomatic

"pure" mathematics

Mathematics before the 20th century

computer

algebra etc.

algorithmic

computer science

Marc Conrad, University of Luton

however some topics of computer science seemed to be unrelated to mathematics
However, some topics of Computer Science seemed to be unrelated to mathematics...

axiomatic

"pure" mathematics

Mathematics before the 20th century

algorithmic

computer science

software design

operating systems

Marc Conrad, University of Luton

as e g object oriented programming
as e.g. object oriented programming.

axiomatic

"pure" mathematics

Mathematics before the 20th century

algorithmic

object oriented programming is a technique to solve the "software crisis". It evolved in a context completely unrelated to mathematics.

computer science

e.g. object oriented programming

Marc Conrad, University of Luton

slide10
But object oriented programming is closer to "axiomatic" mathematics than it appeared in the first place.

object oriented programming...

... allows to implement abstract structures in an "axiomatic" way.

"pure" mathematics

axiomatic

Mathematics before the 20th century

algorithmic

object oriented programming

computer science

Marc Conrad, University of Luton

example a ring abstract
We cannot implement:

addition

negation

multiplication

inversion

"zero"

"one"

check if zero

We can implement:

subtraction (because of addition and negation)

exponentiation a

embedding of Z, Q.

check for equality

polynomials over this ring

etc.

Example: A ring (abstract).

n

Marc Conrad, University of Luton

example a ring
We cannot implement:

addition

negation

multiplication

inversion

"zero"

"one"

check if zero

We can implement:

subtraction (because of addition and negation)

exponantiation a

embedding of Z, Q.

check for equality

polynomials over this ring

etc.

Example: A ring.

The good news is:

Object Oriented programming allows having objects which do not implement everything!(Concept of overriding abstract methods)

n

Marc Conrad, University of Luton

a uml approach to a ring
A "UML" approach to a ring.
  • The child classes implement (override) the missing functionality of the parent class.

Ring

Z

Q

Polynomial

Ring

Marc Conrad, University of Luton

a uml approach to a ring14
A "UML" approach to a ring.
  • But things are more complicated, a polynomial is defined over a ring. It both inherits and aggregates a ring.

Ring

Z

Q

Polynomial

Ring

Marc Conrad, University of Luton

a uml approach to a ring15
A "UML" approach to a ring.

Leads to multivariate polynomials by implementing univariate polynomials!

  • But things are more complicated, a polynomial is defined over a ring. It both inherits and aggregates a ring.

Ring

Z

Q

Polynomial

Ring

Marc Conrad, University of Luton

a uml approach to a ring16
A "UML" approach to a ring.
  • And in order to perform computations we also need a class for the elements of a ring.

Ring

Element

Ring

Z

Q

Polynomial

Ring

Marc Conrad, University of Luton

the practical side
The practical side.
  • In order to get experience with the idea, an experimental implementation in Java classes has been developed.
  • Java is highly object oriented but not very common in mathematical context.
  • Results can be viewed at http://ring.perisic.com
  • The name of the Java package is consequently:

com.perisic.ring

Marc Conrad, University of Luton

results remarks conclusions
Results, Remarks, Conclusions
  • It is possible to work with abstract structures!
    • E.g. Modular Ring R/p(x), where R is abstract.
    • E.g. Quotient Field Quot(R), where R is abstract.
    • Same amount of work as implementing Z/mZ or Q.
  • Multivariate polynomials can be used although only univariate polynomials have been implemented (over R).
  • Complex structures can easily be derived as child classes:
    • Cyclotomic fields, complex numbers, rational function fields, ...
  • Concepts for automatic mapping from one ring to another.

Marc Conrad, University of Luton

results remarks conclusions19
Results, Remarks, Conclusions
  • It is astonishing simple to implement complex mathematical structures in an object oriented environment "from scratch".
  • You are invited to experiment, contribute, or share experiences. The package com.perisic.ring is available and documented at http://ring.perisic.com.
  • Caveat: There are drawbacks: performance, decisions on how to organise classes, implementing specialised algorithms (primality testing, factoring, …)

Marc Conrad, University of Luton

results remarks conclusions20
Results, Remarks, Conclusions
  • The experiments with the Java package com.ring.perisic show that object oriented programming deserves a closer look in the context of mathematics:
    • The mechanism of overriding and dynamic binding allows protoyping of abstract mathematical structures.
    • Object oriented programming should be a main feature in CAS (as user defined functions a couple of years ago).
    • Mathematical software should use object oriented terminology instead of "reinventing the wheel".
  • Disseminate object oriented concepts to the mathematical community.

Marc Conrad, University of Luton