mathematics

16
Instructor: Philip Parzygnat Introduction Computer Algebra Systems Modern com- puters have helped scientists in research and ex- perimentation since their invention in the mid 20th century. The computer is a tool that simplifies many tasks and accomplishes some that we may find difficult to accomplish using our own insight. Computer Algebra Systems are a collection of tools that mathematicians (and other scientists) use to understand and solve computational prob- lems. The tools are provided in the form of a software package and are distributed for general use. The CAS employed in this course is called Mathematica. Mathematica was conceptualized by Stephen Wolfram (a famous mathematician in his own right). After developing the first version of Mathematica, Wolfram went on to found a very successful research and software development com- pany. A link to his website is available as a link on the course website (similarly a link to his research and educational site called MathWorld at Wolfram is also available). Mathematica is a tool you as stu- dents can use to both solve and visualize math problems. The requirement for solving and visualizing problems using Mathematica is to understand how the software works and learn the symbolic language that is required to command the software to execute instructions. Precalculus and Beyond This course will be structured to help you understand some of your work in precalculus and introduce you to applications of elementary mathematics. The course may also introduce you to some new topics that go beyond your precalculus course and start building your intuition of calculus. We will be focusing on visualizing functions and solving equations (some topics deal with applications of mathematics to real world problems). Mathematics is a key field to any scientific research because we are finding (as a people) that more and more phenomena in nature and beyond obey strict rules that can be described mathematically. With that said I hope the course introduces everyone to the power of mathematics in general and computers in particular. 1

Upload: philip-parzygnat

Post on 12-Aug-2015

23 views

Category:

Documents


0 download

TRANSCRIPT

Instructor: Philip Parzygnat

Introduction

Computer Algebra Systems Modern com-puters have helped scientists in research and ex-perimentation since their invention in the mid 20thcentury. The computer is a tool that simplifiesmany tasks and accomplishes some that we mayfind difficult to accomplish using our own insight.Computer Algebra Systems are a collection oftools that mathematicians (and other scientists)use to understand and solve computational prob-lems. The tools are provided in the form of asoftware package and are distributed for generaluse. The CAS employed in this course is calledMathematica. Mathematica was conceptualized byStephen Wolfram (a famous mathematician in hisown right). After developing the first version ofMathematica, Wolfram went on to found a verysuccessful research and software development com-pany. A link to his website is available as a link onthe course website (similarly a link to his research

and educational site called MathWorld at Wolfram is also available). Mathematica is a tool you as stu-dents can use to both solve and visualize math problems. The requirement for solving and visualizingproblems using Mathematica is to understand how the software works and learn the symbolic languagethat is required to command the software to execute instructions.

Precalculus and Beyond This course will be structured to help you understand some of your work inprecalculus and introduce you to applications of elementary mathematics. The course may also introduceyou to some new topics that go beyond your precalculus course and start building your intuition ofcalculus. We will be focusing on visualizing functions and solving equations (some topics deal withapplications of mathematics to real world problems). Mathematics is a key field to any scientific researchbecause we are finding (as a people) that more and more phenomena in nature and beyond obey strictrules that can be described mathematically. With that said I hope the course introduces everyone to thepower of mathematics in general and computers in particular.

1

Instructor: Philip Parzygnat

About Numbers

Defining Mathematics The study of mathematics can be challenging to fully define. One conceptthat is unavoidable when studying elementary mathematics is the concept of quantity which is measuredusing numbers. A good way to grasp what we study as mathematicians is to understand the underliningsystems that are utilized in the art. Numbers are grouped into classifications in mathematics. Theclassifications are based on properties that certain numbers satisfy. Some number classifications describenumbers that are intuitively harder to grasp. We will discuss one such number (π) in the future.

The Natural Number System Of all numbers (possibly) the easiest to consider is the number 1.From 1 we can begin to count items (enumerate) using what is called the Natural number system (N).Counting leads from 1 to 2 and from 2 to 3 etc. therefore the Natural number system can be defined asfollows:

N = {1, 2, 3, ...}

The study of Natural numbers led mathematicians to consider subclasses of the Natural numbers, inparticular (i.) the odd numbers which are not evenly divisible by 2 (ii.) the even numbers which areall evenly divisible by 2 (iii.) the prime numbers which are only evenly divisible by 1 and themselves(iv.) perfect squares which can be composed by multiplying a particular natural number by itself (i.e.2× 2 = 4). These subclasses are (generally) viewed to have less members than the Natural numbers andare composed of a subset of the Natural numbers (therefore an even number is also a Natural numberbut a Natural number is not necessarily even).

Zero The number 0 was not understood as people began to count, only much later did we decide toconsider the number 0 (which symbolizes the absence of something). The Natural numbers including 0are called the Whole numbers.

The Integers Once Natural numbers were understood some mathematicians considered the negativecounterparts of particular Natural numbers (i.e. −1 is the negative counterpart to 1). They began usinga system of numbers that included the Natural numbers, zero, and the set of negative counterparts. Thissystem is called the Integer number system.

1

The Real Numbers To understand the Real number system, we must consider the existence of aportion of something (i.e. half of an apple). Once we begin to consider portions a new and morecomplicated number system must be constructed. The Real number system is used to describe Integernumbers and fractions of Integer numbers. It is split into two separate categories (i.) Rationals arenumbers that can be represented in fractional form with repeating or terminating decimal expansions(i.e. 1/3 or 0.3333...) (ii.) Irrationals are numbers that have non-repeating and non-terminating decimalexpansions (i.e. π). The two subclasses of the Real number system have no members in common (theyare disjoint), combined they form the Real number system completely.

The Real Interval Consider a line drawn on a piece of paper.

a bcde

0 1

The line can be subdivided at point a and then subdivided further at b etc. The Real number systemcan be used to describe any point i on the line. Mathematicians call the collection of points between 0and 1 a Real interval and consider the collection to be complete.

2

Instructor: Philip Parzygnat

Arithmetic Operators

Addition and Multiplication Once numbers have been appropriately defined and classified, we canbegin to manipulate numbers using operators. The most basic arithmetic operations are defined as addi-tion (+) and multiplication (×). Both of these operators have their respective counterparts subtraction(−) and division (÷). In Mathematica we can perform arithmetic operations without understanding thesymbolic language Mathematica requires to write statements. These basic operations can be executedmore intuitively than most other commands. We can add two numbers by writing the following statementin Mathematica:

a+ b (where a and b are real numbers)

The above statement then needs to be executed or interpreted by Mathematica. In order to execute acommand in Mathematica it is necessary to press the shift key and the enter key at the same time. Theabove statement can be written as follows (less intuitive but utilizes Mathematica syntax or the symboliclanguage):

Sum[a,b] (where a more general statement could be written Sum[a, b, c, ...])

The remaining arithmetic operations are defined similarly (÷ and × are written / and * respectfully).

Mathematica Statements Mathematica requires an understanding of some basic programming con-cepts. When we work with computers we must understand that computers are in general very precisemachines and as such are very poor interpreters. Here is an example scenario that explains the point:

In the afternoon, a pedestrian takes a walk into town. He forgets his watch at home and asks anotherpedestrian for the time. The pedestrian responds, saying it is 5. Being that it is the afternoon, it is clear

that it is 5pm. If a computer were to ask for the time our response would have to be 5pm (not 5)because the computer does not have any further intuition.

The idea that we must direct a computer to carry out instructions exactly by writing precise statementsis very important when programming. The rules by which a computer interprets statements is calledsyntax.

1

Advanced Examples Below is an example of a complex program written in Mathematica. The ob-jective of this class will be to reproduce the code for this program with no syntactical errors (i.e. typingthe program into Mathematica exactly as it is on this page).

sieve[n_]:= Module[{primes=Range[n], s=2}, primes[[1]]=0; While[s<n+1, Do[primes[[i]]=0, {i, 2s, n, s}]; s=s+1; While[s<n+1 && primes[[s]]==0, s=s+1]]; DeleteCases[primes, 0]]

2

Instructor: Philip Parzygnat

The Line

Cartesian Coordinates In geometry the mostbasic concept is that of a point. If we draw twopoints on a plane (or a piece of paper), these twopoints can be interpreted as the two defining pointsof a line. In other words, to draw a line we canconnect the two points. The point and line arethe subject matter of the first two definitions ina well known text in ancient mathematics calledThe Elements by Euclid. The text was and is fun-damental to understanding geometry (in fact thestandard geometric plane is named after Euclid i.e.the Euclidean plane). Later in history a math-ematician and philosopher named Rene Descartesdeveloped Euclid’s ideas into what we now call an-alytic geometry. In analytic geometry we considerour geometric objects (i.e. lines or parabolas) tobe imposed in a Cartesian coordinate system (thex and y axis). Once we impose our geometric ob-

jects in a coordinate system we can begin to algebraically define the objects with respect to the two (ormore) axes. Namely, y = x can be interpreted geometrically and drawn on a Euclidean plane. Morecomplex figures can also be associated with a particular algebraic form (i.e. the circle x2 + y2 = 1).

The Conversion Lines are generally written in f(x) form, where (f(x) denotes the y axis). A functionf(x) = mx+b is what we call the general form of a line. A specific line would be described by associatingm and b with real values (i.e. f(x) = 1

2x + 3). The line f(x) = 12x + 3 is distinct and unique (i.e. any

other line that is reducible to the same form is the same line). For further details on lines consult yourprecalculus textbook.

Plotting Lines Mathematica has a method by which we may plot lines (and other geometric objects).The following is an example of a statement that plots a line in general form:

Plot[mx + b, {x , -10, 10}]

The example above does not work until we substitute m and b with real values.

1

Beyond Analytic Geometry Once we have become familiar with analytic geometry, a more advancedform of mathematics can be applied to studying geometric objects. Calculus was invented independentlyby two men (Newton and Leibniz). Newton wrote about calculus methods in his work Principia andLeibniz wrote about calculus in a separate work. Calculus helps us understand how geometric objectsare related to their areas and vice versa. When given a line f(x) = 1

2x+ 3, we can integrate (integrationis a process in calculus) f(x) and the result of our integration will be the area under the line. Integrationhas a counterpart called differentiation. When we differentiate a line we arrive at the slope (or rate ofchange) of the line. These two processes will be briefly described in a future handout and lecture.

2

Instructor: Philip Parzygnat

Geometry

A

BC

A + B = C2 2 2

The Pythagorean Theorem There exists a re-lationship between the two sides and hypotenuseof a right triangle known as the Pythagorean the-orem. In fact, this is the oldest known theoremin mathematics. The Pythagorean theorem statesthat the hypotenuse c of a right triangle is relatedto the two sides of a right triangle by the formulac2 = a2 + b2. A more general rule known as thelaw of cosines c2 = a2+b2−2abcos(C). The law ofcosines considers a triangle that is not necessarilyright.

Quadratics Quadratic equation are generallywritten ax2 + bx + c. When geometrically trans-lated these equations are described by parabolas.In general the functions we study in precalculusare mostly described when considering the crosssection of a conic. For further details on conicsand conic sections see your precalculus text book.We can plot quadratic equations using the same

method as we used for plotting lines. We must simply replace the line equation with that of a quadratic.In order to plot more than one function in a single graph the following statement can be used:

Plot[{f, g, h}, {x , -10, 10}]

In the above statement you must replace f , g, and h with actual functions.

Roots When dealing with quadratic equations there exists a formula for determining the roots of

quadratic equations. This is called the quadratic formula −b±√b2−4ac2a . Geometrically the roots of an

equation describe the x-intercepts of that particular quadratic. In many cases the roots are not real(they fall into a higher number classification called the Complex number system). Below is an exampleof a Mathematica statement that solves for the roots of a given quadratic equation.

Solve[ax +bx+c==0, x]2

The above is a general solution. In order to solve for the roots of a quadratic you must replace a, b, andc with real values.

1

Complex Numbers When solving for the roots of quadratic equations, many solutions have√−1 as

a factor.√−1 is often written as i or the imaginary number. The standard form for writing complex

numbers is in parts. Complex numbers have both a real and imaginary part (i.e. α + βi). Whenmultiplying complex numbers we must consider that

√−1 × √−1 = −1. This caveat has interestingeffects on how these numbers behave. Complex numbers can be geometrically interpreted as points ona plane. In Cartesian coordinates they are points in two dimensions (i.e. the real dimension and theimaginary dimension). The plane that we plot complex numbers on is called the Argand plane.

2

Instructor: Philip Parzygnat

Trigonometry

Some Properties Similar to the Pythagorean theorem a2+b2 = c2 is the Pythagorean (trigonometric)identity sin2(x) + cos2(x) = 12. sin(x) and cos(x) are trigonometric functions that relate the angles of atriangle to the perimeter of a triangle. Geometrically, both the sine and cosine curves are periodic over2π (i.e. repetitive over the interval). Some properties of sine and cosine are known as the amplitude (α),the frequency (β), the period (γ). The sine function can be defined f(x) = αsin(βx± γ) (the cosine canbe defined similarly. Now, the amplitude is geometrically interpreted as the height of the curve. Thefrequency is geometrically interpreted as the number of periods (repetitions) over the interval. Finally,the period is geometrically interpreted as the curves offset with respect to its standard period (normallysine starts at 0 and rises and cosine starts at 1 and falls). In order to understand further the propertiesof these trigonometric functions please review the precalculus textbook.

Plotting Trigonometric Functions The sine and cosine functions can be plotted in Mathematicausing the same function we use for plotting all other geometric objects. The following is the code necessaryto plot a sine curve and cosine curve respectfully:

Plot[a Sin(b x + c), {x, 0, 2 Pi}]

Plot[a Cos(b x + c), {x, 0, 2 Pi}]

In the above example α = a, β = b, and γ = c (a, b, and c real valued numbers).

1

θ

Figure 1:

Applications A pendulum is a weight sus-pended by a pivot so that it may swing freely.Figure 1 is a diagram of a simple pendulum. Here

the following law holds T ≈ 2π√

Lg where T is the

period of the pendulum, L is the length of the pen-dulum, and g is the local acceleration of gravity.Using a pendulum and this law we can approxi-mate the local acceleration of gravity by measuringthe period T . The pendulum exhibits approximatesimple harmonic motion which is described by thefollowing equation θ(t) = θ0cos(

2πtT ). That exem-

plifies how some real world phenomena obey rulesthat can be described using mathematics. New-ton pursued understanding the interworking of theplanets with respect to gravity and described hisfindings in his work (Principia) which came to beknown as Newtonian Mechanics. In recent historyAlbert Einstein improved (generalized) Newtonian

mechanics in his theory known as relativity.

2

Instructor: Philip Parzygnat

Calculus

Curves and Areas Calculus is the study oftechnique in differentiation and integration. Inthis section we will discuss the process of integra-tion. Let us consider the line f(x) = x. The objectof the analysis is to determine the exact area of atriangle starting at the origin point and extendingto a point on the x axis (say a). So, being that thisis a line we can intuitively say that the area of atriangle at a = 1 is 1

2 . Similarly, the area of a tri-angle at a = 2 is 2 (it may be necessary to sketch adiagram). The formula that denotes the process ofintegrating f(x) is

∫ a

0xdx. In the formula the in-

tegral is denoted by∫, the lower bound is denoted

by 0, and the upper bound is denoted by a. Inthis particular example we set the lower bound to0 this is the point of origin from which we want todetermine the area under f(x). The upper boundis the point of termination past which we are notconcerned with the area under f(x). In this simple

example (of polynomial form) the process of integration is carried out as follows: (i.) xn → xn+1 (ii.)

xn+1 → xn+1

n+1 . So then∫ a

0 xdx = x2

2

∣∣∣∣a

0

this result simplified is the general formula for calculating the area

underneath f(x) = x. When simplifying we get a2

2 . For further details on this example there is a calculuslink on the website.

Intuition The process of integration is a limiting process. For any function in order to understandhow integration works we must partition the area underneath the curve into rectangles (as in the imageabove). As we partition the area into more rectangles we get a closer and closer approximation of thearea under the curve. When the process approaches a limit (i.e. when there is an infinite partitioning)the area under the curve is precisely calculated. Integration works in that fashion.

Integrating In Mathematica we can integrate an integrable function using the following command:

Integrate[f(x), {x, a, b}]

In the above example f(x) is the function with variable x, a is the lower bound and b is the upper bound.

1

Instructor: Philip Parzygnat

Summation

1+2+..+n = .5(n x n) + .5 n

1

2

2

A proof without words

Sequences In mathematics sequences are or-dered sets of objects. Each object in a sequenceis associated with an index. A finite sequence{a1, a2, a3, ...an} is a sequence that has a definitebeginning and definite end. An infinite sequence{a1, a2, a3, ...} is a sequence that does not termi-nate. The natural numbers are an infinite sequence{1, 2, 3, ...}. The prime numbers are also an infi-nite sequences {2, 3, 5, 7, 11, ...}.

Series We can study sequences and propertiesof sequences independently or we can study se-ries. A series is the sum of the terms of a se-quence. The series {1 + 2 + 3 + ... + n} is equiv-

alent to n2 + n2

2 which is known as the closedform. A proof of this is depicted in the figure(to the left). When dealing with understand-ing series often two terms are used. Namely aseries is either divergent or a series is conver-gent. When we say a series diverges this impliesthat as the series grows, the sum of the seriesalso grows (without bound). When a series con-verges as it grows, a series approaches a certainlimit.

Geometric Series Here is an example of a convergent series S = {1 + 12 + 1

4 + 18 + 1

16 + ...}. As Sgrows S approaches 2. This example is a variation of the geometric series. In particular this series canbe written in sigma notation as follows:

∑∞i=0

12i

Sigma Notation Summation is the process of adding a sequence of terms. Sigma notation is usedto represent the summation process in short hand form. We can write

∑βi=α ai to denote the sum

{aα + aα+1 + ...+ aβ} We call α the lower bound and β the upper bound. ai is called the term.

1

Mathematica In Mathematica the Sum[.] built in function can be used to sum a finite series. In orderto devise a closed form for an infinite series we still must use our intuition. At present computers arenot powerful enough to derive closed forms of infinite series. In fact many mathematicians study thisproblem in research. The following is an example of how Sum[.] works for finite series in Mathematica:

Sum[ai, {i, a, b}]

In the above example ai is the term, a is the lower bound, and b is the upper bound.

2

Instructor: Philip Parzygnat

Computers and Recursion

1 2

3 4 5

Recursion

Computers The modern computer is a prod-uct of late 19th and early 20th century math-ematics, physics, and engineering. Thinkershave tried to produce machines that help incalculations for centuries (i.e. the abacus).In the early 20th century two major devel-opments in science occurred (i.) the quan-tum physical revolution (the development of atheory of the atom) (ii.) the advent of themodern computer. Computers are theoreticallyfounded using a binary logic to represent infor-mation and definite algorithms to process infor-mation.

Binary (Boolean) Logic Consider a lightswitch which is either on or off. A binary stateworks in the same fashion. A binary state has twoidentifying values, namely (i.) 1 (ii.) 0. Informa-tion that is processed by a computer is stored as asequence of binary states. (i.e. 01001010). These

binary sequences are further abstracted to form humanly legible information. For example, 8 binarystates can be used to represent characters in the English alphabet (this is known as ASCII encoding).The name Boolean is often used for binary logic to honour George Boole who first observed many prop-erties of binary systems.

Algorithms Computers process binary sequences using definite algorithms. Algorithms are loosleydefined as step by step procedures. Algorithms can be trivial (minimal) or very abstract. Here is analgorithm for selecting all prime numbers from a list of n Natural numbers (the Mathematica version ofthis algorithm was discussed in handout 2).

A) List the first n Natural numbers in their natural order.B) Identify the first number in the ordered list (if the first number is 1 immediately eliminate the

number).C) Eliminate every number in the full list that is divisible by the selected number.D) Repeat B and C until no new number is identifiable (i.e. the ent of our full list).

E) The list of numbers that have not been eliminated are the desired result.

Computers are able to process information in a finite number of steps. This implies that all algorithmshave a definite beginning and termination. Algorithms of this variety are called definite of deterministicprocesses.

Recursion Recursion is a mathematical method that applies a function continuously to an (initial)input until a desired result is reached. In particular consider the trivial recursive concept factorial (i.e.n!). In computing 7! one must computer 7× 6× 5× 4× 3 × 2× 1. Recursively, one can compute 7× 6!

1

where 6! is computed in the same fashion as 7! this process ends with 2×1! where 1! = 1. In other words,f(7) = 7× f(6) and f(6) = 6× f(5) etc. A recursive function descends until a desired limit (base case)is reached (in this example 1). Upon terminating at the limit the function then ascends to produce thedesired result.

2