You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<title>1. Introduction: abstraction in mathematics and programming — Object oriented programming in Python for mathematicians 2020.0 documentation</title>
<h1><spanclass="section-number">1. </span>Introduction: abstraction in mathematics and programming<aclass="headerlink" href="#introduction-abstraction-in-mathematics-and-programming" title="Permalink to this headline">¶</a></h1>
54
+
<p>A core tool of mathematics is to define abstract objects and the
55
+
operations which apply to them. This approach defines all the basic
56
+
building blocks which enable us to reason mathematically and perform
57
+
calculations. We start off with basic objects like numbers and define
58
+
arithmetic operations on them. As we become more sophisticated, we
59
+
define more and more complex objects, with appropriately more involved
60
+
operations: matrices, polynomials, sets, groups, algebras. Being able
61
+
to reason at the level of abstract objects is essential in making
62
+
mathematics comprehensible. Consider matrices: linear algebra would be
63
+
highly impractical at best if we could not define matrix addition and
64
+
multiplication, and had instead to work directly with sums of products
65
+
of scalars. More generally, without abstraction the edifice of higher
66
+
mathematics would rapidly collapse under the weight of its own
67
+
complexity.</p>
68
+
<p>The situation in computer programming is strikingly similar. At the
69
+
simplest level, the central processing unit of a computer is capable
70
+
only of a limited set of rather primitive arithmetic and logical
71
+
operations on a few finite subsets of the integers, and of the
72
+
floating point numbers. However, on this tiny foundation is built
73
+
every piece of software in existence, including very sophisticated
74
+
programs for text manipulation, higher mathematics, sound and
75
+
video. Moreover, this software is routinely created by ordinary people
76
+
using relatively modest amounts of effort. How is this possible? It is
77
+
possible because of the same principle of abstraction which underpins
78
+
mathematics: more abstract objects and the operations on them are
79
+
defined in terms of simpler ones.</p>
80
+
<p>Think about plotting a graph on a computer. As a 21st century
81
+
mathematician you don’t write loops over arrays to compute the pixel
82
+
values that will result in the right curve appearing on a screen, you
83
+
use a high-level language such as Python which has plotting objects
84
+
which take in data and perform all of those calculations for
85
+
you. Where did those plotting objects come from? They are the result
86
+
of the manipulation of lower-level abstract objects in a chain that
87
+
eventually ends up with primitive operations on integers and floating
88
+
point numbers. But, critically, as the person wanting to plot some
89
+
data <em>you don’t care</em>.</p>
90
+
<p>Why, then, as a mathematician should you care about abstraction in
91
+
programming? There are two key reasons. First, because an
92
+
understanding of the abstractions on which software is built will give
93
+
you a better understanding of how that software works and will
94
+
therefore make you a better user of that software. The second is that
95
+
making appropriate use of abstractions will make you a better
96
+
programmer of mathematics and other software. Applied well, objects
97
+
and abstraction produce software which is easier to write, easier to
98
+
understand, easier to debug and easier to extend. Indeed, as with
99
+
abstraction in mathematics, abstraction in coding is a form of
100
+
constructive laziness: it simultaniously allows the mathematician to
101
+
achieve more and do less work.</p>
102
+
<p>This course is a second course in programming, building a previously
103
+
acquired basic understanding of programming in Python. In covering
104
+
more advanced programming, we will pay particular attention to objects
105
+
and abstraction as they occur in Python. Furthermore, we will do so
106
+
from a mathematician’s perspective, understanding programming as a
107
+
process of defining and manipulating mathematical objects, and
108
+
scientifically testing and debugging the results.</p>
109
+
</div>
110
+
111
+
112
+
<divclass="clearer"></div>
113
+
</div>
114
+
</div>
115
+
</div>
116
+
<divclass="clearer"></div>
117
+
</div>
118
+
<divclass="footer" role="contentinfo">
119
+
© Copyright 2019-2020, David A. Ham.
120
+
Created using <ahref="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
0 commit comments